I forgot to attach the stacktrace:

org.apache.axis2.om.OMException
        at 
org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.next(StAXOMBuilder.java:273)
        at 
org.apache.axis2.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
        at 
org.apache.axis2.om.impl.llom.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:289)
        at 
org.objectweb.ResponseHandlerPortTypeStub.toOM(ResponseHandlerPortTypeStub.java:162)
        at 
org.objectweb.ResponseHandlerPortTypeStub.toEnvelope(ResponseHandlerPortTypeStub.java:176)
        at 
org.objectweb.ResponseHandlerPortTypeStub.contents(ResponseHandlerPortTypeStub.java:102)
        at org.objectweb.ResponseHandlerTest.main(ResponseHandlerTest.java:31)

   I really need help. I need to insert that info, but I can't... Any work 
around at least?

   Thanks,

     Ruben


On Wednesday 18 January 2006 18:30, Rubén Naranjo Izquierdo wrote:
>    Hi all,
>
>    I need to insert some information in SOAP Header field. In fact I need
> to insert a class created by wsdl2java which extends
> org.apache.xmlbeans.XmlObject. To do so I try the next on my PortType's
> stub:
>
> (...)
> SOAPHeaderBlock headBlock = envelope.getHeader().addHeaderBlock(...);
> headBlock.addChild(toOM(myType))
> (...)
>
> private OMElement toOM(XmlObject param) {
>       StAXOMBuilder builder = new
> StAXOMBuilder(OMAbstractFactory.getOMFactory(), new
> StreamWrapper(param.newXMLStreamReader()));
>       OMElement documentElement = builder.getDocumentElement();
>       ((OMNodeEx) documentElement).setParent(null);
>       return documentElement;
> }
>
>    Depending on the class I use when calling "toOM", I get a
> "java.lang.IllegalStateException", an "org.apache.axis2.om.OMException", or
> just works fine (as you may suppose, it works fine with the classes I don't
> need)
>
>    What am I doing wrong? Is that the correct way to convert from XmlObject
> to OMElement?
>
>    Thank you in advance,
>
>      Rubén

Reply via email to