如何使用 WCF 测试客户端测试 WCF 端点
当我运行WCF 测试客户端时,我只在系统中看到两个“端点” - BasicHttpBinding_MyService
和 WSHttpBinding_MyService
。
现在,系统接受多种不同类型的请求,并且这些请求以请求数组 (Request[]
) 的形式传递到端点(据我所知)。
这看起来不错,但我如何使用 WCF 测试客户端构造这些 Request 对象之一(或者实际上是数组)以发送到服务端点并不明显。双击clientRequest
(超级请求,包含子请求)的Request
s参数的值,可以输入文本。我大胆猜测条目的格式可能类似于 JSON,但我不知道。
有谁有相关经验可以在这里分享吗?
When I run up WCF Test Client, I only see two "endpoints" in a system - BasicHttpBinding_MyService
and WSHttpBinding_MyService
.
Now the system accepts a multitude of different types of request, and these are passed into the endpoints in an array of Requests (Request[]
) (as far as I can tell).
This seems fine, but it is non-obvious how I use the WCF Test Client to construct one of these Request objects (or indeed the array) for sending to the service endpoint. Double clicking on the value of the Request
s parameter of the clientRequest
(the super request, containing the subrequests), enables input of text. I would hazard a guess the format of entry might be like JSON, but I have no idea.
Does anyone have any relevant experience they can share here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我总是通过将 URL 作为参数传递给我的服务来启动 WcfTestClient,然后一旦一切都初始化,选择操作,填写任何参数并单击“Invoke”。参数的格式由其函数签名决定。因此,如果您需要一个 int,请输入一个有效的 int。这里不需要 JSON。
当我测试 /debuggin WCF 服务时,我发现这个小宝石非常方便。
来自 WcfTestService 启动面板:
我希望这对您有所帮助。
I have always started the WcfTestClient by passing the URL to my service as a parameter then once everything has initialized, selecting the operation, filling in any parameters and clicking "Invoke". The format of the parameter is determined by it's function signature. So, if you are expect an int, enter a valid int. No JSON needed here.
I have found this little gem to be quite handy when I was testing /debuggin WCF services.
From the WcfTestService startup panel:
I hope this is of some help.