derftoy
asked on
Call ASP.NET Webservice with Soap and get back JSON
I am developing an iPad app that calls my ASP.NET Webservice. I am sending a SOAP request which works great. The response I am getting back is in XML wrapped around my JSON result.
My Webserivice has [ScriptMethod(ResponseForm at = ResponseFormat.Json)] but it is returning the above statement. I only want the JSON data that is bold.
Is this possible?
And for those wondering... I have the code already to create the soap requests, but I didn't want to mess with XMLParsing to get my results, as I read more and more, JSON and the JSON Framework for XCODE and IOS that I got works great for parsing and returning my data with one line of code...
Thanks,
Cory Jorgensen
Bitco Software
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AuthenticateUserResponse xmlns="http://www.bitcosoftware.com/">
<AuthenticateUserResult>
["Authentication Error: Please provide a Username and Password"]
</AuthenticateUserResult>
</AuthenticateUserResponse>
</soap:Body>
</soap:Envelope>
My Webserivice has [ScriptMethod(ResponseForm
Is this possible?
And for those wondering... I have the code already to create the soap requests, but I didn't want to mess with XMLParsing to get my results, as I read more and more, JSON and the JSON Framework for XCODE and IOS that I got works great for parsing and returning my data with one line of code...
Thanks,
Cory Jorgensen
Bitco Software
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
2011-10-20 09:21:09.266 PT Mobile[7428:11603] Data: ["8085a2a1-e6bc-422b-969a-
Now, if I open up a web browser and call the function, I only get the JSON response. Through the connection in iOS it seems to tack on the xml soap envelope to the response...
This is how I am calling the request in iOS:
Open in new window
Any clues why the data returned is the JSON and then the Soap XML?
Thanks,
Cory