我可以使用哪些程序来测试需要一些 SOAP HEADER 的 ASP.NET Web 服务?
我被要求对这个遗留应用程序进行一些错误测试。 Joy :( 这是一个用 C# 编写的简单 Web 服务 -> api.asmx。
现在,测试它的技巧是它需要一些 SOAP HEADER 进行身份验证。我知道我可以转到 asmx 页面,它给了我单击这些方法可以看到所有 GET/POST/SOAP 内容,如果我编辑 web.config,我就可以激活 Kewl 了。当然,我无法添加 SOAP HEADER,所以它失败了。
这是 SOAP xml 定义的内容:-
POST /services/api.asmx HTTP/1.1
Host: www.<snip>.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webservice.<snip>.com/GetStuff"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ApiAuthentication xmlns="http://webservice.<snip>.com/">
<DeveloperKey>string</DeveloperKey>
</ApiAuthentication>
</soap:Header>
<soap:Body>
<GetStuff xmlns="http://webservice.<snip>.com/">
<StuffId>int</StuffId>
</GetStuff >
</soap:Body>
</soap:Envelope>
那么,我可以下载什么程序来测试这些内容?我尝试了 FIDDLER,但没有成功:(除非我这样做。干杯
!
编辑 1 和 2(添加删除线):
A 上一个SO问题建议SoapUI,但那是java,我拒绝在我的电脑上安装java盒子....我不想拿出VirtualPC并将其扔在那里...好吗?
解决方案:
SoapUI(免费应用程序)通过 安装在虚拟 PC 上新手须遵循的说明 :)
I've been given this legacy app to do some bugtesting. Joy :( It's a simple webservice written in C# -> api.asmx.
Now, the trick for testing it, is that it requires some SOAP HEADER for authentication. I know I can just go to the asmx page, and it gives me all the api methods that are exposed. Clicking on those methods gives me a page where i can see all the GET/POST/SOAP stuff. If i edit my web.config, I can active the POST testing. Kewl. All that works. Of course, there's no way I can add in the SOAP HEADER, so it fails.
Here's the SOAP xml definition stuff :-
POST /services/api.asmx HTTP/1.1
Host: www.<snip>.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webservice.<snip>.com/GetStuff"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ApiAuthentication xmlns="http://webservice.<snip>.com/">
<DeveloperKey>string</DeveloperKey>
</ApiAuthentication>
</soap:Header>
<soap:Body>
<GetStuff xmlns="http://webservice.<snip>.com/">
<StuffId>int</StuffId>
</GetStuff >
</soap:Body>
</soap:Envelope>
So, what program can I download to test this stuff out? I tried FIDDLER but with no luck :( Unless I've used it wrong.
Cheers!
Edit 1 & 2 (added strikethrough):
A previous SO question suggested SoapUI, but that's java and i refuse to install java on my box .... and i would prefer not to have to pull out a VirtualPC and throw that, on there... please?
Solution:
SoapUI (free app) installed on a Virtual PC with newbie instructions to follow :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尽管这可能是显而易见的,但您需要提供 DeveloperKey 值,以便应用程序级安全机制授权您的请求。
这里有几点需要记住:
一旦您开始使用soapUI,您很快就会意识到它是一个非常强大的工具,并且它是用Java 实现的这一事实将变得无关紧要。
干杯!
尚齐
拉 JRE是Java运行时环境,运行Java应用程序需要它。 它类似于运行 .NET 应用程序所需的 .NET Framework 可再发行组件包。
Even though it may be obvious, what you need is to supply the DeveloperKey value in order to have your request authorized by application-level security mechanism.
Here's a couple of things to have in mind:
Once you start using soapUI you'll soon realize that it's a really powerful tool and the fact it's been implemented in Java will become irrelevant.
Cheers!
Shonzilla
p.s. JRE is Java Run-time Environment and it's needed to run Java applications. It's similar to .NET Framework redistributable package which is needed to run .NET applications.
如果您确实无法使用 SoapUI,有一个名为 SOAP Sonar 的“企业”工具。 我不知道它是什么样的,但它可能可以完成工作。
If you really can't use SoapUI, There is a "enterprise" tool called SOAP Sonar. I've no idea what it's like but it might do the job.