问题描述
我有一个Web应用程序,它在Tomcat6中运行,并通过HTTPS将SOAP消息发送到某个外部系统。
I have a web application, which runs inside Tomcat6 and sends SOAP messages to some external system via HTTPS.
我想拦截这些消息。
为了做到这一点,我在工具 - > Fiddler选项对话框中启用了HTTPS捕获。
In order to do this I enabled HTTPS capture in the Tools -> Fiddler options dialog box.
重新启动Fiddler后,我可以看到几个主机(如Google,Evernote)的HTTPS请求,但不能看到我的Java应用程序与之对话的外部系统。
After I restarted Fiddler, I can see HTTPS requests to several hosts (like Google, Evernote) but not to the external system my Java app talks to.
然后,我添加了JVM选项 -Dhtttps.proxyHost = ipv4.fiddler -Dhttps.proxyPort = 80
到我的启动配置并重新启动应用程序。同样,Fiddler没有捕获任何SOAP请求。
Then, I added the JVM options -Dhtttps.proxyHost=ipv4.fiddler -Dhttps.proxyPort=80
to my launch configuration and restarted the application. Again, no SOAP requests were captured by Fiddler.
如何查看SOAP消息(使用Fiddler或其他工具)?
What can I do in order to view the SOAP messages (using Fiddler or some other tool) ?
更新1(22.10.2013 12:35 MSK):当我将JVM参数更改为 -Dhttps.proxyHost = ipv4.fiddler -Dhttps.proxyPort = 80时 - DproxySet = true -DproxyHost = ipv4.fiddler -DproxyPort = 80
我得到异常 com.sun.xml.internal.ws.client.ClientTransportException:HTTP传输错误:java。 net.UnknownHostException:ipv4.fiddler
发送请求时。
Update 1 (22.10.2013 12:35 MSK): When I change the JVM parameters to -Dhttps.proxyHost=ipv4.fiddler -Dhttps.proxyPort=80 -DproxySet=true -DproxyHost=ipv4.fiddler -DproxyPort=80
I get the exception com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.UnknownHostException: ipv4.fiddler
when the request is sent.
推荐答案
正确的JVM参数是: -Dhttps.proxyHost = 127.0.0.1 -Dhttps.proxyPort = 8888 -DproxySet = true -DproxyHost = 127.0.0.1 -DproxyPort = 8888
。
The correct JVM parameters were: -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8888 -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888
.
这篇关于如何从Tomcat Java应用程序捕获SOAP消息到外部服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!