Java:如何查看ServiceClient.sendReceive发送和接收的XML?

Java:如何查看ServiceClient.sendReceive发送和接收的XML?,java,axis2,Java,Axis2,我正在尝试调试我在使用axis2使用.wsdl文件访问SOAP API时遇到的一个问题。我使用的方法是: sendReceive正在引发异常,我甚至无法判断是因为发送了什么还是因为服务器的响应。我希望能够看到发送和接收的XML,但我试图通过数据包嗅探来查找它,却被SSL阻止了。具体而言,我遇到的错误有: SOAPProcessingException First Element must contain the local name, Envelope , but found defin

我正在尝试调试我在使用axis2使用.wsdl文件访问SOAP API时遇到的一个问题。我使用的方法是:

sendReceive正在引发异常,我甚至无法判断是因为发送了什么还是因为服务器的响应。我希望能够看到发送和接收的XML,但我试图通过数据包嗅探来查找它,却被SSL阻止了。具体而言,我遇到的错误有:

SOAPProcessingException First Element must contain the local name, Envelope , but 
  found definitions  org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode 
  (StAXSOAPModelBuilder.java:299)


第一个错误使我认为应该用SOAP信封包装请求。当我这样做是当我得到第二个错误。我希望能够查看XML,以便能够准确地了解消息发生的情况。

如果您在Windows上,请安装并监视适配器上的通信量,以确定发送和接收的内容。在Linux上,请阅读
tcpdump(8)

的手册页。我使用tcpdump获取发生的通信转储,但它是加密的,因此我实际上看不到任何通信。
XMLStreamException Can not output XML declaration, after other output has 
already been done.  com.ctc.wstx.sw.BaseStreamWriter.throwOutputError (BaseStreamWriter.java:1473)