[英]How do I get the SOAP headers as XML?
How can I get the SOAP header of my web service function as xml? 如何获得Web服务功能的SOAP标头为xml?
I need an XML version of my working SOAP header to use as an example for someone with broken SOAP headers. 我需要一个工作SOAP头的XML版本,以作为SOAP头损坏的人的示例。 He's using a different programming language, but since the headers are sent in XML, we're hoping we can compare those easily. 他使用的是另一种编程语言,但是由于标头是以XML发送的,因此我们希望可以轻松比较它们。 I'm using C# and ToString() just gives me the name of the object. 我正在使用C#和ToString()只是给我对象的名称。 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. 谷歌搜索之后,我尝试了Fiddler,但是没有找到任何东西,并且SOAP扩展对于看起来非常简单的任务而言似乎过于复杂。
There is no easy way to do this with ASMX web services. 对于ASMX Web服务,没有简单的方法可以做到这一点。 If you were using WCF, it would be a trivial matter of turning on message logging. 如果您使用的是WCF,则打开消息日志记录将变得很简单。
Fiddler should catch everything, and it's well worth learning how to use. Fiddler应该抓住一切,值得学习如何使用。 Be sure to look in the online documentation to learn how to capture traffic from localhost to localhost. 确保查看在线文档以了解如何捕获从本地主机到本地主机的流量。
The accepted answer to this question mentions that you can capture traffic to a web service using soapUI. 该问题的可接受答案提到您可以使用soapUI捕获到Web服务的流量。 You can use it to act as a proxy or HTTP tunnel in order to capture messages sent to your web service. 您可以使用它充当代理或HTTP隧道,以捕获发送到Web服务的消息。 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. 我认为在HTTP隧道模式下使用它是有道理的,因为这样,您无需对客户端进行任何操作,只需将URL指向soapUI而不是实际的服务即可。
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. soapUI网站讨论了SOAP Monitor功能,尽管我认为它不为设置HTTP隧道提供很好的解释。
Here are the steps involved (based on soapUI 3.0.1): 这是涉及的步骤(基于soapUI 3.0.1):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.