使用WCF服务时出现问题 [英] Problem in consuming WCF Service

查看:135
本文介绍了使用WCF服务时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经开发了一个新的Web服务,当我从Visual Studio中运行它时,它会运行"wcf测试客户端"

如果我从"wcf测试客户端"测试所有功能,或者如果我们在本地将引用添加到网站,则效果很好.

但是,如果我在其他地方创建网站并通过添加Web服务"添加Web服务,则输入url("https://192.168.1.16/mywebservice.svc").那就不行,抛出错误:


您不能在空值表达式上调用方法.在C:\ shutdown.ps1:17 char:37+ $ result = $ vmshut.InitiateShutdown<<<< ("$ true",无评论")+ CategoryInfo:InvalidOperation:(InitiateShutdown:String)[],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull无法关闭wintest

Hi,

i have developed a new web service, when i run it from visual studio it runs "wcf test client"

it works fine if i test all function from "wcf test client" or if we add reference in to web site locally.

but if i create website some where else and add web service via "add web service" put url("https://192.168.1.16/mywebservice.svc"). then it will not work,throw error:


You cannot call a method on a null-valued expression.At C:\shutdown.ps1:17 char:37+ $result = $vmshut.InitiateShutdown <<<< ("$true","no comment") + CategoryInfo : InvalidOperation: (InitiateShutdown:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull unable to shutdown wintest

推荐答案

结果=


vmshut.InitiateShutdown<<<< ("
vmshut.InitiateShutdown <<<< ("


true",无评论")+ CategoryInfo:InvalidOperation:(InitiateShutdown:String)[],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull无法关闭wintest
true","no comment") + CategoryInfo : InvalidOperation: (InitiateShutdown:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull unable to shutdown wintest


这篇关于使用WCF服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆