如何获取 XML 形式的 SOAP 标头?
如何获取 xml 形式的 Web 服务函数的 SOAP 标头?
我需要工作 SOAP 标头的 XML 版本,以作为 SOAP 标头损坏的用户的示例。他使用的是不同的编程语言,但由于标头以 XML 形式发送,我们希望能够轻松地比较它们。我使用的是 C#,ToString() 只是提供对象的名称。谷歌搜索后,我尝试了 Fiddler,但没有发现任何东西,而且 SOAP 扩展对于看似非常简单的任务来说看起来太复杂了。
How can I get the SOAP header of my web service function as xml?
I need an XML version of my working SOAP header to use as an example for someone with broken SOAP headers. He's using a different programming language, but since the headers are sent in XML, we're hoping we can compare those easily. I'm using C# and ToString() just gives me the name of the object. After googling, I tried Fiddler, but that didn't catch anything, and SOAP Extensions look way too complicated for what seems like a really simple task.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 ASMX Web 服务没有简单的方法可以做到这一点。如果您使用 WCF,打开消息日志记录将是一件小事。
Fiddler 应该能捕获所有内容,并且非常值得学习如何使用。请务必查看在线文档以了解如何捕获从本地主机到本地主机的流量。
There is no easy way to do this with ASMX web services. If you were using WCF, it would be a trivial matter of turning on message logging.
Fiddler should catch everything, and it's well worth learning how to use. Be sure to look in the online documentation to learn how to capture traffic from localhost to localhost.
此问题的可接受答案提到您可以使用soapUI 捕获Web 服务的流量。您可以使用它作为代理或 HTTP 隧道来捕获发送到您的 Web 服务的消息。我认为在 HTTP 隧道模式下使用它是有意义的,因为这样您就不必对客户端执行任何操作,只需将 URL 指向soapUI 而不是您的实际服务。
soapUI 网站讨论了 SOAP Monitor 功能,不认为它为设置 HTTP 隧道提供了很好的解释。
以下是所涉及的步骤(基于soapUI 3.0.1):
2.1 给你的项目起一个名字
2.2 输入服务 WSDL 的路径 (http://localhost/.../YourService.asmx ?WSDL)
The accepted answer to this question mentions that you can capture traffic to a web service using soapUI. You can use it to act as a proxy or HTTP tunnel in order to capture messages sent to your web service. I think using it in HTTP Tunnel mode makes sense, because then you won't have to do anything with your client other than to point the URL to soapUI instead of your actual service.
The soapUI website talks about the SOAP Monitor feature, though I don't think it offers a good explanation for setting up the HTTP tunnel.
Here are the steps involved (based on soapUI 3.0.1):
2.1 Give your project a name
2.2 Enter the path to your service's WSDL (http://localhost/.../YourService.asmx?WSDL)