-2
這是我的SOAP webservice.i有donn。 Bt它得到了錯誤。這是我的code.Can任何人都可以幫助我在android中解析字符串。 INT 串 INT INT 串 串 在此先感謝。如何解析<strxml>字符串</strxml>使用肥皂?
public boolean callwebservice() {
boolean result = false;
int patid = 1;
String xml = "";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("PatientId", patid);
request.addProperty("AppointMentDate", appdate);
request.addProperty("TimeFrom", apptimeto);
request.addProperty("TimeTo", appfrom);
request.addProperty("ReasonForAppointMent", appreason);
request.addProperty("strxml", xml);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(URL);
httpTransport.debug = true;
try {
httpTransport.call(SOAP_ACTION, envelope);
httpTransport
.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
// SoapObject response = (SoapObject) envelope.bodyIn;
SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
System.out.println("myApp" + response.toString());
System.out.println("response" + response);
if (response.toString().equalsIgnoreCase("false")) {
result = true;
}
} catch (SocketException ex) {
System.out.println("Error : " + "Error on soapPrimitiveData() "
+ ex.getMessage());
ex.printStackTrace();
} catch (Exception e) {
System.out.println("Error : " + "Error on soapPrimitiveData() "
+ e.getMessage());
e.printStackTrace();
}
return result;
我已經做使用soap.bt即開始時登錄後重定向到任命我得到error.my闕是如何得到的XML響應。 – 2013-05-13 11:25:32