Hi everyone,
I'm trying to use Axis2 to build a client that communicates with a
third-party web service that uses a proprietary authentication mechanism
involving a SOAP header. It works like this:
1. You call a login() method in the usual way (no extra headers) and the
SOAP envelope in the response contains a header (with
mustUnderstand="true") with an authentication token
2. Subsequent request need to contain this token in an authentication
header
I've created an ADB stub using wsdl2java and (after a bit of tinkering to
set Expect: 100-continue HTTP header) I am able to call the login() method
but the client chokes on the header in the response:
Exception in thread "Main Thread" java.lang.NullPointerException
at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(
AxisEngine.java:97)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
OutInAxisOperation.java:364)
at org.apache.axis2.description.OutInAxisOperationClient.send(
OutInAxisOperation.java:417)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(
OperationClient.java:165)
at com.db.pvsax.idssoap.MarketDataServiceStub.loginXML(
MarketDataServiceStub.java:849)
at com.db.pvsax.idssoap.IdsSample.main(IdsSample.java:24)
From what I can gather I need to write a module with a handler that will
deal with this error. I wrote a Module and a Handler class, created
module.xml, packaged them all into a .mar file put that and an axis2.xml
(with references to the module and the new phases) in the classpath but
nothing seems to be changing.
Questions for you fine people:
1. How can I figure out why my handler isn't being invoked? Is it enough
to put axis2.xml in the classpath? Any way to confirm (e.g. via debug
logging) that the module is being loaded?
2. How can my handler tell Axis that it understood the mustUnderstand
header to prevent the NPE above?
3. How can I configure the handler to only be used with this particular
web service and not the others I access from the same system that don't
have this authentication system? axis2.xml seems to be a global config
that would break everything else.
Regards,
Stephanos Piperoglou
Price Control
GTO - BAC IT
+44 20 754 59007
This mail is transmitted to you on behalf of the Great East London
Software Company
Diese Post wird Ihnen im Namen der Great East London Software Company
übermittelt
---
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and delete this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional
EU corporate and regulatory disclosures.