Hi Martin,

thanks for your quick reply. Yes, those method are present in stub and the messagereceiver, too. WSDL2Java generated toOM methods for every single DocumentType the Service uses, but they are not static. Here an example:

private org.apache.axiom.om.OMElement toOM (net.enviromatics.www.ws.usermanagementservice.requests._2_0.CreateSubje ctRequestDocument param, boolean optimizeContent)
            throws org.apache.axis2.AxisFault{
org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new org.apache.axiom.om.impl.builder.StAXOMBuilder (org.apache.axiom.om.OMAbstractFactory.getOMFactory (),new org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader ())) ; org.apache.axiom.om.OMElement documentElement = builder.getDocumentElement();



((org.apache.axiom.om.impl.OMNodeEx) documentElement).setParent(null);
            return documentElement;
            }

There is also one single (non-static) fromOM method that contains if- statements for each DocumentType:

public org.apache.xmlbeans.XmlObject fromOM(
        org.apache.axiom.om.OMElement param,
        java.lang.Class type,
java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
        try{


if (net.enviromatics.www.ws.usermanagementservice.requests._2_0.CreateSubje ctRequestDocument.class.equals(type)){
            if (extraNamespaces!=null){
return net.enviromatics.www.ws.usermanagementservice.requests._2_0.CreateSubjec tRequestDocument.Factory.parse(
            param.getXMLStreamReaderWithoutCaching(),
new org.apache.xmlbeans.XmlOptions ().setLoadAdditionalNamespaces(extraNamespaces));
            }else{
return net.enviromatics.www.ws.usermanagementservice.requests._2_0.CreateSubjec tRequestDocument.Factory.parse(
            param.getXMLStreamReaderWithoutCaching());
            }
            }
        [...]

I want to point out again, that there is no issue with XMLBeans since the service itself works fine. But as I said I have to access (and process) the SOAPEnvelope for additional security implementation and a call to MessageContext.getCurrentMessageContext().getEnvelope ().toString() fails with the afore mentioned exceptions just in case of in-only operations.

Regards,

Martin



Am 23.09.2008 um 16:52 schrieb Martin Gainty:

Martin-

please verify WSDL2Java produces stub containing toOM and fromOM methods
(there was an bug with 0.95 version that was supposedly fixed)
http://issues.apache.org/jira/browse/AXIS2-515

WSDL2JAVA should produce something like
public static
org.apache.axiom.om.OMElement toOM (org.soapinterop.xsd.EchoStringParamDocument
param)// This method will handle the serialization.

public static org.apache.xmlbeans.XmlObject
fromOM(org.apache.axis2.om.OMElement param, java.lang.Class type) // This
method will handle the de-serialization.

Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> To: [email protected]
> From: [EMAIL PROTECTED]
> Subject: SOAPEnvelope deserialization error for in-only operations
> Date: Tue, 23 Sep 2008 16:12:58 +0200
>
> Hi all,
>
> I'm stuck with some strange issue about envelope deserialization when > performing in-only operations. I have to access the SOAPEnvelope from
> within the ServiceSkeleton implementation class. The envelope
> contained in the MessageContext is non-null and it seems to be valid
> because XMLBeans parameter is correct. Nevertheless if I call toString
> () method on the envelope object an OMException, caused by a
> NoSuchElementException is thrown. I also tried to convert the
> envelope to an org.w3c.dom.Element but calling toString on this
> object I receive a RuntimeException with message 'Can not serialize
> OM Element Envelope', caused by a XMLStreamException.
> This phenomenon looks rather strange to me because this is only true
> for in-only operations and XMLBeans CAN build a valid object from the
> SOAPBody in any case. Furthermore the envelope of in-out operations
> is all valid.
>
> I use Axis2 1.4.1 on top of Tomcat 6.0.14 and generate the service
> client and server classes from WSDL 1.1 using WSDL2Java and XMLBeans
> 2.3.0.
>
> I found some issues about deserialization of the envelope. Could
> there be any relation? Does anyone have a clue what could solve this
> issue since I already posted on axis-user but nobody could help me
> there and I need a solution to finish my current work. Therefore any
> help is very much appreciated.
>
> Thanks in advance.
>
> Regards,
>
> Martin
>
>
>
> PS:
> Two additional questions:
>
> - I'm wondering why WSDL2Java generates a service.xml which states
> that the MEP for in-only operations is "robust-in-only" since I'm
> using WSDL1.1 and as far as I know WSDL1.1 is not capable of that?!?
> Am I wrong with that?
> - I'm also wondering why the AbstractRobustInOnlyMessageReceiver and
> the AbstractInOutSyncMessageReceiver is used for robust-in-only and
> in-out mep, respectively, since both are deprecated? But this seems
> to be not that much of an issue...
>
> PPS:
> If you miss any information please let me know.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now

Reply via email to