Need to introduce Ksoap2-android-assembly-2.5.2-jar-with-dependencies.jar
Copy Code code as follows:
The WebService namespace
Static final String namespace = "http://impl.service.suncreate.com";
URL for server Publishing
Static final String url = http://10.100.3.41/axis2/services/UploadService;
Final String methodname = "Upload"; The name of the function
final int sessionID = "111111"; SessionID
Creates a Httptransportse object that allows you to specify the URL of the webservice through the Httptransportse class's construction method
Httptransportse transport = new Httptransportse (URL);
Transport.debug = true;
Specifies the namespace and function name of the WebService
Soapobject soapobject = new Soapobject (namespace, methodname);
Set the value of the calling method parameter
Soapobject.addproperty ("SessionID", SessionID); SessionID
Soapobject.addproperty ("Data", CDs); CDs are objects that need to be passed
Soapserializationenvelope envelope = new Soapserializationenvelope (SOAPENVELOPE.VER10);
Envelope.bodyout = transport;
Envelope.setoutputsoapobject (Soapobject);
Calling the WebService method using the Call method
Transport.call (null, envelope);
Soapobject sb = (soapobject) Envelope.bodyin;
String xmlmessage = sb.tostring (); Gets the XML string returned from the server side