首页 新闻 会员 周边 捐助

android 调用wcf出错

0
悬赏园豆:20 [已关闭问题] 关闭于 2014-03-11 17:22

我用网上的例子调用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;

错误如下:

cenlo的主页 cenlo | 小虾三级 | 园豆:583
提问于:2014-02-22 17:54
< >
分享
所有回答(1)
0

木有人遇到这种问题么

cenlo | 园豆:583 (小虾三级) | 2014-02-27 09:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册