Wsdl,测试 Web 服务,新手

发布于 2024-12-16 12:10:34 字数 195 浏览 1 评论 0原文

我有一些 wsdl URL(例如 https://location?wsdl)。我需要使用 ASP.NET 自动测试这些 Web 服务。我怎样才能做到这一点?有人告诉我 http 网站请求可以做到这一点(HttpRequest 类)。除了基础知识之外,我对网络服务了解不多。

I have a few wsdl URLs (e.g. https://location?wsdl). And I need to automate the testing of these web services with asp.net. How can I do that ? I was told that http website request could do this (HttpRequest Class). I don't know much about web services except the basics.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

战皆罪 2024-12-23 12:10:34

创建一个单元测试项目。使用“添加服务引用”来引用该项目中的 WSDL。然后,只需创建单元测试来调用服务并确认结果符合预期。

请注意,纯粹主义者会说这些是集成测试,而不是单元测试,但这没关系。它们将是自动化的,这正是您所寻找的。

Create a unit test project. Use "Add Service Reference" to reference the WSDLs within this project. Then, just create unit tests to call the service and confirm that the results are as expected.

Note that purists will say these are integration tests, not unit tests, but that's ok. They'll be automated, which is what you were looking for.

梦断已成空 2024-12-23 12:10:34

如果您可以解决必须使用 ASP.NET 的要求,那么 Soap UI 会非常有用。

请参阅此处的教程...

http://www.soapui。 org/Getting-Started/your-first-soapui-project.html

如果您必须使用.NET,为什么不能使用 wsdl.exe 创建一个 Web 服务的代理类,然后使用 Web 进行测试生成的服务客户端从那个?

Soap UI works great if you can get around the requirement of having to using ASP.NET.

See the tutorial here...

http://www.soapui.org/Getting-Started/your-first-soapui-project.html

If you have to use .NET why can't you just make a proxy class of the webservice using wsdl.exe and then test it with the web service client that's generated from that?

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