Generate client stub for a web service
Please Login to Remove!
I have created a web service and is running in tomcat. I used ksoap2 to call the web service. Here s my code
HttpTransport ht = null;
SoapSerializationEnvelope envelope = null;
String serviceNamespace = "h t t p://temperature.com";
String soapMethod = "fahrenToCel";
String serviceUrl = "h t t p : //172.24.20.50:5050/ZSampleWebService/services/TempConverter";
String soapAction = "urn:CelTofahren";
try {
SoapObject ro = new SoapObject(serviceNamespace, soapMethod);
ro.addProperty("fah", "30");
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = ro;
ht = new HttpTransport(serviceUrl);
ht.debug = true;
ht.call(null, envelope);
System.err.println("sucess resP:::" + ht.responseDump);
SoapObject result = (SoapObject) envelope.getResult();
} catch (SoapFault f) {
System.err.println(ht.requestDump);
System.err.println(ht.responseDump);
System.err.println(f.faultstring);
} catch (Exception e) {
System.err.println(" excep::req::" + ht.requestDump);
System.err.println(" excep:resp:" + ht.responseDump);
// System.err.println( e.faultstring );
}
I can get the response in xml format.
NOW HERES MY TASK.
I need to create a client stub that ll process the soap response and give me the required result alone. How i could do this. Any one help !!!
|