我在我的客戶端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發佈的並且在本地運行。
我也採取了http://stackoverflow.com/questions/1945618/tracing-xml-request-responses-with-jax-ws的幫助。 – Satish