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 the application XX link class. */public class OrderRelation {/** namespace. */private final static String NAME_SPACE = "urn: AppBackgroundSpEngine ";/** method. */private final static String METHOD_NAME = "appSignRight";/** URL of the WSDL file. */private final static String WSDL_URL = "http: // xxx/services/AppBackgroundSpEngine? Wsdl "; /*** <p> * obtain the XX Link Interface of the application * </p> ** @ param in XX link input parameter * @ return XX link result */public static OrderRelationResult fetch (OrderRalationInput in) {if (in = null) {throw new IllegalArgumentException ("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 HttpTransport SE (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 ;}}
Note: The above name space and method name can be viewed using the soap UI tool.