Webservice axis2打印请求、响应报文方法

Webservice axis2打印请求、响应报文方法

包:axis2-kernel-1.7.4.jar

包路径:org.apache.axis2.description

类:OutInAxisOperation.java

1=======================请求报文=======================

在send方法中

SOAPEnvelope reqenvelope = msgContext.getEnvelope();
if(reqenvelope != null){
    System.out.println("【client - request body start】");
    System.out.println(reqenvelope.getBody().toString());
    System.out.println("【client - request body end】");
}

2=======================响应报文=======================

在handleResponse方法中

resenvelope = responseMessageContext.getEnvelope();
System.out.println("【client - response body start】");
System.out.println(resenvelope.getBody().toString());
System.out.println("【client - response body end】");

Ps:以上方法只针对客户端。服务端待续…

你可能感兴趣的:(java心得,webservice,axis2,打印报文)