Package XXX;
Import Org.ksoap2.SoapEnvelope;
Import Org.ksoap2.serialization.SoapObject;
Import Org.ksoap2.serialization.SoapSerializationEnvelope;
Import Org.ksoap2.transport.HttpTransportSE;
Import org.xmlpull.v1.XmlPullParserException;
Import java.io.IOException;
Import java.net.InetSocketAddress;
/** * Get application XX relation class. */public class Orderrelation {/** namespace. * * Private final static String Name_space = "Urn:appbackgroundspengine"
; /** method.
* Private final static String method_name = "Appsignright"; The URL of the/** WSDL file.
* Private final static String Wsdl_url = "http://xxx/services/AppBackgroundSpEngine?wsdl";
/** * <p> * Get the application of XX relationship interface * </p> * @param in XX the relationship between the input parameters * @return XX Relationship Results * * public static Orderrelationresult Fetch (Orderralationinput in) {if (in = = null) {throw new Illeg
Alargumentexception ("Input parameter is null"); Final Orderrelationresult Result = new Orderrelationresult ();
Final Soapobject so = new Soapobject (Name_space, method_name);
So.addproperty ("Transid", In.gettransid ());
So.addproperty ("mobile", In.getuserid ());
So.addproperty ("Imsi", In.getimsi ());
So.addproperty ("AppId", In.getappid ());
So.addproperty ("TimeStamp", In.gettimestamp ());
So.addproperty ("ClientType", In.getclienttype ());
So.addproperty ("Sig", In.getsig ());
Final Soapserializationenvelope se = new Soapserializationenvelope (SOAPENVELOPE.VER11);
Se.bodyout = so;
Final Httptransportse ht = new Httptransportse (Wsdl_url);
try {ht.call (name_space, SE);
Final Soapobject response = (soapobject) Se.bodyin;
if (response!= null) {SYSTEM.OUT.PRINTLN ("Response:" + response);
Result.setresultcode (Integer.parseint) (Response.getpropertyasstring ("ResultCode")); Result.settransid (RESPONSE.GETPRopertyasstring ("Transid"));
Result.settype (Integer.parseint (response.getpropertyasstring ("type")));
} catch (IOException e) {e.printstacktrace ();
return null;
catch (Xmlpullparserexception e) {e.printstacktrace ();
return null;
catch (NullPointerException e) {e.printstacktrace ();
return null;
return result;
}
}
Description: The above name Space,method name can be viewed through the SOAP UI tool