Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML manipulation under HTTP
Message
De
21/08/2002 11:49:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00691791
Message ID:
00692005
Vues:
21
>Hi Michel,
>
>>So far, so good, from the client, to the Web Service, to the Web Server, back to the Web Service and back to the client, I can obtain my XML. However, I have lost the UTF-8 conversion. Anyone knows why?<
>
>I'd add the encoding method to the HTTP header:
>
>
>Content-Type: text/xml; charset=utf-8
>
>
>and in the XML declaration
>
>
><?xml version="1.0" encoding="utf-8" ?>
>
Well, what is extremely strange in this one is that if I have my Web app to only return the string as is, without any header and without any STRCONV() conversion, I end up at my Web Service level with the proper string. So, it goes like this:
loHTTP=CREATEOBJECT('MSXML2.ServerXMLHTTP')
loHTTP.Open('GET',lcUrl,.F.)
loHTTP.Send()

* Just to see if string is ok before returning it to the client
STRTOFILE(loHTTP.ResponseBody,'d:\a.xml')

RETURN loHTTP.ResponseBody
I can verify that by looking at d:\a.xml file and see that it is a proper recognized XML file. However, it doesn't contain the UTF-8 equivalent but at least that part is working.

However, once the client receive the same string, it's all corrupted or in another format that I can't understand. The goal is, as it was not working with the previous approach was to have the Web app to only return the content as is without any UTF-8 conversion. I would then rely on the WS to do it.

Based on what you say, if I go back to my initial approach by having the Web app to return the XML content in UTF-8, if I use the proper HTTP header with charset=utf-8, does this mean I no longer need to convert my XML string into UTF-8 or that is still needed?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform