You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Saint-Martin Cecile <cs...@symetrx.com> on 2001/05/16 15:18:29 UTC

XML Element as a return parameter

Hi,

We have a problem when returning an org.w3.dom.Element from an EJB method.
The EJB is deployed as SOAP service (SessionStateless).
We have a ClassCastException in XMLParameterSerializer : org.apache.xerces.ElementImpl
In fact, there is no way to precise encoding style for return value.
The only solution I found is to rewrite StatelessEJBProvider with encoding style set to literal XML for SOAP reponse.
Are they others?

Regards

Cecile Saint-Martin
csaintmartin@symetrx.com


Re: XML Element as a return parameter

Posted by Scott Nichol <sn...@computer.org>.
Raghu,

I am no expert on WSDL, but I do notice that the spec uses literal XML
encoding in several examples.  You can search the document for

    <soap:body use="literal"/>

which specifies literal XML encoding.

Of course, just because the spec defines this syntax does not mean that
environments can use it.  If one can specify the applicable XML Schema
within the <soap:body/> tag, then there would be a means to specify the
sematics of the literal XML.  Again, being not WSDL expert, I am not sure
whether one can do this.

Scott

----- Original Message -----
From: "Raghu Tholasendrapuram" <ra...@yackinc.com>
To: <so...@xml.apache.org>
Cc: <cs...@symetrx.com>; <na...@softhome.net>
Sent: Wednesday, May 16, 2001 9:16 PM
Subject: Re: XML Element as a return parameter


> Hi
>      You can do all that. But the question is how to specify these
> parameters like return type of Element and literal xml encdoing in WSDL. I
> have not seen a single WSDL with literal xml encoding. The main reason is
> that just with the help of WSDL the client application must be able to
> invoke a web service specified as part of WSDL without too much of client
> coding like new Call, new Parameter etc. The client must be as thin as
> possible.
> How can literal xml encoding and parameter of return type Elemet be
> specified in WSDL ? I would very much like to know the answer to this as I
> am returning a string in xml format instead of serializing the DOM tree
> which is possible with literal xml encoding and it is a much more elegant
> way of doing things.
>
> Cheers
> -Raghu
>
>
> ----- Original Message -----
> From: Naggi Rao <na...@softhome.net>
> To: <so...@xml.apache.org>
> Cc: <cs...@symetrx.com>
> Sent: Wednesday, May 16, 2001 05:31 PM
> Subject: Re: XML Element as a return parameter
>
>
> > Hi,
> > I have implemented a service that returns an Element.
> > Look at the AddressBook.getallListings Example it woudl give u a clear
> > picture.
> > Also important is that you have the following..:
> > <ns1:service xmlns:ns1="urn:xxx"
> > "SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml>
> >
> >
> >
> > Cheers,
> >
> > Naggi
> >
> >
> >
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Saint-Martin Cecile" <cs...@symetrx.com>
> > To: <so...@xml.apache.org>; <so...@xml.apache.org>
> > Sent: Wednesday, May 16, 2001 6:18 AM
> > Subject: XML Element as a return parameter
> >
> >
> > > Hi,
> > >
> > > We have a problem when returning an org.w3.dom.Element from an EJB
> method.
> > > The EJB is deployed as SOAP service (SessionStateless).
> > > We have a ClassCastException in XMLParameterSerializer :
> > org.apache.xerces.ElementImpl
> > > In fact, there is no way to precise encoding style for return value.
> > > The only solution I found is to rewrite StatelessEJBProvider with
> encoding
> > style set to literal XML for SOAP reponse.
> > > Are they others?
> > >
> > > Regards
> > >
> > > Cecile Saint-Martin
> > > csaintmartin@symetrx.com
> > >
> > >
> >
> >
>


Re: XML Element as a return parameter

Posted by Raghu Tholasendrapuram <ra...@yackinc.com>.
Hi
     You can do all that. But the question is how to specify these
parameters like return type of Element and literal xml encdoing in WSDL. I
have not seen a single WSDL with literal xml encoding. The main reason is
that just with the help of WSDL the client application must be able to
invoke a web service specified as part of WSDL without too much of client
coding like new Call, new Parameter etc. The client must be as thin as
possible.
How can literal xml encoding and parameter of return type Elemet be
specified in WSDL ? I would very much like to know the answer to this as I
am returning a string in xml format instead of serializing the DOM tree
which is possible with literal xml encoding and it is a much more elegant
way of doing things.

Cheers
-Raghu


----- Original Message -----
From: Naggi Rao <na...@softhome.net>
To: <so...@xml.apache.org>
Cc: <cs...@symetrx.com>
Sent: Wednesday, May 16, 2001 05:31 PM
Subject: Re: XML Element as a return parameter


> Hi,
> I have implemented a service that returns an Element.
> Look at the AddressBook.getallListings Example it woudl give u a clear
> picture.
> Also important is that you have the following..:
> <ns1:service xmlns:ns1="urn:xxx"
> "SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml>
>
>
>
> Cheers,
>
> Naggi
>
>
>
>
>
>
>
> ----- Original Message -----
> From: "Saint-Martin Cecile" <cs...@symetrx.com>
> To: <so...@xml.apache.org>; <so...@xml.apache.org>
> Sent: Wednesday, May 16, 2001 6:18 AM
> Subject: XML Element as a return parameter
>
>
> > Hi,
> >
> > We have a problem when returning an org.w3.dom.Element from an EJB
method.
> > The EJB is deployed as SOAP service (SessionStateless).
> > We have a ClassCastException in XMLParameterSerializer :
> org.apache.xerces.ElementImpl
> > In fact, there is no way to precise encoding style for return value.
> > The only solution I found is to rewrite StatelessEJBProvider with
encoding
> style set to literal XML for SOAP reponse.
> > Are they others?
> >
> > Regards
> >
> > Cecile Saint-Martin
> > csaintmartin@symetrx.com
> >
> >
>
>


Re: XML Element as a return parameter

Posted by Saint-Martin Cecile <cs...@symetrx.com>.
I can't do that, because unlike AddressBook.getallListings Example, I have non XML parameters, so I can't set encoding style for the
call to literal XML....

Cecile Saint-Martin
csaintmartin@symetrx.com

----- Original Message -----
From: "Naggi Rao" <na...@softhome.net>
To: <so...@xml.apache.org>
Cc: <cs...@symetrx.com>
Sent: Thursday, May 17, 2001 2:31 AM
Subject: Re: XML Element as a return parameter


> Hi,
> I have implemented a service that returns an Element.
> Look at the AddressBook.getallListings Example it woudl give u a clear
> picture.
> Also important is that you have the following..:
> <ns1:service xmlns:ns1="urn:xxx"
> "SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml>
>
>
>
> Cheers,
>
> Naggi



Re: XML Element as a return parameter

Posted by Naggi Rao <na...@softhome.net>.
Hi,
I have implemented a service that returns an Element.
Look at the AddressBook.getallListings Example it woudl give u a clear
picture.
Also important is that you have the following..:
<ns1:service xmlns:ns1="urn:xxx"
"SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml>



Cheers,

Naggi







----- Original Message -----
From: "Saint-Martin Cecile" <cs...@symetrx.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Wednesday, May 16, 2001 6:18 AM
Subject: XML Element as a return parameter


> Hi,
>
> We have a problem when returning an org.w3.dom.Element from an EJB method.
> The EJB is deployed as SOAP service (SessionStateless).
> We have a ClassCastException in XMLParameterSerializer :
org.apache.xerces.ElementImpl
> In fact, there is no way to precise encoding style for return value.
> The only solution I found is to rewrite StatelessEJBProvider with encoding
style set to literal XML for SOAP reponse.
> Are they others?
>
> Regards
>
> Cecile Saint-Martin
> csaintmartin@symetrx.com
>
>