Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------Request--------------
- POST /ORoomJsonService.asmx HTTP/1.1
- Host: oliveroomservice.azurewebsites.net
- Content-Type: text/xml; charset=utf-8
- Content-Length: length
- SOAPAction: "http://tempuri.org/DiscoverService"
- <?xml version="1.0" encoding="utf-8"?>
- <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/">
- <soap:Body>
- <DiscoverService xmlns="http://tempuri.org/">
- <user>
- <Name>string</Name>
- <UserId>string</UserId>
- <Password>string</Password>
- <Email>string</Email>
- <Role>string</Role>
- </user>
- </DiscoverService>
- </soap:Body>
- </soap:Envelope>
- ------------Response--------------
- HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8
- Content-Length: length
- <?xml version="1.0" encoding="utf-8"?>
- <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/">
- <soap:Body>
- <DiscoverServiceResponse xmlns="http://tempuri.org/">
- <DiscoverServiceResult>boolean</DiscoverServiceResult>
- </DiscoverServiceResponse>
- </soap:Body>
- </soap:Envelope>
- ORoomJsonService service = new org.tempuri.ORoomJsonService();
- org.tempuri.ORoomJsonServiceSoap roomclient = service.getORoomJsonServiceSoap();
- org.tempuri.UserEntity user = new org.tempuri.UserEntity();
- user.setName("XXXXX");
- user.setUserId("XXXX@XXX.com");
- user.setPassword("XXXX");
- user.setEmail("XXXXX@XXXX.com");
- user.setRole("admin");
- boolean result = roomclient.discoverService(user);
- System.out.println("Result = "+result);
- SoapObject request = new SoapObject(Splash.NAMESPACE,
- METHOD_NAME_DISCOVER_SERVICES);
- PropertyInfo pi = new PropertyInfo();
- pi.setName("user");
- User user = new User();
- user.setName("XXXX");
- user.setUserId("XXXX");
- user.setPassword("XXXX");
- user.setEmail("XXXX@xXX.com");
- user.setRole("admin");
- pi.setValue(user);
- pi.setType(User.USER_CLASS);
- request.addProperty(pi);
- SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
- SoapEnvelope.VER11);
- envelope.dotNet = true;
- System.setProperty("http.keepAlive", "true");
- envelope.setOutputSoapObject(request);
- HttpTransportSE androidHttpTransport = new HttpTransportSE(
- Splash.SERVICE_URL, 10000);
- androidHttpTransport.call(SOAP_ACTION_DISCOVER_SERVICES, envelope);
- SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
- resultData = result.toString();
- Log.e("DiscoverServices", "ResultData: " + resultData);
- class User implements KvmSerializable {
- public static Class USER_CLASS = new User().getClass();
- public String Name, UserId, Password, Email, Role;
- public String getName() {
- return Name;
- }
- public void setName(String name) {
- Name = name;
- }
- public String getUserId() {
- return UserId;
- }
- public void setUserId(String userId) {
- UserId = userId;
- }
- public String getPassword() {
- return Password;
- }
- public void setPassword(String password) {
- Password = password;
- }
- public String getEmail() {
- return Email;
- }
- public void setEmail(String email) {
- Email = email;
- }
- public String getRole() {
- return Role;
- }
- public void setRole(String role) {
- Role = role;
- }
- @Override
- public Object getProperty(int i) {
- switch (i) {
- case 0:
- return Name;
- case 1:
- return UserId;
- case 2:
- return Password;
- case 3:
- return Email;
- case 4:
- return Role;
- default:
- return null;
- }
- }
- @Override
- public int getPropertyCount() {
- return 5;
- }
- @Override
- public void setProperty(int i, Object value) {
- switch (i) {
- case 0:
- Name = value.toString();
- break;
- case 1:
- UserId = value.toString();
- break;
- case 2:
- Password = value.toString();
- break;
- case 3:
- Email = value.toString();
- break;
- case 4:
- Role = value.toString();
- break;
- default:
- break;
- }
- }
- @Override
- public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo info) {
- switch (i)
- {
- case 0:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "Name";
- break;
- case 1:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "UserId";
- break;
- case 2:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "Password";
- break;
- case 3:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "Email";
- break;
- case 4:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "Role";
- break;
- default:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement