Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-16-2009, 03:32 PM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 4
wqin is on a distinguished road
Default NSXMLParser - encoding problems?

Hi,

I've been writing an app that interacts with a remote web service, and I've tried to parse a SOAP response.

I have stored the response as a data object, and then transfered it to a NSString before parsing it with NSXMLParser.
I replaced all &lt; &gt; &amp with <,>,&.

But the parser has been acting up, with a certain error: (NSXMLParserErrorDomain error 100.)

Here's my log:
2009-07-16 15:45:19.096 Bus[3656:20b] didstartElement call soap:Envelope
2009-07-16 15:45:19.097 Bus[3656:20b] didstartElement call soap:Body
2009-07-16 15:45:19.099 Bus[3656:20b] ERROR:Operation could not be completed. (NSXMLParserErrorDomain error 100.)
2009-07-16 15:45:19.099 Bus[3656:20b] didstartElement call loginResponse
2009-07-16 15:45:19.100 Bus[3656:20b] didstartElement call s-gensym3
2009-07-16 15:45:19.100 Bus[3656:20b] foundCharacters <
2009-07-16 15:45:19.101 Bus[3656:20b] foundCharacters root
2009-07-16 15:45:19.102 Bus[3656:20b] foundCharacters >
...
The parser cannot recognize <root> as an Element name!!! and returns it as three separate entities.
It does this for all of <root>'s child elements also!

I think this and the error have something to do with &lt, &gt, &amp,
even though I converted them to <>& in the NSString. The parser obviously still recognizes the ampersand, despite my replacing them. I think something is up with the encoding.

If anybody could advise me if there is a quick fix or something I could do to bypass this?

Thanks in advance.
wqin is offline   Reply With Quote
Old 07-28-2009, 11:02 AM   #2 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 4
wqin is on a distinguished road
Default

It turns out that the webservice escaped out all XML inside the SOAP body, although I still get error 100 , the app still runs fine, and I have since resolved this issue.
wqin is offline   Reply With Quote
Reply

Bookmarks

Tags
encoding, nsxmlparser, parse, soap, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 321
9 members and 312 guests
chiataytuday, coolman, givensur, ipodphone, jbro, mottdog, mtl_tech_guy, Punkjumper, vilisei
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,882
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:19 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0