loHTTP=CREATEOBJECT('MSXML2.ServerXMLHTTP') loHTTP.Open('GET',lcUrl,.F.) loHTTP.Send() loXML=loHTTP.ResponseXML RETURN STRCONV(STRCONV(loXML.XML,1),9)Then, having our Web app to use CURSORTOXML(), which works, would go approx. like this:
lcHtml='' lcHtml=lcHtml+'HTTP/1.0 200 OK'+CHR(10) lcHtml=lcHtml+'Content-type: text/xml'+CHR(10) lcHtml=lcHtml+'Expires: -1' lcHtml=lcHtml+CHR(10) SELECT * FROM ALIAS() INTO CURSOR Temp CURSORTOXML(ALIAS(),'lcXML',1,48,0,'1') lcHtml=lcHtml+lcXML RETURN lcHtmlHowever, as I need to conform to a specific XSD schema, I have to do it manually, which doesn't work anymore as the Web Service will obtain an empty value for loXML.XML:
lcHtml='' lcHtml=lcHtml+'HTTP/1.0 200 OK'+CHR(10) lcHtml=lcHtml+'Content-type: text/xml'+CHR(10) lcHtml=lcHtml+'Expires: -1' lcHtml=lcHtml+CHR(10) SELECT * FROM ALIAS() INTO CURSOR Temp lcHtml=lcHtml+'<?xml version="1.0" encoding="utf-8" ?>'+CHR(13) lcHtml=lcHtml+'<MyRoot>'+CHR(13) SCAN lcHtml=lcHtml+'<MyElement>'+CHR(13) ... lcHtml=lcHtml+'</MyElement>'+CHR(13) ENDSCAN lcHtml=lcHtml+'</MyRoot>'+CHR(13) RETURN lcHtmlSo, I guess something is missing in my approach in order to be compliant and have the XML string to be recognized in the loXML.XML.