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. 22, 2013
07:56 am
3P50H0RWYShow this entire thread in new window
Gratar Image based on email address
From:Hermann Strijewski
To:Rick Strahl
Thank you Rick for your help! I'm still stumbling a bit maybe because I don't understand this business around UTF-8 enough.
1. Is there a public-domain web site where I could direct my XML packet and then it will show the results of parsing my packet?
2. Is there some way to turn on UTF-8 for oHTTP, such as oHTTP.AddPostKey(STRCONV(CXML,10))
3. I feel I would be better off actually using your wwSoap masterpieces, and then maybe those will solve the UTF-8 problem automatically. What would be code sample to generate a packet like what I'm trying to do in wwSoap?

To answer your question, the XML I'm sending is generated like this:

CR=CHR(13)+CHR(10) CXML= '<?xml version="1.0" encoding="utf-8" ?>'+CR CXML=CXML+ '<YourMembership>'+CR CXML=CXML+ '<Version>1.95</Version>'+CR CXML=CXML+ '<ApiKey>00000000-0000-0000-0000-0000000000</ApiKey>'+CR CXML=CXML+ '<CallID>002</CallID>'+CR CXML=CXML+ '<SaPasscode>********</SaPasscode>'+CR CXML=CXML+ '<Call Method="Sa.Members.All.GetIDs">'+CR CXML=CXML+ '<Timestamp>2008-01-01 00:00:00</Timestamp>'+CR CXML=CXML+ '</Call>'+CR CXML=CXML+ '</YourMembership>' oHTTP = CREATEOBJECT("wwHttp") oHTTP.HTTPConnect("api.yourmembership.com",,,.T.) oHTTP.nHttpPostMode = 4 && XML oHTTP.AddPostKey(CXML) LCHTML="" LNTEXT=0 lnResult=oHTTP.HTTPGetEx("/",@lcHTML,@lnText)

What I'm getting back from their system is this packet:

<?xmlversion="1.0" encoding="utf-8" ?><YourMembership_Response><ErrCode>902</ErrCode><ExtendedErrorInfo></ExtendedErrorInfo><ErrDesc>XML packet is malformed or otherwise unreadable.</ErrDesc><XmlRequest><unnamed></unnamed></XmlRequest></YourMembership_Response>

Thanks in advance again!

What does the actual XML look like? You have the doc set to utf-8 encoding but is the document actually UTF-8 encided?

You should validate the XML by loading it into an XML dom - that will tell you if there's a problem. IOW, if there are extended characters (or quotes or ampersands >< etc) in the content that will make the XML document fail to validate.

+++ Rick ---



Viewing all articles
Browse latest Browse all 10393

Trending Articles