Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. -------------Request--------------
  2.  
  3. POST /ORoomJsonService.asmx HTTP/1.1
  4. Host: oliveroomservice.azurewebsites.net
  5. Content-Type: text/xml; charset=utf-8
  6. Content-Length: length
  7. SOAPAction: "http://tempuri.org/DiscoverService"
  8.  
  9. <?xml version="1.0" encoding="utf-8"?>
  10. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  11. <soap:Body>
  12. <DiscoverService xmlns="http://tempuri.org/">
  13. <user>
  14. <Name>string</Name>
  15. <UserId>string</UserId>
  16. <Password>string</Password>
  17. <Email>string</Email>
  18. <Role>string</Role>
  19. </user>
  20. </DiscoverService>
  21. </soap:Body>
  22. </soap:Envelope>
  23.  
  24. ------------Response--------------
  25.  
  26. HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8
  27. Content-Length: length
  28. <?xml version="1.0" encoding="utf-8"?>
  29. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  30. <soap:Body>
  31. <DiscoverServiceResponse xmlns="http://tempuri.org/">
  32. <DiscoverServiceResult>boolean</DiscoverServiceResult>
  33. </DiscoverServiceResponse>
  34. </soap:Body>
  35. </soap:Envelope>
  36.  
  37. ORoomJsonService service = new org.tempuri.ORoomJsonService();
  38. org.tempuri.ORoomJsonServiceSoap roomclient = service.getORoomJsonServiceSoap();
  39.  
  40. org.tempuri.UserEntity user = new org.tempuri.UserEntity();
  41. user.setName("XXXXX");
  42. user.setUserId("XXXX@XXX.com");
  43. user.setPassword("XXXX");
  44. user.setEmail("XXXXX@XXXX.com");
  45. user.setRole("admin");
  46.  
  47. boolean result = roomclient.discoverService(user);
  48. System.out.println("Result = "+result);
  49.  
  50. SoapObject request = new SoapObject(Splash.NAMESPACE,
  51. METHOD_NAME_DISCOVER_SERVICES);
  52.  
  53. PropertyInfo pi = new PropertyInfo();
  54. pi.setName("user");
  55. User user = new User();
  56. user.setName("XXXX");
  57. user.setUserId("XXXX");
  58. user.setPassword("XXXX");
  59. user.setEmail("XXXX@xXX.com");
  60. user.setRole("admin");
  61.  
  62. pi.setValue(user);
  63. pi.setType(User.USER_CLASS);
  64. request.addProperty(pi);
  65. SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
  66. SoapEnvelope.VER11);
  67. envelope.dotNet = true;
  68. System.setProperty("http.keepAlive", "true");
  69. envelope.setOutputSoapObject(request);
  70. HttpTransportSE androidHttpTransport = new HttpTransportSE(
  71. Splash.SERVICE_URL, 10000);
  72. androidHttpTransport.call(SOAP_ACTION_DISCOVER_SERVICES, envelope);
  73. SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
  74.  
  75. resultData = result.toString();
  76. Log.e("DiscoverServices", "ResultData: " + resultData);
  77.  
  78. class User implements KvmSerializable {
  79. public static Class USER_CLASS = new User().getClass();
  80. public String Name, UserId, Password, Email, Role;
  81.  
  82. public String getName() {
  83. return Name;
  84. }
  85.  
  86. public void setName(String name) {
  87. Name = name;
  88. }
  89.  
  90. public String getUserId() {
  91. return UserId;
  92. }
  93.  
  94. public void setUserId(String userId) {
  95. UserId = userId;
  96. }
  97.  
  98. public String getPassword() {
  99. return Password;
  100. }
  101.  
  102. public void setPassword(String password) {
  103. Password = password;
  104. }
  105.  
  106. public String getEmail() {
  107. return Email;
  108. }
  109.  
  110. public void setEmail(String email) {
  111. Email = email;
  112. }
  113.  
  114. public String getRole() {
  115. return Role;
  116. }
  117.  
  118. public void setRole(String role) {
  119. Role = role;
  120. }
  121.  
  122. @Override
  123. public Object getProperty(int i) {
  124.  
  125. switch (i) {
  126. case 0:
  127. return Name;
  128. case 1:
  129. return UserId;
  130. case 2:
  131. return Password;
  132. case 3:
  133. return Email;
  134. case 4:
  135. return Role;
  136. default:
  137. return null;
  138. }
  139. }
  140.  
  141. @Override
  142. public int getPropertyCount() {
  143. return 5;
  144. }
  145.  
  146. @Override
  147. public void setProperty(int i, Object value) {
  148. switch (i) {
  149. case 0:
  150. Name = value.toString();
  151. break;
  152. case 1:
  153. UserId = value.toString();
  154. break;
  155. case 2:
  156. Password = value.toString();
  157. break;
  158. case 3:
  159. Email = value.toString();
  160. break;
  161. case 4:
  162. Role = value.toString();
  163. break;
  164. default:
  165. break;
  166. }
  167.  
  168. }
  169.  
  170. @Override
  171. public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo info) {
  172. switch (i)
  173. {
  174. case 0:
  175. info.type = PropertyInfo.STRING_CLASS;
  176. info.name = "Name";
  177. break;
  178. case 1:
  179. info.type = PropertyInfo.STRING_CLASS;
  180. info.name = "UserId";
  181. break;
  182. case 2:
  183. info.type = PropertyInfo.STRING_CLASS;
  184. info.name = "Password";
  185. break;
  186. case 3:
  187. info.type = PropertyInfo.STRING_CLASS;
  188. info.name = "Email";
  189. break;
  190. case 4:
  191. info.type = PropertyInfo.STRING_CLASS;
  192. info.name = "Role";
  193. break;
  194. default:
  195. break;
  196. }
  197. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement