【问题标题】:Capturing SOAP message on localhost using Fiddler使用 Fiddler 在 localhost 上捕获 SOAP 消息
【发布时间】:2012-11-04 14:31:13
【问题描述】:

当我的 Java 客户端向我的本地 Tomcat 实例发出 SOAP 请求时,我无法捕获本地 HTTP 流量。

我目前的配置是

  • Tomcat 实例 - 在 localhost:8080 上运行
  • 本地 Java 客户端 - 从 Windows cmd 行运行
  • 提琴手 - 在 localhost:8888 上运行

我使用 Axis2 wsdl2java 创建我的客户端 SOAP 存根,并在指定 WSDL(托管在 Tomcat 上)时使用我的机器 IP 地址

wsdl2java -uri http://192.168.0.5:8080/axis2/services/Version?wsdl -p sample.axisversion -d adb -s

所以,生成的代码在整个过程中都有这样的行:

  public VersionStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault {
    this(configurationContext,"http://192.168.0.5:8080/axis2/services/Version.VersionHttpSoap12Endpoint/" );
}

我的客户端应用程序使用生成的存根,并使用以下代码(在实际使用 SOAP 存根之前调用该代码)将 Java 代理设置为 Fiddler:

System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "localhost");
System.getProperties().put("proxyPort", "8888");

...但我仍然没有在 Fiddler 中看到任何请求或响应流量。缺少什么?

【问题讨论】:

  • 您的代码如何引用服务?它使用 192.168.0.5 还是使用 127.0.0.1?如果您使用远程主机名或 IP,Fiddler 会捕获它吗?你可以试试这里的步骤:fiddler2.com/fiddler/help/hookup.asp#Q-JavaTraffic
  • 由于 wsdl2java 工具提供了参数 192.168.0.5,它在生成的客户端存根中使用此地址。

标签: http soap fiddler


【解决方案1】:

尝试使用ipv4.fiddler,而不是localhost,这样可以确保您的本地主机流量通过提琴手。另见:http://www.fiddler2.com/Fiddler/Help/hookup.asp#Q-LocalTraffic

【讨论】:

    猜你喜欢
    • 2013-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-27
    • 2015-09-09
    • 1970-01-01
    相关资源
    最近更新 更多