Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: XML packet is malformed or otherwise unreadable

$
0
0
Re: XML packet is malformed or otherwise unreadable
Web Connection 5.0
Re: XML packet is malformed or otherwise unreadable
Jan. 24, 2013
01:17 pm
3P70SHMRBShow this entire thread in new window
Gratar Image based on email address
From:Hermann Strijewski
To:Rick Strahl
Yes, THANK YOU RICK! Awesome! With Fiddler 4 we were finding that the YourMembership.com API expects a specific Content Type. This line did the trick:
oHTTP.cContentType="application/x-www-form-urlencoded; charset:utf-8"

Also thanks for the tip with the STRCONV. I always love VFP and Web Connection and the great support I get! Glad that I don't have to learn C#...
:) Hermann


Hermann,

From what you're posting here the string looks fine - it doesn't have extended characters. But to be sure you should use STRCONV(cXML,9) to encode any possible extended characters.

Ideally it's best to build up the XML inside of the XMLDOM... You can use wwXML::AddElement() method which will properly encode values. You load an empty document, then call AddElement to add the nodes.

Also you should the content-encoding to UTF-8 and content type to text/xml when sending. So set cContentType explicitly to:

text/xml;charset=utf-8

The error coming back from the server seems to indicate a failure of XML formatting, but it could also be a structural problem - maybe you're missing elements or values - I don't know. You'd have to check with the provider or try to dig up an example that you can check out and trace with Fiddler or in a browser. There may be other things that have to be matched.

+++ Rick ---


Viewing all articles
Browse latest Browse all 10393

Trending Articles