2013-01-17 129 views
0

我在我的客戶端VM參數中設置了-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump = true。我正在使用JAX-WS客戶端。但是,儘管SOAP消息沒有被打印在控制檯中。任何原因?沒有打印SOAP調試消息

這是我的客戶端代碼。

package com.helloworld.client; 

import java.net.URL; 
import javax.xml.namespace.QName; 
import javax.xml.ws.Service; 
import com.helloworld.ws.HelloWorld; 

public class HelloWorldClient{ 

    public static void main(String[] args) throws Exception { 

    URL url = new URL("http://localhost:9999/ws/hello?wsdl"); 

     //1st argument service URI, refer to wsdl document above 
    //2nd argument is service name, refer to wsdl document above 
     QName qname = new QName("http://ws.helloworld.com/", "HelloWorldImplService"); 

     Service service = Service.create(url, qname); 

     HelloWorld hello = service.getPort(HelloWorld.class); 

     System.out.println(hello.getHelloWorldAsString("Test String")); 

    } 

} 

我的服務器是我用Endpoint.publish發佈的並且在本地運行。

回答

0

服務器

com.sun.xml.ws.transport.http.HttpAdapter.dump=true 

。您還可以使用@HandlerChain(file = "....")註釋 更多關於JAX-WS處理程序herehere

+0

我也採取了http://stackoverflow.com/questions/1945618/tracing-xml-request-responses-with-jax-ws的幫助。 – Satish

0

這是正確的VM參數-Dcom.sun.xml.ws.transport。 http.client.HttpTransportPipe.dump = TRUE。你在使用任何IDEA嗎?