Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  2. xmlns:web="http://webservice.abc.com/">
  3. <soapenv:Header/>
  4. <soapenv:Body>
  5. <web:gwOperation>
  6. <Input>
  7. <username>?</username>
  8. <password>?</password>
  9. <wscode>?</wscode>
  10. <!--Zero or more repetitions:-->
  11. <param name="?" value="?"/>
  12. <!--Optional:-->
  13. <rawData>?</rawData>
  14. </Input>
  15. </web:gwOperation>
  16. </soapenv:Body>
  17. </soapenv:Envelope>
  18.  
  19. public class GatewayRequest implements KvmSerializable {
  20. String username;
  21. String password;
  22. String wscode;
  23. String rawData;
  24.  
  25. @Override
  26. public Object getProperty(int arg0) {
  27. switch (arg0) {
  28. case 0:
  29. return username;
  30. case 1:
  31. return password;
  32. case 2:
  33. return wscode;
  34. case 3:
  35. return rawData;
  36. default:
  37. return null;
  38. }
  39. }
  40.  
  41. @Override
  42. public int getPropertyCount() {
  43. return 4;
  44. }
  45.  
  46. @Override
  47. public void setProperty(int i, Object o) {
  48. switch (i) {
  49. case 0:
  50. username = (String) o;
  51. break;
  52. case 1:
  53. password = (String) o;
  54. break;
  55. case 2:
  56. wscode = (String) o;
  57. break;
  58. case 3:
  59. rawData = (String) o;
  60. break;
  61. default:
  62. break;
  63. }
  64. }
  65.  
  66. @Override
  67. public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo propertyInfo) {
  68. switch (i) {
  69. case 0:
  70. propertyInfo.type = PropertyInfo.STRING_CLASS;
  71. propertyInfo.name = "username";
  72. break;
  73. case 1:
  74. propertyInfo.type = PropertyInfo.STRING_CLASS;
  75. propertyInfo.name = "password";
  76. break;
  77. case 2:
  78. propertyInfo.type = PropertyInfo.STRING_CLASS;
  79. propertyInfo.name = "wscode";
  80. break;
  81. case 3:
  82. propertyInfo.type = PropertyInfo.STRING_CLASS;
  83. propertyInfo.name = "rawData";
  84. default:
  85. break;
  86. }
  87. }
  88.  
  89. KvmSerializable val = new GatewayRequest();
  90. val.setProperty(0, ServerPath.username);
  91. val.setProperty(1, ServerPath.password);
  92. val.setProperty(2, ServerPath.wscode);
  93. val.setProperty(3,signature);
  94. val.setProperty(4,isoRequest.getProcessCode());
  95. val.setProperty(5,data);
  96. val.setProperty(6,null);
  97.  
  98. pi = new PropertyInfo();
  99. pi.setName("Input");
  100. pi.setValue(val);
  101. pi.setType(GatewayRequest.class);
  102. request.addProperty(pi);
  103. SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  104. envelope.setOutputSoapObject(request);
  105. Marshal floatMarshal = new MarshalFloat();
  106. envelope.addMapping(ServerPath.GW_NAMESPACE, GatewayRequest.class.getSimpleName(), GatewayRequest.class);
  107. floatMarshal.register(envelope);
  108. HttpTransportSE androidHttpTransport = new HttpTransportSE(ServerPath.URL);
  109. androidHttpTransport.debug = true;
  110. SSLConnection.allowAllSSL();
  111.  
  112. androidHttpTransport.call(soapAction, envelope);
  113. Log.d(TAG, "aht requestDump is: " + androidHttpTransport.requestDump);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement