Search code examples
web-servicessoapjax-ws

SOAP Debug message not getting printed


I set -Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true in my client VM arguments. I am using JAX-WS client. But inspite of that SOAP Message is not getting printed in the console. Any reason?

This is my client code.

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"));

    }

}

My server is I published using Endpoint.publish and is running locally.


Solution

  • on Server

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

    You can also use @HandlerChain(file = "....") annotation More about Jax-WS Handlers here and here