all groups > dotnet web services > october 2006 >
You're in the

dotnet web services

group:

Send XML without SOAPEnvelope wrapper?


Send XML without SOAPEnvelope wrapper? rhea
10/27/2006 12:39:04 PM
dotnet web services:
I'm a Web Services newbie and I'm hoping some more experienced developers can
help me out.

I've written a .NET 2.0 web service that takes an XML file as input. The
SOAP envelope is pre-defined within the XML document.

I then send this XML to another web service (written in java) and that's
where I encounter problems. After using a port sniffer, it looks as though
the XML file I'm sending is being wrapped inside another SOAP envelope and
that could be causing the problem (since I already have the envelope defined
within the XML document).

Is there a way to send the XML doc to the next web service without wrapping
another SOAP envelope around it?

RE: Send XML without SOAPEnvelope wrapper? Claus Konrad [MCSD]
10/27/2006 2:47:03 PM
Sending an XML document as parameter to a method is not a good practice. It
is far from "typesafe" as an XML document can take more or less any form.

See this thread for a far better alternative:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.framework.webservices&mid=6d0ef089-2f91-400d-af4e-7ada36462aa2

Design:
A: Create a proxy towards your own webservice from your client.
B: Create a proxy (different) towards the java service.

Use the B to access Java with the parameters it expects, but do not just
forward the message coming into service A (your own). Consider and treat the
two services differently as they are indeed two different entities.


--
rgds.
/Claus Konrad


[quoted text, click to view]
Re: Send XML without SOAPEnvelope wrapper? John Saunders
10/28/2006 6:47:03 AM
[quoted text, click to view]

That's a very bad idea. As the name suggests, the envelope is wrapped around
the "message". It contains things like addressing information, routing
information, etc. The envelope is part of the protocol, not part of the data
transferred by the protocol.

If there are particular elements which your application requires to be in
the header, then you need to put them there by defining them in your web
service class as [SoapHeader] fields. But you can't just send out pre-canned
headers and cause no others to be placed in the output. \

John

AddThis Social Bookmark Button