java - ActionMismatch while using web service -


i'm trying connect , use web service method. i'm getting following error:

the soap action specified on message, '', not match http soap action, 'http://tempuri.org/xpto/foobar'.  

in fact, code says this:

_state.getmessagecontext().setproperty("http.soap.action", "http://yadayadayada"); 

but doesn't state message.

the wsdl states this:

<wsdl:input wsaw:action="http://tempuri.org/foo/bar" message="tns:xpto"/> 

this question has been solved. had alter code auto generated wsdl2java. in stub class, auto generated code looks this;

    (...)            org.apache.axis.client.call _call = createcall();     _call.setoperation(_operations[11]);     _call.setusesoapaction(true);     _call.setsoapactionuri("http://tempuri.org/foo/bar");     _call.setencodingstyle(null);     _call.setproperty(org.apache.axis.client.call.send_type_attr, boolean.false);     _call.setproperty(org.apache.axis.axisengine.prop_domultirefs, boolean.false);     _call.setsoapversion(org.apache.axis.soap.soapconstants.soap12_constants);     _call.setoperationname(new javax.xml.namespace.qname("http://tempuri.org/", "bar"));      setrequestheaders(_call);     setattachments(_call); 

i had add following, before setrequestheaders:

    setheader("http://www.w3.org/2005/08/addressing", "to",  "http://wsdl.url");     setheader("http://www.w3.org/2005/08/addressing", "action",  "http://tempuri.org/foo/bar");      soapheaderelement[]  headers = getheaders();     (soapheaderelement h : headers) { h.setrole(null); }      setrequestheaders(_call);     setattachments(_call); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -