使用jaxws时,如何查看Fiddler中的https调用 [英] How can I view the https calls in Fiddler when using jaxws
问题描述
我正在使用一个基于java的工具,其中包含用于访问Web服务的jaxws-rt-2.1.4.jar。我可以成功访问https Web服务,但是我希望在检索wsdl并在Fiddler中调用服务时看到https请求和响应。
JVM参数包括以下内容:
I am using a java-based tool that includes jaxws-rt-2.1.4.jar for accessing web services. I can access an https web service successfully with correct result but I wish to see the https request and response when retrieving the wsdl and calling the service in Fiddler.
JVM parameters include the following:
-DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888
-Djavax.net.ssl.trustStore=C:\test\xxx.jks -Djavax.net.ssl.trustStorePassword=pw
密钥库包含访问Web服务所需的证书,这可以正常工作。代理设置指向Fiddler所以我不仅希望看到工具前端的http请求+响应(托管在 http:// localhost:8080) )启动调用Web服务的作业,以及https请求+响应。
The keystore contains the certificate needed for accessing the web service and this works fine as said. Proxy settings point at Fiddler so I expected to see not only the http request+response for the tool frontend (hosted on http://localhost:8080) initating the job that calls the web service, but also the https requests+responses.
我用来检索WSDL并调用服务的代码是
The code I use for retrieving the WSDL and calling the service is
url = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?wsdl"
Definition definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(url);
... other code creating the envelopeXML ...
URL wsdlLocation = new URL(url);
Source result =
Service.create(wsdlLocation, serviceQName).createDispatch(
portQName,
Source.class,
Service.Mode.MESSAGE).invoke(new StreamSource(new StringReader(envelopeXML))));
当网址为http时,如 http://www.webservicex .net / periodictable.asmx?wsdl
我确实在Fiddler中看到了请求+响应。
我的设置中缺少哪些内容会在Fiddler中显示https请求和WSDL响应检索和服务电话?也许它需要额外的或不同的JVM设置?
或者它是证书问题 - 我是否必须向Fiddler提供证书并让Fiddler根据它发出证书,该证书在密钥库中使用而不是原始证书?
When the url is an http one like http://www.webservicex.net/periodictable.asmx?wsdl
I do see the requests+responses in Fiddler.
What is missing in my setup that would show in Fiddler the https requests+responses for WSDL retrieval and service call? Maybe it requires an additional or different JVM setting?
Or is it a certificate issue - do I have to give Fiddler the certificate and have Fiddler issue a certificate based on it, that is used in the keystore instead of the original one?
推荐答案
好吧这对我来说应该是显而易见的 - 但是再一次没有观众看到它:-)
我需要有添加了以下JVM参数:
OK this should have been obvious to me maybe - but then again none of the audience saw it :-)
I needed to have the following JVM parms added:
-DproxySet=true -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8888
这样,Fiddler捕获了https请求+响应。
This way, Fiddler catches the https requests+responses.
这篇关于使用jaxws时,如何查看Fiddler中的https调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!