Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8369667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:42:31+00:00 2026-06-09T13:42:31+00:00

I created a Java web service in Netbeans 7.1.2 and managed to create a

  • 0

I created a Java web service in Netbeans 7.1.2 and managed to create a Java client also through netbeans to test it, and it worked. I then tried to create a jQuery client but failed.

The jQuery client code is:

$.ajax({
    type: "POST",
    url: "http://luke-test.j.layershift.co.uk/ClubInService/getHello",
    data: "{val:luke}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: OnSuccessCall,
    error: OnErrorCall
});

function OnSuccessCall(response) {
    $tmp = "";
    $.each(response, function(index, element) {
        $tmp += element + ";";
    });
    alert($tmp);
}


function OnErrorCall(response) {
    $tmp = "";
    $.each(response, function(index, element) {
        $tmp += element + ";";
    });
    alert($tmp);
}

The function I am trying to call is:

@WebMethod(operationName = "getHello")
public String getHello(@WebParam(name = "val", targetNamespace =
     "http://clubinservice/") String val) {
   return "Hello " + val + "!";
}

When using jQuery to consume the Java web service, I receive this error and have no clue what it means:

0;function (a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this};function (){return s===2?n:null};function (a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c};function (a){s||(d.mimeType=a);return this};function (a){a=a||”abort”,p&&p.abort(a),w(0,a);return this};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (){return e};function (){return!!i};function (){return!!i};function (a,b,c){i.done(a).fail(b).progress(c);return this};function (){i.done.apply(i,arguments).fail.apply(i,arguments);return this};function (a,b,c){return f.Deferred(function(d){f.each({done:[a,”resolve”],fail:[b,”reject”],progress:[c,”notify”]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?ia:ia})}).promise()};function (a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this};function (a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this};;0;error;

Feel free to try and use the function on the web service if it will help. Any help would be great!

Thanks

EDIT

After realising that i should be using JSON.stringify and thus:

function OnSuccessCall(response) {
    alert(JSON.stringify(response));
}


function OnErrorCall(response) {
    alert(JSON.stringify(response));
}

I received a different error message:

{"readyState":0,"responseText":"","status":0,"statusText":"error"}

After looking here and here I tried

$.post("http://luke-test.j.layershift.co.uk/ClubInService/getHello",
{val: "John"},
function(data){
    alert(JSON.stringify(data));
}, "json")
.error(function(data){alert(JSON.stringify(data));});

which also returned the error message:

{"readyState":0,"responseText":"","status":0,"statusText":"error"}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:42:33+00:00Added an answer on June 9, 2026 at 1:42 pm
    • try a relative url
    • use: contentType : “application/json”,
    • add: dataType : “json”,

    also, if you access another url than the url which serves your content there is a security on the browsers. In this case, you should read about jsonp:

    http://www.fbloggs.com/2010/07/09/how-to-access-cross-domain-data-with-ajax-using-jsonp-jquery-and-php/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to create a Web Service Client in my NetBeans Web Application
I have created a java web service with netbeans 7.1 (glassfish3.1). It is supposed
I have created a Java web service and I am trying to access this
I have created a simple web-service using Java. i want to load jars related
I am new to java based web service. I am able to create web
I created a simple XML web service using NetBeans 7's RESTful Web Services from
i am using Netbeans to create a Web Service and the code is written
I have a WCF client connecting to a Java based Axis2 web service (outside
I created a web service client and I am receiving the following error when
I've created an axis client for a web service. I exported as a jar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.