Axis2 + Rampart X.509 + JAXB = Namespace URIs and local names to the
unmarshaller needs to be interned.
-------------------------------------------------------------------------------------------------------
Key: AXIS2-4981
URL: https://issues.apache.org/jira/browse/AXIS2-4981
Project: Axis2
Issue Type: Bug
Affects Versions: 1.5.4
Reporter: Rustam Abdullaev
When Axis2 is used with JAXB bindings and unencrypted SOAP body, all goes well,
but as soon as SOAP Body is encrypted (using X.509 token), both client-side and
server-side JAXB bindings stop working, on the client silently retuning empty
response objects (all fields = null).
The null response object is caused by the fact that JAXB by default swallows
errors.
Add this code to the generated stub (fromOM()) to reveal the underlying
exception:
unmarshaller.setEventHandler(
new ValidationEventHandler() {
public boolean handleEvent(ValidationEvent event ) {
throw new RuntimeException(event.getMessage(),
event.getLinkedException());
}
});
The underlying error is:
Namespace URIs and local names to the unmarshaller needs to be interned.
at test.TestServiceStub$1.handleEvent(TestServiceStub.java:408)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:635)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:114)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:243)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
at test.TestServiceStub.fromOM(TestServiceStub.java:414)
at test.TestServiceStub.test(TestServiceStub.java:201)
...
It looks like the error originates in Axiom
(org.apache.axiom.om.impl.SwitchingWrapper returns non-interned strings).
Tried different component versions / combinations, all resulted in the same
error:
Axis2 1.4 - 1.5.4
Rampart 1.4 - 1.5.1
JAXB 2.1.0 - 2.1.13
Axiom 1.2.0 - 1.2.11
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]