Guest User

Untitled

a guest
Jul 9th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. package com.erplogic.Webservice;
  2.  
  3. import android.util.Base64;
  4. import android.util.Log;
  5.  
  6. import org.ksoap2.SoapEnvelope;
  7. import org.ksoap2.serialization.PropertyInfo;
  8. import org.ksoap2.serialization.SoapObject;
  9. import org.ksoap2.serialization.SoapSerializationEnvelope;
  10. import org.ksoap2.transport.HttpTransportSE;
  11. import org.xmlpull.v1.XmlPullParserException;
  12. import java.io.IOException;
  13.  
  14. public class CreateCustomer {
  15. String WSDL_URL = "http://infinitycosmic.com/ram/customer.wsdl";
  16. String SOAP_ACTION = "http://sap.com/xi/A1S/Global/ManageCustomerIn/MaintainBundle_V1Request";
  17. String NAME_SPACE = "http://sap.com/xi/A1S/Global";
  18. String METHOD_NAME = "maintainBundleV1";
  19.  
  20. public void createCustomerAccount(){
  21.  
  22. SoapObject soapObject = new SoapObject(NAME_SPACE,METHOD_NAME);
  23. soapObject.addProperty("InternalID","98765");
  24. soapObject.addProperty("CategoryCode","1");
  25. soapObject.addProperty("CustomerIndicator","true");
  26. soapObject.addProperty("LifeCycleStatusCode","2");
  27.  
  28. PropertyInfo username = new PropertyInfo();
  29. username.setName("username");
  30. username.setValue("_ANDROIDPOC");
  31. soapObject.addProperty(username);
  32.  
  33. PropertyInfo password = new PropertyInfo();
  34. password.setName("password ");
  35. password.setValue("Welcome1" );
  36. soapObject.addProperty(password );
  37. SoapSerializationEnvelope soapSerializationEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  38. soapSerializationEnvelope.setOutputSoapObject(soapObject);
  39.  
  40. HttpTransportSE httpTransportSE = new HttpTransportSE(WSDL_URL,100*10000);
  41. try {
  42. httpTransportSE.call(SOAP_ACTION,soapSerializationEnvelope);
  43.  
  44. SoapObject response = (SoapObject) soapSerializationEnvelope.bodyIn;
  45. String responses = response.getProperty(0).toString();
  46.  
  47. Log.i("Response","************************ "+responses);
  48. } catch (IOException e) {
  49. e.printStackTrace();
  50. } catch (XmlPullParserException e) {
  51. e.printStackTrace();
  52. }
  53.  
  54. }
  55. }
Add Comment
Please, Sign In to add comment