Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Administrators
Posted

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)?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...