Java 如何查看Axis2发送和接收的内容?
我已经创建了Axis2 web服务客户端。此服务同时使用SSL和WS-Security,因此我使用Java 如何查看Axis2发送和接收的内容?,java,http,web-services,axis2,axis,Java,Http,Web Services,Axis2,Axis,我已经创建了Axis2 web服务客户端。此服务同时使用SSL和WS-Security,因此我使用rampart。我认为我的客户发送了正确的查询,但我得到了一个例外: org.apache.axis2.AxisFault: Must Understand check failed for header http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd : Security at or
rampart
。我认为我的客户发送了正确的查询,但我得到了一个例外:
org.apache.axis2.AxisFault: Must Understand check failed for header http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd : Security
at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:97)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at pl.firstdata.www.wdx.business.card.CardServiceStub.getBalance(CardServiceStub.java:1570)
at pl.firstdata.www.wdx.business.card.wdx_client.main(wdx_client.java:164)
有没有办法用HTTP头查看“裸”查询和响应
虽然该服务使用SSL,但我认为我不能使用HTTP监视器,这应该在“应用”WS-Security之后、SSL之前由axis2完成。我可以在我的模拟器上启用这样的日志记录(不使用SSL),它看起来是这样的:
POST /webservices/emu/get_info.hdb HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: 127.0.0.1:8765
Content-Length: 4585
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1"><xenc:EncryptedKey Id="EncKeyId-0D71FF61F3796881F812803190645315"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference><wsse:KeyIdentifier ...
...
POST/webservices/emu/get_info.hdb HTTP/1.1
内容类型:text/xml;字符集=UTF-8
SOAPAction:“
用户代理:Axis2
主持人:127.0.0.1:8765
内容长度:4585
为此,请使用tcpmon工具
请注意,在大多数基于Linux的安装中,这很可能是为您构建的。完成构建过程后,可以在Linux上的${AXIS2C_HOME}/bin/tools或MS Windows上的%AXIS2C_HOME%\bin\tools中找到可执行文件。我使用with。步骤:
我的axis2
app做普通的HTTP查询;此查询发送到tcpmon
tcpmon
记录它并将查询发送到stunel
stunel
添加SSL并向目标服务器发送端加密查询
stunel
接收加密响应,对其解密并发送回tcpmon
tcpmon
记录解密后的响应并将其发送到我的axis2
应用程序
我已经在使用它了,但不适用于受SSL保护的服务。服务提供商告诉我,他甚至不能为测试禁用SSL,所以我需要其他工具。也许AxIS2有一些选择可以看到“裸”查询和“裸”回答吗?我相信即使在SSL调试中,FIDDLE也可以充当中间代理。(fiddler是用于调试http请求的代理)谢谢。在我的回答中,我使用了特技。它不需要.NET作为fiddler2,而且对于使用tcpmon的人来说似乎很容易。@Michal,我该如何配置axis以使用fiddler2作为我的代理?自从安装了wireshark之后,我就在windows上使用了它。