tcpmon Java Axis2 客户端 Web 服务响应被重定向
我在 Windows7 上使用 Eclipse Indigo 生成 Axis2(Axis 1.6.1 JDK 合规性 1.5)java 存根,并成功调用位于 http://www.xmlme.com/WSShakespeare.asmx?WSDL 对上述服务的 getSpeech 方法得到了完美的响应。然后我使用 tcpmon (插件)来查看正在交换的 xml。添加了侦听端口 = 4556、目标主机名 = www.xmlme.com 和目标端口 = 80 这会生成 HTTP 302 移动错误。回顾一下,调用时工作正常,
ShakespeareSoapProxy ssp = new ShakespeareSoapProxy("http://www.xmlme.com:80/WSShakespeare.asmx?WSDL");
调用时失败,
ShakespeareSoapProxy ssp = new ShakespeareSoapProxy("http://localhost:4556/WSShakespeare.asmx?WSDL");
但添加 tcpmon 侦听器并使用tcpmonsoap 请求
POST /WSShakespeare.asmx?WSDL HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: www.xmlme.com:4556
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://xmlme.com/WebServices/GetSpeech"
Content-Length: 359
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetSpeech xmlns="http://xmlme.com/WebServices"><Request>To be, or not to be</Request></GetSpeech></soapenv:Body></soapenv:Envelope>
---------tcpmon response below----------------------------
HTTP/1.0 302 Moved
Location: http://172.16.1.6:15871/cgi-bin/blockpage.cgi?ws-session=1096295497
Pragma: no-cache
Cache-Control: no-cache
为什么 tcpmon 如上所述失败是我的主要问题。当 SOAP 客户端工作正常时,为什么我要 tcpmon 呢?因为我用它生成了一个 jar,它在 Windows7 上运行得很好。但是当我在我的 iSeries 又名 AS400 服务器上运行相同的 jar 时,它给了我 Axis 错误 HTTP 401 未经授权 &需要身份验证的消息。我们的 IT 人员确实运行 websense 来阻止某些内容,但这是 Windows 客户端上的本地主机,我之前曾在其中运行过 .NET Web 服务。 非常感谢您的想法和回复,谢谢。
编辑 - 一些研究指出 Windows 发送而服务器不发送的 NTLM 默认凭据?有人想发表评论吗?
I used Eclipse Indigo on Windows7 to generate Axis2 (Axis 1.6.1 JDK compliance 1.5) java stubs and successfully called the public web service at http://www.xmlme.com/WSShakespeare.asmx?WSDL
Got perfect response to getSpeech method of said service. Then I used tcpmon (plugin) to see xml being exchanged. Added Listen port = 4556, Target Host name = www.xmlme.com and Target port = 80 This generated HTTP 302 Moved error. To recap works correctly when called with
ShakespeareSoapProxy ssp = new ShakespeareSoapProxy("http://www.xmlme.com:80/WSShakespeare.asmx?WSDL");
but fails when tcpmon listener added and called with
ShakespeareSoapProxy ssp = new ShakespeareSoapProxy("http://localhost:4556/WSShakespeare.asmx?WSDL");
tcpmon soap Request
POST /WSShakespeare.asmx?WSDL HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: www.xmlme.com:4556
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://xmlme.com/WebServices/GetSpeech"
Content-Length: 359
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetSpeech xmlns="http://xmlme.com/WebServices"><Request>To be, or not to be</Request></GetSpeech></soapenv:Body></soapenv:Envelope>
---------tcpmon response below----------------------------
HTTP/1.0 302 Moved
Location: http://172.16.1.6:15871/cgi-bin/blockpage.cgi?ws-session=1096295497
Pragma: no-cache
Cache-Control: no-cache
Why is tcpmon failing as above is my primary question. WHY did I tcpmon it when the SOAP client worked perfectly? Because I generated a jar out of it and it worked great on Windows7. But when I ran the same jar on my iSeries aka AS400 server it gave me Axis fault HTTP 401 unauthorized & Authentication required message. Our IT guys do run websense to block stuff but this is localhost on windows client where I have run .NET web services before. Ideas, responses are greatly appreciated, thanks.
Edit - Some research points at NTLM default credentials that windows sends and server doesnt? Anyone want to comment if that could be it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您被重定向到的 IP (172.16.1.6) 位于您的网络本地(请参阅“保留 IP 地址” 。)请咨询您的网络管理员,了解他们是否阻止您对 www.xmlme.com 的请求以及原因。
在我看来,这个问题应该在没有 tcpmon 的情况下重现。您可以使用网络嗅探器(例如 Wireshark)来比较使用和不使用 tcpmon 的流量。
The IP you're being redirected to (172.16.1.6) is local to your network (see "Reserved IP addresses".) Check with your network administrators whether they're blocking your request to www.xmlme.com and why.
It looks to me like the problem should reproduce without tcpmon as well. You can use a network sniffer (e.g. Wireshark) to compare the traffic with and without tcpmon.