查看 Web 请求 XML
我遇到了一个奇怪的问题 - 我在这个论坛上看到了类似的帖子,但没有答案。
长话短说,我使用 C# 向 Web 服务发送 HttpWebRequest(存根是通过在 Visual Studio 2008、.NET 2.0 中添加 Web 引用创建的),该请求会中断并显示以下消息:“无法解析传入请求”。 这是一个运行在 weblogic 上的基于 java 的 webservice。
这是奇怪的部分,如果我运行提琴手来监视我的请求 - 它工作正常!!?
我的理论是,fiddler 正在以服务器喜欢的某种方式重新格式化请求?
有谁知道 .NET 可以对提琴手可以修复的请求做什么? 如果没有,有没有一种方法可以在不使用 fiddler 的情况下以编程方式查看 XML?
警告 - 我无权更改托管 Web 服务的服务器。
谢谢, Steve
更新 - 当我删除 fiddler 中的“解密 HTTPS 流量”选项时,它不再起作用。 因此,无论 fiddler 正在做什么来解密 HTTPS 流量,这就是它的工作原理......
I'm having a strange issue - I saw a similar post on this forum, but it didn't have an answer.
Long story short, I am sending an HttpWebRequest using C# to a web service (stubs were created by adding a web reference in Visual Studio 2008, .NET 2.0) which breaks with the following message: "Unable to parse the incoming request". This is a java based webservice running on weblogic.
Here is the strange part, if I have fiddler running to monitor my request - IT WORKS FINE!!??
My theory is that fiddler is reformatting the request in some manner which the server likes?
Does anyone know what .NET could be doing to the request which fiddler could be fixing?
If not, is there a way I can view my XML programmatically without using fiddler?
Caveat - I do not have access to make changes to the server hosting the web service.
Thanks,
Steve
UPDATE - When I remove the "Decrypt HTTPS traffic" option in fiddler it no longer works. So whatever fiddler is doing to decrypt the HTTPS traffic is what is making this work....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
史蒂夫,
当我调试我正在开发的网络代理时,我遇到了完全相同的症状。 事实证明,Fiddler 正在纠正最后一个标头的最后一个字节之后和请求正文的第一个字节之前的 CRLF (\r\n) 字符。 根据 HTTP 规范,应该正好有两个 CRLF,而我的代理在那里添加了其中三个(由于错误),并且 Fiddler 正在默默地纠正这一点。
不确定这是否与您的情况相同,因为您正在使用代理,但也许它会以某种方式帮助您。
Steve,
I had exactly the same symptoms when I was debugging web proxy I was developing. It turned out that Fiddler was correcting the CRLF (\r\n) chars that go after the last byte of last header and before first byte of request body. According to HTTP spec, there should be exactly two CRLFs and my proxy was adding three of them there (due to a bug) and Fiddler was silently correcting this.
Not sure if this is the same problem in your case, as you are using proxies, but maybe it will help you somehow.
使用 Wireshark 查看网络数据包级别发生的情况 - 这是最明确的!
(一个警告,我认为这对 Steve 来说是正确的,但对其他读者来说可能不是:这假设您的 Web 服务位于另一台计算机上,因此需要监视一些物理网络活动 - 如果所有活动都在运行,则 Wireshark 将无济于事在您的本地计算机上。)
Use Wireshark to see what's going on at the network packet level - that's as definitive as it gets!
(One caveat, which I think is true for Steve but might not be for other readers: this assumes your web service is on a different machine, so that there is some physical network activity to monitor - Wireshark won't help if it's all running on your local machine.)