Unable to remove actor from axis header element
The web service call I am making from my WS client produces error because of actor in the axis header element. I create the header in my code but, removing the actor using removeActor() produces a null pointer exception (since it was never set) however, axis automatically sets a default actor on making the actual WS call. Any help will be valuable.
Regards,
Ashish
I am using axis 1.4
My config.wsdd :
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSen der"/>
<globalConfiguration >
<requestFlow >
<handler type="java:org.apache.ws.axis.security.WSDoAllSend er" >
<parameter name="action" value="UsernameToken"/>
<parameter name="user" value="USERNAME"/>
<parameter name="passwordCallbackClass" value="xxx.yyy.PWCallback"/>
<parameter name="passwordType" value="PasswordText"/>
<parameter name="mustUnderstand" value="true"/>
</handler>
</requestFlow>
</globalConfiguration>
</deployment>
My Java code :
OrderSubscriptions_Service orderSubService = new OrderSubscriptions_ServiceLocator();
orderSubscriptionsWSPort = orderSubService.getOrderSubscriptionsHttpPort();
SOAPHeaderElement soapHeaderElement = new SOAPHeaderElement("http://order.ws.smi.fsecure.com/",XXX);
soapHeaderElement.addTextNode(customerId);
((org.apache.axis.client.Stub)orderSubscriptionsWS Port).setHeader(soapHeaderElement);
((org.apache.axis.client.Stub)orderSubscriptionsWS Port).setTimeout(timeout)
My input SOAP message generated by java axis client (using axis 1.4):
<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>
<wsse:Security xmlns:wsse="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401ÂwssÂwssecurityÂsecextÂ1.0.xsd"
soapenv:mustUnderstand="1"><wsse:UsernameToken xmlns:wsu="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401ÂwssÂwssecurityÂutilityÂ1.0.xsd"
wsu:Id="UsernameTokenÂ25383640"><wsse:Username>US ERNAME</wsse:Username><wsse:Password Type="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401Â
wssÂusernameÂtokenÂprofileÂ1.0#PasswordText">P ASSWORD</wsse:Password></wsse:UsernameToken></wsse:Security>
<ns1:customerId xmlns:ns1="http://order.ws.smi.fsecure.com/" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0">XXX</ns1:customerId>
</soapenv:Header>
<soapenv:Body>
<getContinuousSubscriptions xmlns="http://order.ws.smi.fsecure.com">
<orderContinuousRequest>
<amount>1</amount>
<licenseSize>5</licenseSize>
<product>InternetSecurity</product>
<tag>inty</tag>
</orderContinuousRequest>
</getContinuousSubscriptions>
</soapenv:Body>
</soapenv:Envelope>
Expected format :
<soapenv:Envelope xmlns:ord="http://order.ws.smi.fsecure.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401ÂwssÂwssecurityÂsecextÂ1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameTokenÂ27708485" xmlns:wsu="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401ÂwssÂwssecurityÂutilityÂ1.0.xsd">
<wsse:Username>USER</wsse:Username>
<wsse:Password Type="http://docs.oasisÂopen.org/wss/2004/01/oasisÂ200401ÂwssÂusernameÂtokenÂprofileÂ1.0# PasswordText">PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<ord:customerId>XXX</ord:customerId>
</soapenv:Header>
<soapenv:Body>
<ord:getContinuousSubscriptions>
<ord:orderContinuousRequest>
<ord:amount>1</ord:amount>
<ord:licenseSize>5</ord:licenseSize>
<ord:product>InternetSecurity</ord:product>
<!ÂÂOptional:ÂÂ>
<ord:tag>YYYY</ord:tag>
</ord:orderContinuousRequest>
</ord:getContinuousSubscriptions>
</soapenv:Body>
</soapenv:Envelope>
|