시도를 웹 서비스 호출이 클래스를 사용하기 :
public class WSRequest {
public HttpTransportSE androidHttpTransport;
public SoapSerializationEnvelope envelope;
public String methodName;
public SoapObject request;
public WSRequest(String methodName)
{
this.methodName = methodName;
this.request = new SoapObject(SRWebServer.NAMESPACE, methodName);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.implicitTypes = true;
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(SRWebServer.URL);
}
public void RegisterMarshal()
{
MarshalBase64 marshal = new MarshalBase64();
marshal.register(envelope);
}
public SoapObject Send() throws IOException, XmlPullParserException
{
System.setProperty("http.keepAlive", "false");
new MarshalDate().register(envelope);
this.androidHttpTransport.call(SRWebServer.NAMESPACE + this.methodName, envelope);
return (SoapObject) this.envelope.getResponse();
}
public void AddProperties(String name, Object value)
{
this.request.addProperty(name, value);
}
//
}
을이 방법으로 사용
WSRequest request = new WSRequest("method name here");
request.addProperties("property1Name",property1);
request.Send();
requestSend()
을 웹 서비스에서받은 객체를 포함하는 SoapObject를 반환합니다.
첫 번째 시도는 코드를 디버깅하는 체크는 오류 을 읽은 후이 응용 프로그램을 실행하면 도착 후 –
내가이 코드를 시도 로그 캣 – edwin