...
First we'll write our service interface. It will have one operation called "sayHello" sayHi
which says "Hello" to whoever submits their name.
Wiki Markup |
---|
{snippet:id=service|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/src/main/java/demo/hw/server/HelloWorld.java?revision=HEAD} |
...
Wiki Markup |
---|
{snippet:id=service|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/src/main/java/demo/hw/server/HelloWorldImpl.java?revision=HEAD} |
...
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?revision=HEAD} |
Alternatively you can use the follwing code. This gives you more control over the behaviour. For example you can add a logging interceptor:
...
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:
...