简体   繁体   English

WCF服务测试

[英]WCF Service Testing

How can I test a WCF Service? 如何测试WCF服务?

I tried soapUI, it works but I don't feel PRO when using third-party software when Visual Studio may have something to solve this problem. 我试过soapUI,它可以正常工作,但是当我使用第三方软件时,我觉得PRO不具备解决这个问题的能力。

I saw once, an web api stuff (don't really remember) that has a built-in client. 我曾经看过,有一个内置客户端的web api(不记得)。 And that was awesome! 这太棒了!

Is there a way to have such a client on a WCF Service (file.svc) or test by adding some query string to the URL? 有没有办法在WCF服务(file.svc)上安装这样的客户端或通过向URL添加一些查询字符串进行测试?

Something Like this: 像这样的东西:

http://localhost:56458374/Service.svc/Operation?value1=5&value2=6 HTTP://本地主机:56458374 / Service.svc /操作值1 = 5&VALUE2 = 6

You can always open up a project (unit test project) and add a reference to the WCF service - VS generates a fully functional client for you which you can then use for tests anyway you want. 您可以随时打开一个项目(单元测试项目)并添加对WCF服务的引用 - VS为您生成一个功能齐全的客户端,然后您可以根据需要使用它来进行测试。

Another option: Depending on the data types you use in the Service (not all are supported like Stream etc.) you can use the WCF Test Client . 另一种选择:根据您在服务中使用的数据类型(并非像Stream等一样支持所有数据类型),您可以使用WCF测试客户端

WCF Test Client should you let you do that. 你应该让WCF测试客户端这样做。 In fact if you create a new project based on the WCF template. 实际上,如果您基于WCF模板创建新项目。 Hitting F5 will automatically do it 点击F5会自动执行

:

我发现这个msdn视频,当我开始使用wcf时...还有一些情况下如何测试你的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM