最近在学习SOAP,看到书上介绍上SOAP协议是如何如何的,而且在布署时候想看看后台传输的消息内容,如何查看,需要用什么工具吗???
像这样的<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope">
 中间省略
</SOAP-ENV:Envelope>

解决方案 »

  1.   

    通过SOAPMessage.writeto(System.out);可以打出当前的SOAP消息,不过还是谢谢各位。
      

  2.   

    你好,小弟刚刚开始学习 soap ,自己按照网上的资料写了这样一个 Demo,请问 可以 用你这种方法 查看吗 ?
    public static void main(String[] arg) throws Exception {
    Call c = null;
    URL url = null;
    Vector params = null;
    Response rep = null;
    String ourName = "aa";
    String ourUrn = "urn:com_test_SOAPService";
    String ourMethod = "sayHi";
    url = new URL("http://localhost:8081/soap/servlet/rpcrouter");
    System.out.println("Passing to our deployed " + ourUrn + "our name ("
    + ourName + "): ");
    c = new Call();
    c.setTargetObjectURI(ourUrn);
    c.setMethodName(ourMethod);
    c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    params = new Vector();
    params.addElement(new Parameter("ourName", String.class, ourName,null));
    c.setParams(params);
    System.out.print("and its answer is: ");
    rep = c.invoke(url, "");

    if (rep.generatedFault()) {
    Fault fault = rep.getFault();
    System.out.println("\nCall failed!");
    System.out.println("Code = " + fault.getFaultCode());
    System.out.println("String = " + fault.getFaultString());
    } else {
    Parameter result = rep.getReturnValue();
    System.out.print("value : " + result.getValue());
    }

    }