You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Peter Ross <pr...@missioncriticalit.com> on 2003/07/09 12:39:54 UTC
Getting a webservice to return it's result as XML.
Hi,
I am trying to write a simple web-service.
public String GetForms()
{
return "<Forms><Form>XXX</Form><Form>YYY</Form></Forms>";
}
Currently when I expose this as a web-service it returns the XML
response as a string.
<GetFormsReturn xsi:type="xsd:string">
<Forms><Form>FormA</Form><Form>FormB</Form><Form>FormC</Form></Forms>
</GetFormsReturn>
What I would like to do is to return the XML directly. From my reading
of the Axis users guide I need to use a Document, Wrapped or Message
style service. However I am finding the documentation on these
confusing, and am unclear how I go about doing it.
If anyone can point me to some more documentation about which service to
use and how to do it, that would be great.
Regards,
Peter Ross
SOAP Response format
Posted by "D. Delcomminette" <dd...@aireinfo.com>.
Hi,
I met two different formats of SOAP response in different implementations, I
would like to know if they are both valid and wch oneis more usual or
advisable?
1)
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:d="http://www.w3.org/2001/XMLSchema"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wn0="http://systinet.com/xsd/SchemaTypes/"
xmlns:wn1="http://idoox.com/interface">
<e:Body>
<wn0:string_Response i:type="d:string">Hello, Domi!</wn0:string_Response>
</e:Body>
</e:Envelope>
2)
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wn0="http://systinet.com/xsd/SchemaTypes/"
<e:Body>
<string_Response xmlns="http://idoox.com ....">Hello,
Domi!</string_Response>
</e:Body>
</e:Envelope>
Some clients, like MS Infopath do no support the second fashion ????
Thanks
Dominique
Re: Getting a webservice to return it's result as XML.
Posted by vairamuthu thayapavan <vt...@vijayaba.cse.mrt.ac.lk>.
hi!
go to the example->message
u can get more knowledge
Regards,
vtpavan
----- Original Message -----
From: "Peter Ross" <pr...@missioncriticalit.com>
To: "Axis Users Mailing List" <ax...@ws.apache.org>
Sent: Wednesday, July 09, 2003 4:39 PM
Subject: Getting a webservice to return it's result as XML.
> Hi,
>
> I am trying to write a simple web-service.
>
> public String GetForms()
> {
> return "<Forms><Form>XXX</Form><Form>YYY</Form></Forms>";
> }
>
> Currently when I expose this as a web-service it returns the XML
> response as a string.
>
> <GetFormsReturn xsi:type="xsd:string">
> <Forms><Form>FormA</Form><Form>FormB</Form><Form>FormC</Form></Forms>
> </GetFormsReturn>
>
> What I would like to do is to return the XML directly. From my reading
> of the Axis users guide I need to use a Document, Wrapped or Message
> style service. However I am finding the documentation on these
> confusing, and am unclear how I go about doing it.
>
> If anyone can point me to some more documentation about which service to
> use and how to do it, that would be great.
>
> Regards,
> Peter Ross
>
>
Re: Getting a webservice to return it's result as XML.
Posted by Peter Ross <pr...@missioncriticalit.com>.
On Wed, Jul 09, 2003 at 12:45:18PM +0200, Andreas Bohnert wrote:
> examples/message should be a good starting point
>
Thanks for the pointer.
Does anyone else have anyother information sources about document and
wrapper services?
Re: Getting a webservice to return it's result as XML.
Posted by Andreas Bohnert <ab...@online.de>.
examples/message should be a good starting point
regards
andreas
----- Original Message -----
From: "Peter Ross" <pr...@missioncriticalit.com>
To: "Axis Users Mailing List" <ax...@ws.apache.org>
Sent: Wednesday, July 09, 2003 12:39 PM
Subject: Getting a webservice to return it's result as XML.
> Hi,
>
> I am trying to write a simple web-service.
>
> public String GetForms()
> {
> return "<Forms><Form>XXX</Form><Form>YYY</Form></Forms>";
> }
>
> Currently when I expose this as a web-service it returns the XML
> response as a string.
>
> <GetFormsReturn xsi:type="xsd:string">
> <Forms><Form>FormA</Form><Form>FormB</Form><Form>FormC</Form></Forms>
> </GetFormsReturn>
>
> What I would like to do is to return the XML directly. From my reading
> of the Axis users guide I need to use a Document, Wrapped or Message
> style service. However I am finding the documentation on these
> confusing, and am unclear how I go about doing it.
>
> If anyone can point me to some more documentation about which service to
> use and how to do it, that would be great.
>
> Regards,
> Peter Ross