* Rebuild a XML document assuring a specific character encoding * * expC1 Target encoding - such as "utf-8" or "iso-8859-1" * expC2 XML document in string or object form FUNCTION ReEncodeXML PARAMETERS tcTargetEncoding,tcXML LOCAL lcCr,lcResultFile,lcReencoder,loXML,loStylesheet,loResultXML,lcXML lcCr=CHR(13)+CHR(10) lcReencoder='<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">'+lcCr+; '<xsl:output method="xml" encoding="'+LOWER(tcTargetEncoding)+'" omit-xml-declaration="no" indent="yes"/> '+lcCr+; '<xsl:template match="/ | @* | node()">'+lcCr+; '<xsl:copy>'+lcCr+; '<xsl:apply-templates select="@* | node()"/>'+lcCr+; '</xsl:copy>'+lcCr+; '</xsl:template>'+lcCr+; '</xsl:stylesheet>'+lcCr * Create an XML object from the string loXML=CREATEOBJECT('MSXML2.DOMDocument.3.0') loXML.Async=.F. loXML.LoadXML(tcXML) * Create an XML object for the stylesheet loStyleSheet=CREATEOBJECT('MSXML2.DOMDocument.3.0') loStyleSheet.Async=.F. loStyleSheet.LoadXML(lcReencoder) * Create the reencoded object loResultXML=CREATEOBJECT('MSXML2.DOMDocument.3.0') loResultXML.Async=.F. loResultXML.ValidateOnParse=.T. * Execute the transformation and store the transformation in the new object loXML.TransformNodeToObject(loStyleSheet,loResultXML) * Save the result to a temporary file and read it back as a string lcResultFile=ADDBS(SYS(2023))+SYS(2015)+'.xml' loResultXML.Save(lcResultFile) lcXML=FILETOSTR(lcResultFile) ERASE (lcResultFile) RETURN lcXMLNow, that the Web Service has been converted to .NET, do I really need to do the same or there could be this magic function I could call? :)