如何查看Axis2发送和接收的内容? [英] How to see what Axis2 sends and receives?

查看:162
本文介绍了如何查看Axis2发送和接收的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Axis2创建的Web服务客户端.该服务同时使用SSL和WS-Security,因此我使用rampart.我认为我的客户发送了正确的查询,但出现异常:

I have Axis2 created web service client. This service uses both SSL and WS-Security so I use rampart. I think that my client sends correct query, but I got exception:

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标头的裸"查询和响应?

Is there any way to see "bare" query and response with HTTP headers?

虽然此服务使用SSL,但我认为我不能使用HTTP监视器,这应该由axis2在应用" WS-Security之后但在SSL之前完成.我可以在模拟器上启用这种日志记录(不使用SSL),看起来像这样:

While this service use SSL I think I cannot use HTTP monitor, and this should be done by axis2 after "applying" WS-Security but before SSL. I can enable such logging on my emulator (without SSL) and it seems like that:

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 ...
...

推荐答案

我在 stunel 中使用了 stunel href ="https://tcpmon.dev.java.net/" rel ="nofollow noreferrer"> tcpmon .步骤:

I use stunel with tcpmon. Steps:

  1. 我的axis2应用执行常规HTTP查询;该查询将发送到tcpmon
  2. tcpmon记录它并将查询发送到stunel
  3. stunel添加SSL并将加密后的查询发送到目标服务器
  4. stunel接收加密的响应,将其解密并发送回tcpmon
  5. tcpmon记录解密的响应并将其发送到我的axis2应用
  1. my axis2 app do normal HTTP query; this query is send to tcpmon
  2. tcpmon logs it and sends query to stunel
  3. stunel adds SSL and sends endcrypted query to destination server
  4. stunel receives encrypted response, decrypts it and sends back to tcpmon
  5. tcpmon logs decrypted response and sends it to my axis2 app

这篇关于如何查看Axis2发送和接收的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆