You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by David Q Levitt <dq...@us.ibm.com> on 2002/10/24 23:28:03 UTC

solution to deserializing an org.w3c.dom.Element in a SOAP client




I found the answer:

   SOAPMappingRegistry smr = new SOAPMappingRegistry();
    XMLParameterSerializer xmlSer = new XMLParameterSerializer();

    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("http://xml.apache.org/xml-soap", "Element"),
                 org.w3c.dom.Element.class, xmlSer, xmlSer);

    // Build the call.
    Call call = new Call();

    call.setSOAPMappingRegistry(smr);



                                                                                                                                     
                      David Q                                                                                                        
                      Levitt/Cambridge         To:      soap-user@xml.apache.org                                                     
                      /IBM@IBMUS               cc:                                                                                   
                                               Subject: Re: deserializing an org.w3c.dom.Element in a SOAP client                    
                      10/24/2002 04:36                                                                                               
                      PM                                                                                                             
                      Please respond                                                                                                 
                      to soap-user                                                                                                   
                                                                                                                                     
                                                                                                                                     








Here is what the TCPMON tool shows that I am getting back from the web
service:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:searchResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:LLSXMLTrial">
   <searchReturn xsi:type="ns2:Element"
xmlns:ns2="http://xml.apache.org/xml-soap">
    <courses>
     <course title="Intro to Computer Science"/>
    </courses>
   </searchReturn>
  </ns1:searchResponse>
 </soapenv:Body>
</soapenv:Envelope>

I think what the soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
statement does is to request that the server return its response as Literal
XML.  In the response above, the line    <searchReturn
xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap"> and the
subsequent XML (<courses>...., etc) indicates that the service is returning
the data in the literal XML encoding as requested.  However, it appears
that deserializing the XML into an Element object requires a separate
mechanism - probably a type mapping - which is where I'm having difficulty.

Any ideas?

- Dave
----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002 04:30 PM
-----

                      Scott Nichol

                      <snicholnews@scott         To:
soap-user@xml.apache.org

                      nichol.com>                cc:

                                                 Subject: Re: deserializing
an org.w3c.dom.Element in a SOAP client
                      10/24/2002 04:21

                      PM

                      Please respond to

                      soap-user






Using literal XML, as you show below, should allow you to deserializer
an Element, assuming it was serialized using literal XML on the sending
side.

Scott Nichol

----- Original Message -----
From: "David Q Levitt" <dq...@us.ibm.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 3:50 PM
Subject: deserializing an org.w3c.dom.Element in a SOAP client


>
>
>
>
> Is there a way to deserialize an org.w3c.dom.Element in a SOAP client
?  I
> am using
>         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> but apparently that's not enough.
>
> Do I need to create a mapping registry for deserializing
> org.w3c.dom.Element and if so what deserializer do I register?  or do
I
> have to create my own?
>
> Thanks,
>
> Dave Levitt
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>





--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>





--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Scott Nichol <sn...@scottnichol.com>.
Yes, but David claims in his original e-mail he was doing

         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);

Given this, I expected a literal XML response as you have described.
Further, given a SOAP encoded message being sent, the service's
deployment descriptor would have to specify a mapping for Element, as
the SOAPMappingRegistry only creates an implicit mapping for Element
with literal XML encoding.

Scott Nichol

----- Original Message -----
From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 11:02 PM
Subject: Re: solution to deserializing an org.w3c.dom.Element in a SOAP
client


> I do .. its because SOAP (v1.1 at least) does not have a fixed
> rule for determining the response encoding style. So there's
> a heuristic in Apache SOAP; see
org.apache.soap.server.RPCRouter.java's
> invoke method. Basically it picks the encoding style of the
> method call element if its there and if not keeps looking for
> the enc style from the parameters until it finds one. If none is
> found it defaults to SOAP-Enc.
>
> I don't see the incoming SOAP message below, but I imagine it had
> SOAP encoding style set on the call envelope. That's basically
> the reason ..
>
> Bye,
>
> Sanjiva.
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, October 25, 2002 4:50 AM
> Subject: Re: solution to deserializing an org.w3c.dom.Element in a
SOAP
> client
>
>
> > I'm glad you have a working solution.  It still does not answer why
the
> > response is SOAP encoded instead of literal XML.  Do you know why?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "David Q Levitt" <dq...@us.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Thursday, October 24, 2002 5:28 PM
> > Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
> > client
> >
> >
> > >
> > >
> > >
> > >
> > > I found the answer:
> > >
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
> > >
> > >     // Map the types.
> > >     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> > >                  new QName("http://xml.apache.org/xml-soap",
> > "Element"),
> > >                  org.w3c.dom.Element.class, xmlSer, xmlSer);
> > >
> > >     // Build the call.
> > >     Call call = new Call();
> > >
> > >     call.setSOAPMappingRegistry(smr);
> > >
> > >
> > >
> > >
> > >                       David Q
> > >                       Levitt/Cambridge         To:
> > soap-user@xml.apache.org
> > >                       /IBM@IBMUS               cc:
> > >                                                Subject: Re:
> > deserializing an org.w3c.dom.Element in a SOAP client
> > >                       10/24/2002 04:36
> > >                       PM
> > >                       Please respond
> > >                       to soap-user
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Here is what the TCPMON tool shows that I am getting back from the
web
> > > service:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > >  <soapenv:Body>
> > >   <ns1:searchResponse
> > > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:ns1="urn:LLSXMLTrial">
> > >    <searchReturn xsi:type="ns2:Element"
> > > xmlns:ns2="http://xml.apache.org/xml-soap">
> > >     <courses>
> > >      <course title="Intro to Computer Science"/>
> > >     </courses>
> > >    </searchReturn>
> > >   </ns1:searchResponse>
> > >  </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > > I think what the
> > soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> > > statement does is to request that the server return its response
as
> > Literal
> > > XML.  In the response above, the line    <searchReturn
> > > xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap">
and
> > the
> > > subsequent XML (<courses>...., etc) indicates that the service is
> > returning
> > > the data in the literal XML encoding as requested.  However, it
> > appears
> > > that deserializing the XML into an Element object requires a
separate
> > > mechanism - probably a type mapping - which is where I'm having
> > difficulty.
> > >
> > > Any ideas?
> > >
> > > - Dave
> > > ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002
04:30 PM
> > > -----
> > >
> > >                       Scott Nichol
> > >
> > >                       <snicholnews@scott         To:
> > > soap-user@xml.apache.org
> > >
> > >                       nichol.com>                cc:
> > >
> > >                                                  Subject: Re:
> > deserializing
> > > an org.w3c.dom.Element in a SOAP client
> > >                       10/24/2002 04:21
> > >
> > >                       PM
> > >
> > >                       Please respond to
> > >
> > >                       soap-user
> > >
> > >
> > >
> > >
> > >
> > >
> > > Using literal XML, as you show below, should allow you to
deserializer
> > > an Element, assuming it was serialized using literal XML on the
> > sending
> > > side.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "David Q Levitt" <dq...@us.ibm.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Thursday, October 24, 2002 3:50 PM
> > > Subject: deserializing an org.w3c.dom.Element in a SOAP client
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > > > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
> > client
> > > ?  I
> > > > am using
> > > >
soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > > > but apparently that's not enough.
> > > >
> > > > Do I need to create a mapping registry for deserializing
> > > > org.w3c.dom.Element and if so what deserializer do I register?
or
> > do
> > > I
> > > > have to create my own?
> > > >
> > > > Thanks,
> > > >
> > > > Dave Levitt
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Scott Nichol <sn...@scottnichol.com>.
Yes, but David claims in his original e-mail he was doing

         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);

Given this, I expected a literal XML response as you have described.
Further, given a SOAP encoded message being sent, the service's
deployment descriptor would have to specify a mapping for Element, as
the SOAPMappingRegistry only creates an implicit mapping for Element
with literal XML encoding.

Scott Nichol

----- Original Message -----
From: "Sanjiva Weerawarana" <sa...@watson.ibm.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 11:02 PM
Subject: Re: solution to deserializing an org.w3c.dom.Element in a SOAP
client


> I do .. its because SOAP (v1.1 at least) does not have a fixed
> rule for determining the response encoding style. So there's
> a heuristic in Apache SOAP; see
org.apache.soap.server.RPCRouter.java's
> invoke method. Basically it picks the encoding style of the
> method call element if its there and if not keeps looking for
> the enc style from the parameters until it finds one. If none is
> found it defaults to SOAP-Enc.
>
> I don't see the incoming SOAP message below, but I imagine it had
> SOAP encoding style set on the call envelope. That's basically
> the reason ..
>
> Bye,
>
> Sanjiva.
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Friday, October 25, 2002 4:50 AM
> Subject: Re: solution to deserializing an org.w3c.dom.Element in a
SOAP
> client
>
>
> > I'm glad you have a working solution.  It still does not answer why
the
> > response is SOAP encoded instead of literal XML.  Do you know why?
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "David Q Levitt" <dq...@us.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Thursday, October 24, 2002 5:28 PM
> > Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
> > client
> >
> >
> > >
> > >
> > >
> > >
> > > I found the answer:
> > >
> > >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > >     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
> > >
> > >     // Map the types.
> > >     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> > >                  new QName("http://xml.apache.org/xml-soap",
> > "Element"),
> > >                  org.w3c.dom.Element.class, xmlSer, xmlSer);
> > >
> > >     // Build the call.
> > >     Call call = new Call();
> > >
> > >     call.setSOAPMappingRegistry(smr);
> > >
> > >
> > >
> > >
> > >                       David Q
> > >                       Levitt/Cambridge         To:
> > soap-user@xml.apache.org
> > >                       /IBM@IBMUS               cc:
> > >                                                Subject: Re:
> > deserializing an org.w3c.dom.Element in a SOAP client
> > >                       10/24/2002 04:36
> > >                       PM
> > >                       Please respond
> > >                       to soap-user
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Here is what the TCPMON tool shows that I am getting back from the
web
> > > service:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > >  <soapenv:Body>
> > >   <ns1:searchResponse
> > > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:ns1="urn:LLSXMLTrial">
> > >    <searchReturn xsi:type="ns2:Element"
> > > xmlns:ns2="http://xml.apache.org/xml-soap">
> > >     <courses>
> > >      <course title="Intro to Computer Science"/>
> > >     </courses>
> > >    </searchReturn>
> > >   </ns1:searchResponse>
> > >  </soapenv:Body>
> > > </soapenv:Envelope>
> > >
> > > I think what the
> > soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> > > statement does is to request that the server return its response
as
> > Literal
> > > XML.  In the response above, the line    <searchReturn
> > > xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap">
and
> > the
> > > subsequent XML (<courses>...., etc) indicates that the service is
> > returning
> > > the data in the literal XML encoding as requested.  However, it
> > appears
> > > that deserializing the XML into an Element object requires a
separate
> > > mechanism - probably a type mapping - which is where I'm having
> > difficulty.
> > >
> > > Any ideas?
> > >
> > > - Dave
> > > ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002
04:30 PM
> > > -----
> > >
> > >                       Scott Nichol
> > >
> > >                       <snicholnews@scott         To:
> > > soap-user@xml.apache.org
> > >
> > >                       nichol.com>                cc:
> > >
> > >                                                  Subject: Re:
> > deserializing
> > > an org.w3c.dom.Element in a SOAP client
> > >                       10/24/2002 04:21
> > >
> > >                       PM
> > >
> > >                       Please respond to
> > >
> > >                       soap-user
> > >
> > >
> > >
> > >
> > >
> > >
> > > Using literal XML, as you show below, should allow you to
deserializer
> > > an Element, assuming it was serialized using literal XML on the
> > sending
> > > side.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "David Q Levitt" <dq...@us.ibm.com>
> > > To: <so...@xml.apache.org>
> > > Sent: Thursday, October 24, 2002 3:50 PM
> > > Subject: deserializing an org.w3c.dom.Element in a SOAP client
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > > > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
> > client
> > > ?  I
> > > > am using
> > > >
soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > > > but apparently that's not enough.
> > > >
> > > > Do I need to create a mapping registry for deserializing
> > > > org.w3c.dom.Element and if so what deserializer do I register?
or
> > do
> > > I
> > > > have to create my own?
> > > >
> > > > Thanks,
> > > >
> > > > Dave Levitt
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <ma...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > <ma...@xml.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I do .. its because SOAP (v1.1 at least) does not have a fixed
rule for determining the response encoding style. So there's
a heuristic in Apache SOAP; see org.apache.soap.server.RPCRouter.java's
invoke method. Basically it picks the encoding style of the
method call element if its there and if not keeps looking for
the enc style from the parameters until it finds one. If none is
found it defaults to SOAP-Enc.

I don't see the incoming SOAP message below, but I imagine it had
SOAP encoding style set on the call envelope. That's basically
the reason ..

Bye,

Sanjiva.

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, October 25, 2002 4:50 AM
Subject: Re: solution to deserializing an org.w3c.dom.Element in a SOAP
client


> I'm glad you have a working solution.  It still does not answer why the
> response is SOAP encoded instead of literal XML.  Do you know why?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "David Q Levitt" <dq...@us.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, October 24, 2002 5:28 PM
> Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
> client
>
>
> >
> >
> >
> >
> > I found the answer:
> >
> >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
> >
> >     // Map the types.
> >     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> >                  new QName("http://xml.apache.org/xml-soap",
> "Element"),
> >                  org.w3c.dom.Element.class, xmlSer, xmlSer);
> >
> >     // Build the call.
> >     Call call = new Call();
> >
> >     call.setSOAPMappingRegistry(smr);
> >
> >
> >
> >
> >                       David Q
> >                       Levitt/Cambridge         To:
> soap-user@xml.apache.org
> >                       /IBM@IBMUS               cc:
> >                                                Subject: Re:
> deserializing an org.w3c.dom.Element in a SOAP client
> >                       10/24/2002 04:36
> >                       PM
> >                       Please respond
> >                       to soap-user
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Here is what the TCPMON tool shows that I am getting back from the web
> > service:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >  <soapenv:Body>
> >   <ns1:searchResponse
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:ns1="urn:LLSXMLTrial">
> >    <searchReturn xsi:type="ns2:Element"
> > xmlns:ns2="http://xml.apache.org/xml-soap">
> >     <courses>
> >      <course title="Intro to Computer Science"/>
> >     </courses>
> >    </searchReturn>
> >   </ns1:searchResponse>
> >  </soapenv:Body>
> > </soapenv:Envelope>
> >
> > I think what the
> soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> > statement does is to request that the server return its response as
> Literal
> > XML.  In the response above, the line    <searchReturn
> > xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap"> and
> the
> > subsequent XML (<courses>...., etc) indicates that the service is
> returning
> > the data in the literal XML encoding as requested.  However, it
> appears
> > that deserializing the XML into an Element object requires a separate
> > mechanism - probably a type mapping - which is where I'm having
> difficulty.
> >
> > Any ideas?
> >
> > - Dave
> > ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002 04:30 PM
> > -----
> >
> >                       Scott Nichol
> >
> >                       <snicholnews@scott         To:
> > soap-user@xml.apache.org
> >
> >                       nichol.com>                cc:
> >
> >                                                  Subject: Re:
> deserializing
> > an org.w3c.dom.Element in a SOAP client
> >                       10/24/2002 04:21
> >
> >                       PM
> >
> >                       Please respond to
> >
> >                       soap-user
> >
> >
> >
> >
> >
> >
> > Using literal XML, as you show below, should allow you to deserializer
> > an Element, assuming it was serialized using literal XML on the
> sending
> > side.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "David Q Levitt" <dq...@us.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Thursday, October 24, 2002 3:50 PM
> > Subject: deserializing an org.w3c.dom.Element in a SOAP client
> >
> >
> > >
> > >
> > >
> > >
> > > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
> client
> > ?  I
> > > am using
> > >         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > > but apparently that's not enough.
> > >
> > > Do I need to create a mapping registry for deserializing
> > > org.w3c.dom.Element and if so what deserializer do I register?  or
> do
> > I
> > > have to create my own?
> > >
> > > Thanks,
> > >
> > > Dave Levitt
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
I do .. its because SOAP (v1.1 at least) does not have a fixed
rule for determining the response encoding style. So there's
a heuristic in Apache SOAP; see org.apache.soap.server.RPCRouter.java's
invoke method. Basically it picks the encoding style of the
method call element if its there and if not keeps looking for
the enc style from the parameters until it finds one. If none is
found it defaults to SOAP-Enc.

I don't see the incoming SOAP message below, but I imagine it had
SOAP encoding style set on the call envelope. That's basically
the reason ..

Bye,

Sanjiva.

----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Friday, October 25, 2002 4:50 AM
Subject: Re: solution to deserializing an org.w3c.dom.Element in a SOAP
client


> I'm glad you have a working solution.  It still does not answer why the
> response is SOAP encoded instead of literal XML.  Do you know why?
>
> Scott Nichol
>
> ----- Original Message -----
> From: "David Q Levitt" <dq...@us.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, October 24, 2002 5:28 PM
> Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
> client
>
>
> >
> >
> >
> >
> > I found the answer:
> >
> >    SOAPMappingRegistry smr = new SOAPMappingRegistry();
> >     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
> >
> >     // Map the types.
> >     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
> >                  new QName("http://xml.apache.org/xml-soap",
> "Element"),
> >                  org.w3c.dom.Element.class, xmlSer, xmlSer);
> >
> >     // Build the call.
> >     Call call = new Call();
> >
> >     call.setSOAPMappingRegistry(smr);
> >
> >
> >
> >
> >                       David Q
> >                       Levitt/Cambridge         To:
> soap-user@xml.apache.org
> >                       /IBM@IBMUS               cc:
> >                                                Subject: Re:
> deserializing an org.w3c.dom.Element in a SOAP client
> >                       10/24/2002 04:36
> >                       PM
> >                       Please respond
> >                       to soap-user
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Here is what the TCPMON tool shows that I am getting back from the web
> > service:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >  <soapenv:Body>
> >   <ns1:searchResponse
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:ns1="urn:LLSXMLTrial">
> >    <searchReturn xsi:type="ns2:Element"
> > xmlns:ns2="http://xml.apache.org/xml-soap">
> >     <courses>
> >      <course title="Intro to Computer Science"/>
> >     </courses>
> >    </searchReturn>
> >   </ns1:searchResponse>
> >  </soapenv:Body>
> > </soapenv:Envelope>
> >
> > I think what the
> soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> > statement does is to request that the server return its response as
> Literal
> > XML.  In the response above, the line    <searchReturn
> > xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap"> and
> the
> > subsequent XML (<courses>...., etc) indicates that the service is
> returning
> > the data in the literal XML encoding as requested.  However, it
> appears
> > that deserializing the XML into an Element object requires a separate
> > mechanism - probably a type mapping - which is where I'm having
> difficulty.
> >
> > Any ideas?
> >
> > - Dave
> > ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002 04:30 PM
> > -----
> >
> >                       Scott Nichol
> >
> >                       <snicholnews@scott         To:
> > soap-user@xml.apache.org
> >
> >                       nichol.com>                cc:
> >
> >                                                  Subject: Re:
> deserializing
> > an org.w3c.dom.Element in a SOAP client
> >                       10/24/2002 04:21
> >
> >                       PM
> >
> >                       Please respond to
> >
> >                       soap-user
> >
> >
> >
> >
> >
> >
> > Using literal XML, as you show below, should allow you to deserializer
> > an Element, assuming it was serialized using literal XML on the
> sending
> > side.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "David Q Levitt" <dq...@us.ibm.com>
> > To: <so...@xml.apache.org>
> > Sent: Thursday, October 24, 2002 3:50 PM
> > Subject: deserializing an org.w3c.dom.Element in a SOAP client
> >
> >
> > >
> > >
> > >
> > >
> > > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
> client
> > ?  I
> > > am using
> > >         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > > but apparently that's not enough.
> > >
> > > Do I need to create a mapping registry for deserializing
> > > org.w3c.dom.Element and if so what deserializer do I register?  or
> do
> > I
> > > have to create my own?
> > >
> > > Thanks,
> > >
> > > Dave Levitt
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Scott Nichol <sn...@scottnichol.com>.
I'm glad you have a working solution.  It still does not answer why the
response is SOAP encoded instead of literal XML.  Do you know why?

Scott Nichol

----- Original Message -----
From: "David Q Levitt" <dq...@us.ibm.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 5:28 PM
Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
client


>
>
>
>
> I found the answer:
>
>    SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
>
>     // Map the types.
>     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>                  new QName("http://xml.apache.org/xml-soap",
"Element"),
>                  org.w3c.dom.Element.class, xmlSer, xmlSer);
>
>     // Build the call.
>     Call call = new Call();
>
>     call.setSOAPMappingRegistry(smr);
>
>
>
>
>                       David Q
>                       Levitt/Cambridge         To:
soap-user@xml.apache.org
>                       /IBM@IBMUS               cc:
>                                                Subject: Re:
deserializing an org.w3c.dom.Element in a SOAP client
>                       10/24/2002 04:36
>                       PM
>                       Please respond
>                       to soap-user
>
>
>
>
>
>
>
>
>
>
> Here is what the TCPMON tool shows that I am getting back from the web
> service:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <soapenv:Body>
>   <ns1:searchResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="urn:LLSXMLTrial">
>    <searchReturn xsi:type="ns2:Element"
> xmlns:ns2="http://xml.apache.org/xml-soap">
>     <courses>
>      <course title="Intro to Computer Science"/>
>     </courses>
>    </searchReturn>
>   </ns1:searchResponse>
>  </soapenv:Body>
> </soapenv:Envelope>
>
> I think what the
soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> statement does is to request that the server return its response as
Literal
> XML.  In the response above, the line    <searchReturn
> xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap"> and
the
> subsequent XML (<courses>...., etc) indicates that the service is
returning
> the data in the literal XML encoding as requested.  However, it
appears
> that deserializing the XML into an Element object requires a separate
> mechanism - probably a type mapping - which is where I'm having
difficulty.
>
> Any ideas?
>
> - Dave
> ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002 04:30 PM
> -----
>
>                       Scott Nichol
>
>                       <snicholnews@scott         To:
> soap-user@xml.apache.org
>
>                       nichol.com>                cc:
>
>                                                  Subject: Re:
deserializing
> an org.w3c.dom.Element in a SOAP client
>                       10/24/2002 04:21
>
>                       PM
>
>                       Please respond to
>
>                       soap-user
>
>
>
>
>
>
> Using literal XML, as you show below, should allow you to deserializer
> an Element, assuming it was serialized using literal XML on the
sending
> side.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "David Q Levitt" <dq...@us.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, October 24, 2002 3:50 PM
> Subject: deserializing an org.w3c.dom.Element in a SOAP client
>
>
> >
> >
> >
> >
> > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
client
> ?  I
> > am using
> >         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > but apparently that's not enough.
> >
> > Do I need to create a mapping registry for deserializing
> > org.w3c.dom.Element and if so what deserializer do I register?  or
do
> I
> > have to create my own?
> >
> > Thanks,
> >
> > Dave Levitt
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: solution to deserializing an org.w3c.dom.Element in a SOAP client

Posted by Scott Nichol <sn...@scottnichol.com>.
I'm glad you have a working solution.  It still does not answer why the
response is SOAP encoded instead of literal XML.  Do you know why?

Scott Nichol

----- Original Message -----
From: "David Q Levitt" <dq...@us.ibm.com>
To: <so...@xml.apache.org>
Sent: Thursday, October 24, 2002 5:28 PM
Subject: solution to deserializing an org.w3c.dom.Element in a SOAP
client


>
>
>
>
> I found the answer:
>
>    SOAPMappingRegistry smr = new SOAPMappingRegistry();
>     XMLParameterSerializer xmlSer = new XMLParameterSerializer();
>
>     // Map the types.
>     smr.mapTypes(Constants.NS_URI_SOAP_ENC,
>                  new QName("http://xml.apache.org/xml-soap",
"Element"),
>                  org.w3c.dom.Element.class, xmlSer, xmlSer);
>
>     // Build the call.
>     Call call = new Call();
>
>     call.setSOAPMappingRegistry(smr);
>
>
>
>
>                       David Q
>                       Levitt/Cambridge         To:
soap-user@xml.apache.org
>                       /IBM@IBMUS               cc:
>                                                Subject: Re:
deserializing an org.w3c.dom.Element in a SOAP client
>                       10/24/2002 04:36
>                       PM
>                       Please respond
>                       to soap-user
>
>
>
>
>
>
>
>
>
>
> Here is what the TCPMON tool shows that I am getting back from the web
> service:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>  <soapenv:Body>
>   <ns1:searchResponse
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:ns1="urn:LLSXMLTrial">
>    <searchReturn xsi:type="ns2:Element"
> xmlns:ns2="http://xml.apache.org/xml-soap">
>     <courses>
>      <course title="Intro to Computer Science"/>
>     </courses>
>    </searchReturn>
>   </ns1:searchResponse>
>  </soapenv:Body>
> </soapenv:Envelope>
>
> I think what the
soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
> statement does is to request that the server return its response as
Literal
> XML.  In the response above, the line    <searchReturn
> xsi:type="ns2:Element" xmlns:ns2="http://xml.apache.org/xml-soap"> and
the
> subsequent XML (<courses>...., etc) indicates that the service is
returning
> the data in the literal XML encoding as requested.  However, it
appears
> that deserializing the XML into an Element object requires a separate
> mechanism - probably a type mapping - which is where I'm having
difficulty.
>
> Any ideas?
>
> - Dave
> ----- Forwarded by David Q Levitt/Cambridge/IBM on 10/24/2002 04:30 PM
> -----
>
>                       Scott Nichol
>
>                       <snicholnews@scott         To:
> soap-user@xml.apache.org
>
>                       nichol.com>                cc:
>
>                                                  Subject: Re:
deserializing
> an org.w3c.dom.Element in a SOAP client
>                       10/24/2002 04:21
>
>                       PM
>
>                       Please respond to
>
>                       soap-user
>
>
>
>
>
>
> Using literal XML, as you show below, should allow you to deserializer
> an Element, assuming it was serialized using literal XML on the
sending
> side.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "David Q Levitt" <dq...@us.ibm.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, October 24, 2002 3:50 PM
> Subject: deserializing an org.w3c.dom.Element in a SOAP client
>
>
> >
> >
> >
> >
> > Is there a way to deserialize an org.w3c.dom.Element in a SOAP
client
> ?  I
> > am using
> >         soapCall.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
> > but apparently that's not enough.
> >
> > Do I need to create a mapping registry for deserializing
> > org.w3c.dom.Element and if so what deserializer do I register?  or
do
> I
> > have to create my own?
> >
> > Thanks,
> >
> > Dave Levitt
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>