akosz Posted June 7, 2004 Posted June 7, 2004 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 Quote
Administrators PlausiblyDamp Posted June 7, 2004 Administrators Posted June 7, 2004 Could you post a sample of the XML that is passed into and back from this function? From both versions of the function if you could. Also is the snippet you posted a cut down version of the real functionality as you seem to have a redundant If (iRetCode < 0) check as you always just return the code anyway. Out of interest is the XML you are recieving / passing back defined by a particular scema (XSD)? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.