webservice without objectmodel possible?

  • Thread starter Thread starter hvj
  • Start date Start date
H

hvj

I am working on webservice wrapper for an application that returns xml
in the form of a large string. On a somewhat simplified level all I
want to do is put this xml in a proper soap envelope and return it to
the caller of the wrapper webservice.

However the standard ways of making a webservice in Visual Studio lets
me make an objectmodel that is serialized to xml. But I allready have
most of the xml and it seems such an unnecessary step to make an
objectrepresentation of it only in order to communicate this xml over
a webservice.

What I can think about is loading the xml into an XmlDocument and let
that be serialized again to xml by asp.net, but that feels a bit like
a workaround.

Is there an other way to make a webservice and just define the xml of
a respons directly?
 
I am working on webservice wrapper for an application that returns xml
in the form of a large string. On a somewhat simplified level all I
want to do is put this xml in a proper soap envelope and return it to
the caller of the wrapper webservice.

However the standard ways of making a webservice in Visual Studio lets
me make an objectmodel that is serialized to xml. But I allready have
most of the xml and it seems such an unnecessary step to make an
objectrepresentation of it only in order to communicate this xml over
a webservice.

What I can think about is loading the xml into an XmlDocument and let
that be serialized again to xml by asp.net, but that feels a bit like
a workaround.

Is there an other way to make a webservice and just define the xml of
a respons directly?

Yes. See "The Power of XmlElement Parameters in ASP.NET Web Methods" at
http://msdn2.microsoft.com/en-us/library/aa480498.aspx.
 
Hi John,

Thanks for your reply. However, it seems to me that the described
method only allows you to have full access to the *requestmessage*,
but not to your responsmessage.

Henk
 
Hi John,

Thanks for your reply. However, it seems to me that the described
method only allows you to have full access to the *requestmessage*,
but not to your responsmessage.

You can do the same thing with the return value. Just place "return:" before
the attributes, like:

[return: XmlAnyElement(...)]
 
Back
Top