Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange behavior of Microsoft.XMLHTTP
Message
 
 
To
25/10/2001 01:16:29
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00573044
Message ID:
00573185
Views:
26
>I have found a strange behavior of Microsoft.XMLHTTP under a Web Service. Some of my methods are calling this method. This method queries a transaction to the other server. It can either receive an XML or a string. So, this is why I am checking for EMPTY(loXML.XML). If it is, I am returning the error message. Otherwise, the XML is returned.
>
>
>FUNCTION GetData(tcQuery as String) as string
>LOCAL loHttp,loXML
>loHTTP=CREATEOBJECT('Microsoft.XMLHTTP')
>loHTTP.Open('GET','http://...',.F.)
>loHTTP.Send()
>
>* Directly get an XMLDOM object
>loXML=loHTTP.ResponseXML
>
>* Check for error
>IF EMPTY(loXML.XML)
>   RETURN loHTTP.ResponseBody
>ENDIF
>
>
>If I do this from the client, it'll work. When it is not an XML, I am receiving the error message ok. However, having the same code on a Web Service will make the returned string of loHTTP.ResponseBody to be encrypted. I have to do this to avoid that.
>
>
>* Check for error
>IF EMPTY(loXML.XML)
>   RETURN ''+loHTTP.ResponseBody
>ENDIF
>
>
>Why is that?

I just took Rick Strahl's WWWC workshop this week, and he discussed that issue.

Since the SOAP response is itself XML, then if you return an XML value inside a SOAP response package, your return-value XML stream must be encoded so as not to confuse the parser(s). I believe he said this is part of the W3C SOAP spec.

I am unclear as to which class(es) actually handle the encoding/decoding. Maybe others here can give more "how-to" if this isn't enough of a hint to get you rolling.
"Problems cannot be solved at the same level of awareness that created them." - Albert Einstein

Bruce Allen
NTX Data
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform