You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by Bernd Huber <bh...@racos.com> on 2007/12/10 14:46:23 UTC
Axis 1.3 Sessions with Rampart 1.3 - org.apache.ws.security.WSSecurityException:
Error in converting SOAP Envelope to Document
Hi all,
i tried to use the axis2 1.3 session management (scope="soapsession" in
services.xml) in combination with the rampart 1.3 security policy.
I get the following error message on the client side at the time, when
the client receives the HTTP-Response from the Web Service.
-------------------
org.apache.axis2.AxisFault: Error in extracting message properties
at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)
at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:377)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
at test.Main.main(Main.java:74)
Caused by: org.apache.rampart.RampartException: Error in extracting
message properties
at
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:290)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:58)
at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
... 9 more
Caused by: org.apache.ws.security.WSSecurityException: Error in
converting SOAP Envelope to Document; nested exception is:
java.lang.ClassCastException:
org.apache.axiom.om.impl.llom.OMElementImpl cannot be cast to
org.apache.axiom.soap.SOAPHeaderBlock
at
org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:157)
at
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:150)
... 11 more
Caused by: java.lang.ClassCastException:
org.apache.axiom.om.impl.llom.OMElementImpl cannot be cast to
org.apache.axiom.soap.SOAPHeaderBlock
at
org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:107)
... 12 more
------------------
The following code snippet shows the HTTP-Response:
------------------
Transfer-Encoding: chunked
Date: Fri, 16 Nov 2007 14:45:31 GMT
3bd
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<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" />
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
<wsa:ReferenceParameters>
<axis2:ServiceGroupId
xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:46749A55015C426EFB1195224328337</axis2:ServiceGroupId>
</wsa:ReferenceParameters>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:46749A55015C426EFB1195224328339</wsa:MessageID>
<wsa:Action>urn:echoResponse</wsa:Action>
<wsa:RelatesTo>urn:uuid:F35AC8561E9D21342C1195224328220</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns:echoResponse xmlns:ns="http://test">
<ns:return>echo string an web service</ns:return>
</ns:echoResponse>
</soapenv:Body>
</soapenv:Envelope>
0
------------------
This scenario works without problems when i use rampart 1.2 and axis2 1.2.
- When i only use session management without rampart, the sessions are
created correctly and also destroy themselves after the default time of
30 secs.
- When i only use rampart without the session management the security
authentication works correctly.
If code snippets from the client or web service is needed, please ask.
The function in the web service i try to invoke is a simple echo function.
Thanks,
B. Huber