[ 
https://issues.apache.org/jira/browse/WSS-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044902#comment-13044902
 ] 

shivendra tripathi commented on WSS-293:
----------------------------------------

Exception is being thrown by WSSecuritryUtil#findWsseSecurityHeaderBlock in the 
following line: 

if (header == null && doCreate) {
            header = 
                createElementInSameNamespace(envelope, 
sc.getHeaderQName().getLocalPart());
            header = prependChildElement(envelope, header);
        }

WSSecuritryUtil belongs to wss4j.

If only rampart is engaged then header will be null.

header =  createElementInSameNamespace(envelope, 
sc.getHeaderQName().getLocalPart()); header return by this line is instance of 
OMElement. But the method
prependChildElement do a check to make sure envelope child is either instance 
of SOAPHeader or SOAPBody. And here it throws the exception.


            

> Getting exception when rampart is engaged without addressing at client side
> ---------------------------------------------------------------------------
>
>                 Key: WSS-293
>                 URL: https://issues.apache.org/jira/browse/WSS-293
>             Project: WSS4J
>          Issue Type: Bug
>          Components: WSS4J Core
>    Affects Versions: 1.5.10
>         Environment: windows
>            Reporter: shivendra tripathi
>            Assignee: Colm O hEigeartaigh
>
> Steps to reproduce:
> 1. Engage rampart and use policy based configuarion
> 2. Don't engage any other module like addressing 
> 3. Use OperationClient at client side and create soap envelope as follows
>         SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();// don't use 
> soapFactory.getDefaultEnvelope() to create soap envelope
>       SOAPBody sb = soapFactory.createSOAPBody(envelope);
> On execution following exception is thrown, since WSS4J is inserting the 
> header which is instance of OMElement and not of SOAPHeader. 
> Caused by: org.apache.rampart.RampartException: Error in extracting message 
> properties
>       at 
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:389)
>       at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
>       at 
> org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
>       ... 59 more
> Caused by: org.apache.axiom.soap.SOAPProcessingException: SOAP Envelope can 
> not have children other than SOAP Header and Body
>       at 
> org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl.checkChild(SOAPEnvelopeImpl.java:110)
>       at 
> org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl.insertBefore(SOAPEnvelopeImpl.java:164)
>       at 
> org.apache.ws.security.util.WSSecurityUtil.prependChildElement(WSSecurityUtil.java:646)
>       at 
> org.apache.ws.security.util.WSSecurityUtil.findWsseSecurityHeaderBlock(WSSecurityUtil.java:722)
>       at 
> org.apache.ws.security.message.WSSecHeader.insertSecurityHeader(WSSecHeader.java:146)
>       at 
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:379)

--
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]

Reply via email to