|
I am using SOAP::Lite as a client to access a web service written in Java. I am getting the following error message:
Date: Thu, 11 Feb 2010 13:13:10 GMT
Server: Apache/2.0.59 (Unix) DAV/2 mod_jk/1.2.19
Content-Type: text/xml;charset=utf-8
Client-Date: Thu, 11 Feb 2010 13:06:39 GMT
Client-Peer: 172.30.224.110:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
X-Powered-By: Servlet 2.4; JBoss-4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)/Tomcat-
+5.5
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/s
+oap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLS
+chema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.generalException</faultcode
+><faultstring>WSDoAllReceiver: Request does not contain required Security header</faultstring><det
+ail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">uqma-rtapp101.qa.ofoto.com</ns1:hostname
+></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
SOAP::Deserializer::deserialize: ()
This error clearly says that I am missing the Security Header in the SOAP request.
Will you please help me how can I achieve that using SOAP Lite.
I am also sending you a Java code which was also written for the same purpose (web service client).
public void setSecurityParams(CanonicalFulfiller fulfiller, org.apache.axis.client.Stub stub) {
if(fulfiller.isSecureCallbacks()) {
String user = fulfiller.getAuthUser();
String key = fulfiller.getAuthKey();
((org.apache.axis.client.Stub)stub)._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_DIGEST);
((org.apache.axis.client.Stub)stub)._setProperty(WSHandlerConstants.USER, user);
((org.apache.axis.client.Stub)stub)._setProperty(WSHandlerConstants.PW_CALLBACK_REF, new PWCallbackHandler(user, key));
setSecurityAction((org.apache.axis.client.Stub)stub, "UsernameToken");
} else {
setSecurityAction((org.apache.axis.client.Stub)stub, "");
}
}
So it looks to me that the security is WS.
Your help will be highly appreciated.
Thanks
-Ravi
|