I am using apache axis 1.4. I generated the stubs from wsdl using WSDL2JAVA in apache axis1.4. The SOAPAction request has a header part and body. SOAP method request looks like this
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <WS_Header xmlns="WebServices"> <sUser>string</sUser> <sPassword>string</sPassword> </WS_Header> </soap:Header> <soap:Body></soap:Body> </soap:Envelope> I am always getting authentication failed because i think i am not setting the soap call correctly Here is my client code WsLocator loc = new WsLocator(); WsSoap binding = loc.getwsSoap(); org.apache.axis.client.Stub stub = (Stub) binding; SOAPHeaderElement header = new SOAPHeaderElement(namespace,"WS_Header"); SOAPElement nodeWebUser = header.addChildElement("sUser"); nodeWebUser.addTextNode("String"); // similarly create another node and set password stub.setHeader(header); But when I see the .getSOAPPartAsString() in the stub, it looks different. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header><ns1:WS_Header soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="WebServices"> <ns1:sUser>String</ns1:sUser> <ns1:sPassword>String</ns1:sPassword> </ns1:WS_Header></soapenv:Header> How did it create a different looking request. Though the response is in the correct syntax. Can any one help me? -- View this message in context: http://old.nabble.com/Issue-when-Set-Soap-header-child-elements-in-apache-axis-stubs-tp31936127p31936127.html Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org