本人在一个简单调用webservice的c#窗体应用程序时 ,出现了![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/1496983899-1114688543.jpg)
![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/1797102363-2022764197.jpg)
所示的问题
下面是本人的App.config文件,本人觉得是这里的问题,但是本人不知道怎么改,请懂的人给点建议,感激不尽!
![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/-1440913119-1047255258.jpg)
![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/1496983899-1114688543.jpg)
![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/1797102363-2022764197.jpg)
所示的问题
下面是本人的App.config文件,本人觉得是这里的问题,但是本人不知道怎么改,请懂的人给点建议,感激不尽!
![“System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli “System.ServiceModel.FaultException”类型的未经处理的异常在 mscorli](https://www.codebye.com/wp-content/uploads/2016/07/-1440913119-1047255258.jpg)
解决方案
2
“未将对象引用设置到对象实例”, 应该是你的代码里使用空指针了。
你可以在本地服务器上进行调试,用Remote debugger.
或在你webservice的最外面加上try … catch。catch到异常,把详细信息(stack trace等)记录log。
你可以在本地服务器上进行调试,用Remote debugger.
或在你webservice的最外面加上try … catch。catch到异常,把详细信息(stack trace等)记录log。
28
本人试了确实不行,应该是服务本身的问题, 你可以改用httpwebrequest post
http://www.webxml.com.cn/webservices/weatherwebservice.asmx?op=getWeatherbyCityName
http://www.webxml.com.cn/webservices/weatherwebservice.asmx?op=getWeatherbyCityName