【问题标题】:How to test a WCF endpoint using WCF Test Client如何使用 WCF 测试客户端测试 WCF 端点
【发布时间】:2010-08-04 10:11:43
【问题描述】:

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

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

这看起来不错,但我如何使用 WCF 测试客户端构造这些请求对象之一(或实际上是数组)以发送到服务端点并不明显。双击clientRequest(超级请求,包含子请求)的Requests 参数的值,可以输入文本。我会冒险猜测条目的格式可能类似于 JSON,但我不知道。

有没有人可以在这里分享相关经验?

【问题讨论】:

标签: wcf wcftestclient


【解决方案1】:

我总是通过将 URL 作为参数传递给我的服务来启动 WcfTestClient,然后在一切初始化后,选择操作,填写任何参数并单击“调用”。参数的格式由它的函数签名决定。因此,如果您期望一个 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

希望对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-10
    • 2013-12-07
    • 1970-01-01
    • 2015-12-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多