Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning XML from a web service

Reply
Thread Tools

Returning XML from a web service

 
 
akosz
Guest
Posts: n/a
 
      06-07-2004
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

 
Reply With Quote
 
 
 
 
Dino Chiesa [Microsoft]
Guest
Posts: n/a
 
      06-07-2004
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...ce04162003.asp

-Dino

"akosz" <> wrote in message
news:5A87AA5D-2580-4196-BFA2-...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
returning none when it should be returning a list? randomtalk@gmail.com Python 11 05-02-2006 10:26 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Web Service Help for a Noob : Returning an XML String Nastero ASP .Net Web Services 1 03-31-2005 04:13 PM
XML Web Service fails with System.InvalidOperationException returning a DataSet with RowErrors Curly ASP .Net Web Services 0 08-19-2003 07:11 AM



Advertisments