如何使用 WCF 测试客户端测试 WCF 端点

发布于 2024-09-13 00:07:00 字数 403 浏览 6 评论 0原文

当我运行WCF 测试客户端时,我只在系统中看到两个“端点” - BasicHttpBinding_MyServiceWSHttpBinding_MyService

现在,系统接受多种不同类型的请求,并且这些请求以请求数组 (Request[]) 的形式传递到端点(据我所知)。

这看起来不错,但我如何使用 WCF 测试客户端构造这些 Request 对象之一(或者实际上是数组)以发送到服务端点并不明显。双击clientRequest(超级请求,包含子请求)的Requests参数的值,可以输入文本。我大胆猜测条目的格式可能类似于 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 Requests 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生来就爱笑 2024-09-20 00:07:00

我总是通过将 URL 作为参数传递给我的服务来启动 WcfTestClient,然后一旦一切都初始化,选择操作,填写任何参数并单击“Invoke”。参数的格式由其函数签名决定。因此,如果您需要一个 int,请输入一个有效的 int。这里不需要 JSON。

当我测试 /debuggin WCF 服务时,我发现这个小宝石非常方便。

来自 WcfTestService 启动面板:

To add a service:
. Select “Add Service” from the File menu or the context menu of the "My Service Projects"
. Enter the service metadata address in the input area, and click "OK"

To test a service operation:
. Double click the operation you want to test from the tree on the left pane
. A new tab page will appear on the right pane
. Enter the value of parameters in the Request Area of the right pane
. Click "Invoke" button

我希望这对您有所帮助。

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:

To add a service:
. Select “Add Service” from the File menu or the context menu of the "My Service Projects"
. Enter the service metadata address in the input area, and click "OK"

To test a service operation:
. Double click the operation you want to test from the tree on the left pane
. A new tab page will appear on the right pane
. Enter the value of parameters in the Request Area of the right pane
. Click "Invoke" button

I hope this is of some help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文