Это мой веб-сервис SOAP:
POST /thehlb/mobile/mobileservice.asmx HTTP/1.1
Host: projects.spinxweb.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CheckLogin"
<?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>
<CheckLogin xmlns="http://tempuri.org/">
<UserName>string</UserName>
<Password>string</Password>
<PhoneType>string</PhoneType>
<MoblieUniqueNo>string</MoblieUniqueNo>
</CheckLogin>
</soap:Body>
</soap:Envelope>
И это мой код ..
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//CALL the web service method with the two parameters vname and nname
SoapObject request = new SoapObject(NAMESPACE, METHOS_NAME);
request.addProperty( "UserName","test@yahoo.com");
request.addProperty("Password", "123");
request.addProperty("PhoneType", "Android");
request.addProperty("MoblieUniqueNo", "123456");
SoapSerializationEnvelope envelop = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelop.setOutputSoapObject(request);
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
androidHttpTransport.debug = true;
try
{
androidHttpTransport.call(SOAP_ACTION, envelop);
// Get the SAOP Envelope back and the extract the body
SoapObject resultsRequestSOAP = (SoapObject) envelop.getResponse();
System.out.println("Responce :"+resultsRequestSOAP.toString());
Vector vector = (Vector) resultsRequestSOAP.getProperty("CheckLogin");
//Count of the arrays beneath starting from 0
SoapObject test = (SoapObject) vector.get(0);
//Get the attributes in the array
String uName = (String) test.getProperty("UserName");
uName = uName + " " + (String)test.getProperty("Password");
System.out.println("uname "+uName);
//Just show it in a text area field called lblStatus
TextView tv = (TextView) findViewById(R.id.textview);
tv.setText(uName.toString());
System.out.println("user name :"+tv);
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Error :"+e);
}
} //end onCreate method
Я получил ошибку, чтобы проанализировать его.у кого-нибудь есть решение?Пожалуйста, помогите мне.