我用网上的例子调用WCF的时候。老是抛错。代码出下
private static final String NameSpace = "http://tempuri.org/";
private static final String URL = "http://localhost:8953/ServicSections.svc";
private static final String SOAP_ACTION = "http://tempuri.org/IServiceSections/GetBookCount";
private static final String MethodName = "GetBookCount";
public WcfLoad(String words) {
}
public SoapObject LoadResult() {
SoapObject soapObject = new SoapObject(NameSpace, MethodName);
// soapObject.addProperty("words", words);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11); // 版本
envelope.bodyOut = soapObject;
envelope.dotNet = true;
envelope.setOutputSoapObject(soapObject);
HttpTransportSE trans = new HttpTransportSE(URL);
//AndroidHttpTransport androidHT = new AndroidHttpTransport(URL);
trans.debug = true; // 使用调试功能
try {
trans.call(SOAP_ACTION, envelope);
System.out.println("Call Successful!");
} catch (IOException e) {
System.out.println("IOException");
e.printStackTrace();
} catch (XmlPullParserException e) {
System.out.println("XmlPullParserException");
e.printStackTrace();
}
SoapObject result = (SoapObject) envelope.bodyIn;
错误如下:
木有人遇到这种问题么