...
Wiki Markup |
---|
{snippet:id=publish|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/src/main/java/demo/hw/server/Server.java} |
Alternatively you can use the following code. This gives you more control over the behaviour. For example you can add a logging interceptor:
...
You could leave out the ServiceClass. But it is better to use it so the server and the client are created from the same interface. If you instead only use the implementation class subtle problems may occur.
Pointing your browser at http://localhost:9000/helloWorld?wsdl will display the wsdl for this service
...
and client code to see it working is at http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/src/main/java/demo/hw/client/Client.java
For the client there is also the alternative approach that gives you more flexibility. Of course like above the logging interceptors are optional but they help a lot when starting:
...