2
private static final String SOAP_ACTION = "http://tempuri.org/IService1/HelloTest";
private static final String METHOD_NAME = "HelloTest";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = ""; //blank for privacy
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//request.addProperty("Celsius", "32");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL);
try {
ht.call(SOAP_ACTION, envelope);
final SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
final String str = response.toString();
Toast.makeText(MainActivity.this, str, 5000).show();
fetch_service.setText(str);
}
catch (Exception e) {
e.printStackTrace();
}
我想調用我的方法(Hello Test)。結果將是你好測試返回。但是這個示例正在爲基本http綁定工作,但不適用於wshttpbinding。是否有可能從android調用WSHTTPBINDING?
讓我試試man.thanks很多人。 – Nirmal
終於,我從@Tarsem找到了寶貴的答案 – Nirmal