[ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=all ]
Rajith Attapattu resolved WSCOMMONS-84.
---------------------------------------
Resolution: Invalid
Hi Eran,
I finnaly tracked down the problem.
My code was creating a SOAP envelope (as a mistake) and then passing that into
the serviceClient.sendReceive(payload).
However the code only expects a payload (not the whole envelope) so it also
creates a SOAPEnvelope and add the payload as the SOAP body.
but now the SOAP envelope is duplicated and that was why this error was thrown
"Can not serialize OM Element Envelope".
the moment I removed the SOAP envelope part from my code it worked fine.
So maybe we should resolve this as it is not a bug.
Regards,
Rajith
> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize
> OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
> Key: WSCOMMONS-84
> URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
> Project: WS-Commons
> Issue Type: Bug
> Components: AXIOM
> Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
> Reporter: Rajith Attapattu
> Attachments: source.tar.gz, src.tar.gz, TravelAgenClient.java
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as
> well, in case u wanna have a look at it.
> Exception in thread "main" java.lang.RuntimeException: Can not serialize OM
> Element Envelope
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
> [java] at java.lang.String.valueOf(String.java:2615)
> [java] at java.io.PrintStream.print(PrintStream.java:616)
> [java] at java.io.PrintStream.println(PrintStream.java:753)
> [java] at
> sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
> [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML
> declaration, after other output has already been done.
> [java] at
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
> [java] at
> com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
> [java] at
> com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
> [java] at
> com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
> [java] at
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
> [java] at
> org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
> [java] at
> org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
> [java] at
> org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
> [java] at
> org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
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]