1
我有一個簡單的Web服務操作,像這樣:調用SOAP操作不帶參數
@WebService(endpointInterface = "soap.service.sei.HelloWorldSei")
public class Sib {
public String sayHello() {
return "Hello World!";
}
}
我使用ksoap2庫機器人。 在我的Android活動中,我有:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse();
lblResult.setText(resultsRequestSOAP.toString());
} catch (Exception e) {
System.out.println("******* THERE WAS AN ERROR ACCESSING THE WEB SERVICE");
e.printStackTrace();
}
}
我的問題是 - 因爲「的sayHello」操作沒有參數,我需要包括任何「的PropertyInfo」實例?