java - Not able to get SOAP response using HttpClient, but works in SOAP UI -


i'm trying response of 1 wsdl. runs in soap ui. i'm using httpclient way response. error

<soapenv:fault xmlns:axis2ns22="http://www.w3.org/2003/05/soap-envelope"><soapenv:code><soapenv:value>axis2ns22:client</soapenv:value></soapenv:code><soapenv:reason><soapenv:text xml:lang="en-us">the endpoint reference (epr) operation not found  , wsa action = null</soapenv:text></soapenv:reason><soapenv:detail/></soapenv:fault></soapenv:body></soapenv:envelope> 

i'm not able understand is.. have tried giving text/xml content-type, says version mismatch. have given application/soap+xml worked couple of other webservices of same wsdl.

java code

postmethod method = new postmethod(httpclientrequest.getserverurl());      if(httpclientrequest.gethttprequestheadermap() != null) {         final requestentity entity = new bytearrayrequestentity(httpclientrequest.getrequestbodyasbytes());         method.setrequestentity(entity);         for(map.entry<string, string> entry : httpclientrequest.gethttprequestheadermap().entryset()) {             method.addrequestheader(entry.getkey(), entry.getvalue());         }     }          (map.entry<string, string> entry : httpclientrequest.gethttppostparameters().entryset()) {         method.addparameter(entry.getkey(),entry.getvalue());     }       try {         httpclient.gethttpconnectionmanager().getparams().setconnectiontimeout(integer.parseint(util.getconfig("httppost.connectiontimeout")));         httpclient.gethttpconnectionmanager().getparams().setsotimeout(integer.parseint(util.getconfig("httppost.sockettimeout")));         int statuscode = httpclient.executemethod(method);         string response = method.getresponsebodyasstring();         httpclientresponse.setresponseheaders(method.getresponseheaders());         httpclientresponse.setresponse(response); 

given you're using axis, missing soapaction header. @ least when worked (which while go) instructed include such header.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -