Hi,

 

I'm not sure if this is the right place to post this question, however I
will risk it. Im using AXIOM and ADB to create SOAPEnvelope from raw xml
string. I think I have the steps nailed down however im getting the
following exception

 

 

Exception in thread "main" org.apache.axiom.om.OMException

      at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:151)

      at
org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:552
)

      at
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.ja
va:563)

      at
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstElement(OMElementImpl.ja
va:823)

      at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getHeader(SOAPEnvelopeImpl.
java:81)

 

 

Here is my code snippet.

 

ByteArrayInputStream bais = new ByteArrayInputStream(resp.getBytes());


                                    //Create an XMLStreamReader to get the
StAX events        

                                    XMLStreamReader reader =
XMLInputFactory.newInstance().createXMLStreamReader(bais);

                                    SOAP11Factory f = new SOAP11Factory();

                                    SOAPEnvelope _returnEnv;

                                    OMXMLParserWrapper wrapper =
OMXMLBuilderFactory.createStAXOMBuilder(f,reader);

 
_returnEnv=f.createSOAPEnvelope(wrapper);

                                    System.out.println(resp);

                                    //_returnEnv.setText(resp);

                                    

                                    

                                    

 
System.out.println(_returnEnv.toString());

 

Can anyone point me the error. Resp is an xml String here which is a valid
SOAP envelope.

 

Regards,

Chandan

Reply via email to