You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by ma...@cnedi69.cnafmail.fr on 2001/06/07 16:38:33 UTC

Problem with getting Response

Hi,

I'm trying to make a program capable of sending a DOM Element (or Document)
to a SOAP server in order to manipule this Node ... the Call seems to work
but the response seems not to be correct ... here is the error message :
     Ouch, the call failed:
       Fault Code   = SOAP-ENV:Server
       Fault String = java.lang.IllegalArgumentException:
          No Serializer found to serialize a 'org.w3c.dom.Element' using
encoding style http://schemas.xmlsoap.org/soap/encoding/'.

Here is a part of my client program :
     params.addElement(new Parameter("addedDocument", Element.class,
requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
     call.setParams(params);
     Response resp;
     try
     {resp = call.invoke(url, "");}

Here is a simple program Server just to test it (it sends back the received
element ...) :
     public Element Traiter_Requete(Element ElementXML) throws IOException
           {
          return ElementXML;
           }

Can anybody help me with explaining how I can send any types of parameter
in a SOAP call and a SOAP Response ....  I manage to send primitive type as
String, file etc .... but I'd like to send others types of parameter ....
is it difficult ??

Thanks !!


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Problem with getting Response

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Actually there is a way in Apache SOAP .. its a little trick based
on how Apache SOAP determines the encoding to use for the returned
values. If you set an encoding style on the outgoing Call then
that will get used as the return encoding style. If you want to
encode outgoing parameters using a different encoding style, then
you can do that as you add each parameter - encoding style is
one of the arguments of Parameter. This is sort of how
samples.addressbook.GetAllListings works, except that doesn't have
any call parameters so its not fully illustrative.

However, you are right that SOAP has no first-class way to do that.
The above workaround is implementation dependent.

Sanjiva.

----- Original Message -----
From: "Saint-Martin Cecile" <cs...@symetrx.com>
To: <so...@xml.apache.org>
Sent: Thursday, June 07, 2001 11:30 AM
Subject: Re: Problem with getting Response


> There is  no way to specify encoding style for return parameter...
> To resolve this we have written our own provider...
> If all parameters you use (in and out) are DOM Element, you can write :
> call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
>
> See address book examples and mailing list archives.
>
> Cecile Saint-Martin
> csaintmartin@symetrx.com
>
>
> ----- Original Message -----
> From: <ma...@cnedi69.cnafmail.fr>
> To: <so...@xml.apache.org>
> Sent: Thursday, June 07, 2001 4:38 PM
> Subject: Problem with getting Response
>
>
> > Hi,
> >
> > I'm trying to make a program capable of sending a DOM Element (or
Document)
> > to a SOAP server in order to manipule this Node ... the Call seems to
work
> > but the response seems not to be correct ... here is the error message :
> >      Ouch, the call failed:
> >        Fault Code   = SOAP-ENV:Server
> >        Fault String = java.lang.IllegalArgumentException:
> >           No Serializer found to serialize a 'org.w3c.dom.Element' using
> > encoding style http://schemas.xmlsoap.org/soap/encoding/'.
> >
> > Here is a part of my client program :
> >      params.addElement(new Parameter("addedDocument", Element.class,
> > requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
> >      call.setParams(params);
> >      Response resp;
> >      try
> >      {resp = call.invoke(url, "");}
> >
> > Here is a simple program Server just to test it (it sends back the
received
> > element ...) :
> >      public Element Traiter_Requete(Element ElementXML) throws
IOException
> >            {
> >           return ElementXML;
> >            }
> >
> > Can anybody help me with explaining how I can send any types of
parameter
> > in a SOAP call and a SOAP Response ....  I manage to send primitive type
as
> > String, file etc .... but I'd like to send others types of parameter
....
> > is it difficult ??
> >
> > Thanks !!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Problem with getting Response

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Actually there is a way in Apache SOAP .. its a little trick based
on how Apache SOAP determines the encoding to use for the returned
values. If you set an encoding style on the outgoing Call then
that will get used as the return encoding style. If you want to
encode outgoing parameters using a different encoding style, then
you can do that as you add each parameter - encoding style is
one of the arguments of Parameter. This is sort of how
samples.addressbook.GetAllListings works, except that doesn't have
any call parameters so its not fully illustrative.

However, you are right that SOAP has no first-class way to do that.
The above workaround is implementation dependent.

Sanjiva.

----- Original Message -----
From: "Saint-Martin Cecile" <cs...@symetrx.com>
To: <so...@xml.apache.org>
Sent: Thursday, June 07, 2001 11:30 AM
Subject: Re: Problem with getting Response


> There is  no way to specify encoding style for return parameter...
> To resolve this we have written our own provider...
> If all parameters you use (in and out) are DOM Element, you can write :
> call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)
>
> See address book examples and mailing list archives.
>
> Cecile Saint-Martin
> csaintmartin@symetrx.com
>
>
> ----- Original Message -----
> From: <ma...@cnedi69.cnafmail.fr>
> To: <so...@xml.apache.org>
> Sent: Thursday, June 07, 2001 4:38 PM
> Subject: Problem with getting Response
>
>
> > Hi,
> >
> > I'm trying to make a program capable of sending a DOM Element (or
Document)
> > to a SOAP server in order to manipule this Node ... the Call seems to
work
> > but the response seems not to be correct ... here is the error message :
> >      Ouch, the call failed:
> >        Fault Code   = SOAP-ENV:Server
> >        Fault String = java.lang.IllegalArgumentException:
> >           No Serializer found to serialize a 'org.w3c.dom.Element' using
> > encoding style http://schemas.xmlsoap.org/soap/encoding/'.
> >
> > Here is a part of my client program :
> >      params.addElement(new Parameter("addedDocument", Element.class,
> > requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
> >      call.setParams(params);
> >      Response resp;
> >      try
> >      {resp = call.invoke(url, "");}
> >
> > Here is a simple program Server just to test it (it sends back the
received
> > element ...) :
> >      public Element Traiter_Requete(Element ElementXML) throws
IOException
> >            {
> >           return ElementXML;
> >            }
> >
> > Can anybody help me with explaining how I can send any types of
parameter
> > in a SOAP call and a SOAP Response ....  I manage to send primitive type
as
> > String, file etc .... but I'd like to send others types of parameter
....
> > is it difficult ??
> >
> > Thanks !!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> > For additional commands, email: soap-user-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Problem with getting Response

Posted by Saint-Martin Cecile <cs...@symetrx.com>.
There is  no way to specify encoding style for return parameter...
To resolve this we have written our own provider...
If all parameters you use (in and out) are DOM Element, you can write :
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)

See address book examples and mailing list archives.

Cecile Saint-Martin
csaintmartin@symetrx.com


----- Original Message ----- 
From: <ma...@cnedi69.cnafmail.fr>
To: <so...@xml.apache.org>
Sent: Thursday, June 07, 2001 4:38 PM
Subject: Problem with getting Response


> Hi,
> 
> I'm trying to make a program capable of sending a DOM Element (or Document)
> to a SOAP server in order to manipule this Node ... the Call seems to work
> but the response seems not to be correct ... here is the error message :
>      Ouch, the call failed:
>        Fault Code   = SOAP-ENV:Server
>        Fault String = java.lang.IllegalArgumentException:
>           No Serializer found to serialize a 'org.w3c.dom.Element' using
> encoding style http://schemas.xmlsoap.org/soap/encoding/'.
> 
> Here is a part of my client program :
>      params.addElement(new Parameter("addedDocument", Element.class,
> requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
>      call.setParams(params);
>      Response resp;
>      try
>      {resp = call.invoke(url, "");}
> 
> Here is a simple program Server just to test it (it sends back the received
> element ...) :
>      public Element Traiter_Requete(Element ElementXML) throws IOException
>            {
>           return ElementXML;
>            }
> 
> Can anybody help me with explaining how I can send any types of parameter
> in a SOAP call and a SOAP Response ....  I manage to send primitive type as
> String, file etc .... but I'd like to send others types of parameter ....
> is it difficult ??
> 
> Thanks !!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Problem with getting Response

Posted by Saint-Martin Cecile <cs...@symetrx.com>.
There is  no way to specify encoding style for return parameter...
To resolve this we have written our own provider...
If all parameters you use (in and out) are DOM Element, you can write :
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML)

See address book examples and mailing list archives.

Cecile Saint-Martin
csaintmartin@symetrx.com


----- Original Message ----- 
From: <ma...@cnedi69.cnafmail.fr>
To: <so...@xml.apache.org>
Sent: Thursday, June 07, 2001 4:38 PM
Subject: Problem with getting Response


> Hi,
> 
> I'm trying to make a program capable of sending a DOM Element (or Document)
> to a SOAP server in order to manipule this Node ... the Call seems to work
> but the response seems not to be correct ... here is the error message :
>      Ouch, the call failed:
>        Fault Code   = SOAP-ENV:Server
>        Fault String = java.lang.IllegalArgumentException:
>           No Serializer found to serialize a 'org.w3c.dom.Element' using
> encoding style http://schemas.xmlsoap.org/soap/encoding/'.
> 
> Here is a part of my client program :
>      params.addElement(new Parameter("addedDocument", Element.class,
> requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
>      call.setParams(params);
>      Response resp;
>      try
>      {resp = call.invoke(url, "");}
> 
> Here is a simple program Server just to test it (it sends back the received
> element ...) :
>      public Element Traiter_Requete(Element ElementXML) throws IOException
>            {
>           return ElementXML;
>            }
> 
> Can anybody help me with explaining how I can send any types of parameter
> in a SOAP call and a SOAP Response ....  I manage to send primitive type as
> String, file etc .... but I'd like to send others types of parameter ....
> is it difficult ??
> 
> Thanks !!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Problem with getting Response

Posted by Peer - Home Office <pb...@tampabay.rr.com>.
Manuel,

I'm new to developing soap applications and don't have any firsthand
experience to answer you question but I did manage to see an example of
software that shows how to send an XML element back.  I believe you may have
to define your own deserializer to handle the XML, but again I'm not sure.
The path to the sample I'm referring to is: /soap-2_2/sample/addressbook
Look at the GetAllListings.java class along with the Addressbook.java class
(specifically the getAllListings() method). Hopefully this will illustrate
the ideas you're interested in.

Peer

-----Original Message-----
From: manuel.paitreault@cnedi69.cnafmail.fr
[mailto:manuel.paitreault@cnedi69.cnafmail.fr]
Sent: Thursday, June 07, 2001 10:39 AM
To: soap-user@xml.apache.org
Subject: Problem with getting Response


Hi,

I'm trying to make a program capable of sending a DOM Element (or Document)
to a SOAP server in order to manipule this Node ... the Call seems to work
but the response seems not to be correct ... here is the error message :
     Ouch, the call failed:
       Fault Code   = SOAP-ENV:Server
       Fault String = java.lang.IllegalArgumentException:
          No Serializer found to serialize a 'org.w3c.dom.Element' using
encoding style http://schemas.xmlsoap.org/soap/encoding/'.

Here is a part of my client program :
     params.addElement(new Parameter("addedDocument", Element.class,
requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
     call.setParams(params);
     Response resp;
     try
     {resp = call.invoke(url, "");}

Here is a simple program Server just to test it (it sends back the received
element ...) :
     public Element Traiter_Requete(Element ElementXML) throws IOException
           {
          return ElementXML;
           }

Can anybody help me with explaining how I can send any types of parameter
in a SOAP call and a SOAP Response ....  I manage to send primitive type as
String, file etc .... but I'd like to send others types of parameter ....
is it difficult ??

Thanks !!


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


RE: Problem with getting Response

Posted by Peer - Home Office <pb...@tampabay.rr.com>.
Manuel,

I'm new to developing soap applications and don't have any firsthand
experience to answer you question but I did manage to see an example of
software that shows how to send an XML element back.  I believe you may have
to define your own deserializer to handle the XML, but again I'm not sure.
The path to the sample I'm referring to is: /soap-2_2/sample/addressbook
Look at the GetAllListings.java class along with the Addressbook.java class
(specifically the getAllListings() method). Hopefully this will illustrate
the ideas you're interested in.

Peer

-----Original Message-----
From: manuel.paitreault@cnedi69.cnafmail.fr
[mailto:manuel.paitreault@cnedi69.cnafmail.fr]
Sent: Thursday, June 07, 2001 10:39 AM
To: soap-user@xml.apache.org
Subject: Problem with getting Response


Hi,

I'm trying to make a program capable of sending a DOM Element (or Document)
to a SOAP server in order to manipule this Node ... the Call seems to work
but the response seems not to be correct ... here is the error message :
     Ouch, the call failed:
       Fault Code   = SOAP-ENV:Server
       Fault String = java.lang.IllegalArgumentException:
          No Serializer found to serialize a 'org.w3c.dom.Element' using
encoding style http://schemas.xmlsoap.org/soap/encoding/'.

Here is a part of my client program :
     params.addElement(new Parameter("addedDocument", Element.class,
requeteXML.getDocumentElement(), Constants.NS_URI_LITERAL_XML));
     call.setParams(params);
     Response resp;
     try
     {resp = call.invoke(url, "");}

Here is a simple program Server just to test it (it sends back the received
element ...) :
     public Element Traiter_Requete(Element ElementXML) throws IOException
           {
          return ElementXML;
           }

Can anybody help me with explaining how I can send any types of parameter
in a SOAP call and a SOAP Response ....  I manage to send primitive type as
String, file etc .... but I'd like to send others types of parameter ....
is it difficult ??

Thanks !!


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org