0

When I call my web service from android then instead of giving me a response. it returns the all the text that we get when we open web service in the browser. I looked into it and got that my soap action is either not correct or it's not been properly set up in the request header. Please help me finding that out. I am trying it for weeks but no luck.

Here I set action in header

httpPost.setHeader("Authorization", base64EncodedCredentials);
httpPost.addHeader("Content-Type", "text/xml;charset=\"utf-8\";action=\""+ soapAction + "\"");
httpPost.setEntity(se);
HttpResponse response = client.execute(httpPost,localContext);

I have also tried doing in this way but no luck

httpPost.addHeader("SOAPAction",soapAction);

Here is my wsdl webervice an it is openinig fine in soap UI tool enter image description here

Kindle Q
  • 944
  • 2
  • 19
  • 28
  • Your [SOAP endpoint](http://stackoverflow.com/questions/9807382/what-is-a-web-service-endpoint) might be incorrect. A missing SOAPAction or parameter usually returns an error and not the WSDL as described. – Yogi Mar 21 '16 at 12:46
  • yeah that is what making me confuse. It always returns this complete wsdl file. What should i check? – Faisal Athar Mar 21 '16 at 15:25
  • See this example: [How to do a SOAP Web Service call from Java class](http://stackoverflow.com/questions/15940234/how-to-do-a-soap-web-service-call-from-java-class). – Yogi Mar 21 '16 at 15:42

0 Answers0