Hi Benajamin,

There is not sendReveive method that takes a SOAP envelope as the parameter. Instead what you should give is the payload of your SOAP envelope. If you want to add headers there is a seperate 'adddHeader' method available.

If you are still getting the error, please send your full client code and the String u use to generate the SOAP envelope, for me to reproduce the error.


Chamikara


On 5/11/06, Benjamin Schmeling <[EMAIL PROTECTED]> wrote:
Sorry my fault my code looks like this:

ByteArrayInputStream inStr = new ByteArrayInputStream(soap.getBytes());
SOAPFactory fac =  OMAbstractFactory.getSOAP11Factory();
StAXSOAPModelBuilder builder =
OMXMLBuilderFactory.createStAXSOAPModelBuilder (fac,XMLInputFactory.newInstance().createXMLStreamReader(inStr));

SOAPEnvelope env = builder.getSOAPEnvelope();
OMElement omReturn = client.sendReceive(env);

But the same error like before...
> Hi Benajamin,
>
> As I gave in my previous code example dont use the line
> fac.createSOAPEnvelope (parser) to build the SOAP envelope.
>
> Use the method 'getSOAPEnvelope' of the StAXSOAPModelBuilder,
> Here it is again,
>
> String soap = "....";
> ByteArrayInputStream inStr = new ByteArrayInputStream(soap.getBytes());
> SOAPFactory fac =  OMAbstractFactory.getSOAP11Factory();
> StAXSOAPModelBuilder builder =
> OMXMLBuilderFactory.createStAXSOAPModelBuilder
>
> (fac,XMLInputFactory.newInstance().createXMLStreamReader(inStr));
> SOAPEnvelope env = builder.getSOAPEnvelope();
> client.sendReceive(env );
>
>
>
>
> Chamikara
>
>
> On 5/11/06, *Benjamin Schmeling* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>     Hi,
>
>     String soap = "....";
>     ByteArrayInputStream inStr = new
>     ByteArrayInputStream(soap.getBytes());
>     SOAPFactory fac =   OMAbstractFactory.getSOAP11Factory();
>     StAXSOAPModelBuilder builder =
>     OMXMLBuilderFactory.createStAXSOAPModelBuilder
>     (fac,XMLInputFactory.newInstance().createXMLStreamReader(inStr));
>     SOAPEnvelope env = builder.getSOAPEnvelope();
>     client.sendReceive(fac.createSOAPEnvelope (parser));
>
>     the last line throws the following exception:
>
>     org.apache.axiom.om.OMException : Root Element can not be detached
>         at
>     org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.detach(SOAPEnvelopeImpl.java:155)
>         at
>     org.apache.axiom.om.impl.llom.OMNodeImpl.setParent
>     (OMNodeImpl.java:117)
>         at
>     org.apache.axiom.soap.impl.llom.SOAPElement.setParent(SOAPElement.java:74)
>         at
>     org.apache.axiom.om.impl.llom.OMElementImpl.addChild (OMElementImpl.java:240)
>         at
>     org.apache.axiom.om.impl.llom.OMElementImpl.addChild
>     (OMElementImpl.java:197)
>         at
>     org.apache.axis2.client.ServiceClient.fillSoapEnvelope (ServiceClient.java:554)
>         at
>     org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(ServiceClient.java:467)
>         at
>     org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java:411)
>         at
>     org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:394)
>
>     What does this mean?
>     > Hi Benjamin,
>     >
>     > Try following,
>     >
>     > String soap = "....";
>     > ByteArrayInputStream inStr = new
>     ByteArrayInputStream(soap.getBytes());
>     > SOAPFactory fac =   OMAbstractFactory.getSOAP11Factory();
>     > StAXSOAPModelBuilder builder =
>     >
>     OMXMLBuilderFactory.createStAXSOAPModelBuilder(fac,XMLInputFactory.newInstance().createXMLStreamReader(inStr));
>     > SOAPEnvelope env = builder.getSOAPEnvelope();
>     >
>     >
>     >
>     > Chamikara
>     >
>     >
>     >
>     > On 5/10/06, *Benjamin Schmeling* < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>
>     > <mailto: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>>> wrote:
>     >
>     >     Hi,
>     >
>     >     I want to write a Web Service which sends reliable SOAP
>     messages with
>     >     Sandesha2. My input is a SOAP message as String. The problem
>     is that I
>     >     do not know how to transform this into an OMElement that can
>     be sent
>     >     with the ServiceClient class.
>     >
>     >     I tried something like this but it did not work:
>     >
>     >     String soap = "....";
>     >     ByteArrayInputStream inStr = new
>     >     ByteArrayInputStream( soap.getBytes());
>     >     SOAPFactory fac =   OMAbstractFactory.getSOAP11Factory();
>     >     OMXMLParserWrapper parser =
>     >     OMXMLBuilderFactory.createStAXSOAPModelBuilder (fac,
>     >     XMLInputFactory.newInstance ().createXMLStreamReader(inStr));
>     >     client.sendReceive(fac.createSOAPEnvelope (parser));
>     >
>     >     How can I get this working?
>     >
>     >     Thanks,
>     >
>     >     Benjamin
>     >
>     >
>     >
>     ---------------------------------------------------------------------
>     >     To unsubscribe, e-mail:
>     [EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>
>     >     <mailto: [EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>>
>     >     For additional commands, e-mail:
>     [EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>
>     >     <mailto:[EMAIL PROTECTED]
>     <mailto: [EMAIL PROTECTED]>>
>     >
>     >
>
>
>



Reply via email to