[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Re: Returning XML from a web service

Dino Chiesa [Microsoft]

6/7/2004 11:28:00 PM

don't return it (or pass it) as a string!
pass it as an XmlElement.

check this article to see how:
http://msdn.microsoft.com/library/en-us/dnservice/html/service04...

-Dino

"akosz" <anonymous@discussions.microsoft.com> wrote in message
news:5A87AA5D-2580-4196-BFA2-D5BBC469FBCD@microsoft.com...
> We have a web service that basically does as follows:
>
> <WebMethod()> _
> Public Function Verify(ByRef strXML As String) As Integer
>
> Dim iRetCode As Integer = 0
>
> iRetCode = DoStuff(strXML)
> If (iRetCode < 0) Then
> Return iRetCode
> End If
>
> Return iRetCode
> End Function
>
> This works fine when we use a VB.NET or ColdFusion test app to send or
receive XML. However, some of our customers who aren't using VB or CF are
having the XML returned to them using entity references ( such as: < and
> ). If we change the code to:
>
> <WebMethod()> _
> Public Function Verify(ByRef strXML As String) As Integer
>
> Dim iRetCode As Integer = 0
>
> iRetCode = DoStuff(strXML)
> If (iRetCode < 0) Then
> strXML = "<![CDATA[" + strXML + "]]>"
> Return iRetCode
> End If
>
> strXML = "<![CDATA[" + strXML + "]]>"
> Return iRetCode
> End Function
>
> It eliminates their problem, but now the CF and VB.NET test apps of ours
are blowing up.
>
> Any suggestions on how to return XML that is universally readable?
>
> akosz
>