I have constructed a full soap envelope soapEnvelopeXML and I can see the call come through my TCP/IP Monitor, but the issue is that instead of calling the right method, the request URI comes in concatenated with the soapEnvelopeXML as if it is an option in the header. So i am not getting any result. I don’t want to pass in the parameters as JSON objects. Any ideas on where i could be going wrong?
$.ajax({
type: "GET",
url: "http://localhost:8080/webservice/serviceName/",
data: soapEnvelopeXML,
contentType: "text/xml",
dataType: "xml",
error: function(xhr, status, error) {
alert("Error processing your request: \n" + status + " : " + error);
},
success: function(response){
var xml = $(response);
alert(xml);
}
});
I have tested the code on top to use POST instead of GET but I was getting an empty response and I see that an empty webservice call was being made. I didnt know that GET was illegal for SOAP requests. Does anyone know why the sent content is an empty call?
Maybe the problem is that SOAP should be POST?
http://www.coderanch.com/t/463869/Web-Services/java/SOAP-request-as-HTTP
Update:
I am getting the same behavior on my local box if I go to localhost, but I got it working by doing this:
127.0.0.1Try this code, it is working for me:
I got this code from here: