Returning XML from a web service

A

akosz

We have a web service that basically does as follows

<WebMethod()>
Public Function Verify(ByRef strXML As String) As Intege

Dim iRetCode As Integer = 0

iRetCode = DoStuff(strXML
If (iRetCode < 0) The
Return iRetCod
End I

Return iRetCod
End Functio

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: &lt; and &gt; ). If we change the code to

<WebMethod()>
Public Function Verify(ByRef strXML As String) As Intege

Dim iRetCode As Integer = 0

iRetCode = DoStuff(strXML
If (iRetCode < 0) The
strXML = "<![CDATA[" + strXML + "]]>
Return iRetCod
End I

strXML = "<![CDATA[" + strXML + "]]>
Return iRetCod
End Functio

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

akos
 
D

Dino Chiesa [Microsoft]

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/service04162003.asp

-Dino

akosz said:
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: &lt; and
&gt; ). 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top