Soap Implemantation (problems ) How to parse soap response

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Soap Implemantation (problems ) How to parse soap response

Postby desuvinodkumar » Sat Jul 11, 2009 11:56 am

HI

I want to Consume the SOAP Web Services in Android

i downloaded KSOAP2 Library

i have done some thing like this ......

private static final String SOAP_ACTION = "getRating";
private static final String METHOD_NAME = "getRating";
private static final String NAMESPACE = "http://www.w3.org/2001/12/soap-envelope";
private static final String URL = "http://www.galatta.com/iphone/isizzle/isizzle.php";
private ContextWrapper context;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.list);

//CALL the web service method
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.setOutputSoapObject(request);

AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);

try
{

androidHttpTransport.call(SOAP_ACTION, envelope);


// Get the SAOP Envelope back and the extract the body
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;

}

i am getting the response from the server like this ......not know what is this type...


getRatingResponse{return=ContestInfo{item=anyType{name=Ankitha; totalimages=2; rating=2.5; }; item=anyType{name=Anushka; totalimages=4; rating=9.5; }; item=anyType{name=Apsara; totalimages=1; rating=0; };

how can i parse this response.....


can any body help me regarding this .....

it urgent .......
Vinod...
User avatar
desuvinodkumar
Senior Developer
Senior Developer
 
Posts: 102
Joined: Mon Mar 23, 2009 6:51 am
Location: India

Top

Postby stifry » Mon Jul 13, 2009 6:44 am

Here's an example of doing it the brute force way and parsing the XML:

Parsing XML Tutorial
Visit Trackaroo.com!
Trackmaster - Motorsports Lap Timer
Dynomaster - Performance Dyno
Image Image
User avatar
stifry
Developer
Developer
 
Posts: 46
Joined: Tue Feb 17, 2009 7:50 pm

Postby desuvinodkumar » Mon Jul 13, 2009 6:51 am

HI stifry

Thanks for giving response....

i got the response in another format .....
if it is XML that is OK to parse .........


i mentioned my response in above message .....
is there any way to convert to XML or other way to parse that response.....
Vinod...
User avatar
desuvinodkumar
Senior Developer
Senior Developer
 
Posts: 102
Joined: Mon Mar 23, 2009 6:51 am
Location: India

Postby avigil » Sat Feb 13, 2010 4:33 pm

that response is json. You might be able to get the response in xml format from the webservice...
avigil
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Feb 13, 2010 4:26 pm
Location: Washington state

Postby desuvinodkumar » Sat Feb 13, 2010 6:18 pm

HI

That is not a JSON response, i compared with JSON response it is not in that format.

the above response is SoapObject Format .

TIA
Vinod...
User avatar
desuvinodkumar
Senior Developer
Senior Developer
 
Posts: 102
Joined: Mon Mar 23, 2009 6:51 am
Location: India

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 3 guests