...
This plugin is used for generating java classes from the WSDL file. We use the wsdl2java tool from JAX-WS (CXF framework).
The next step is to copy the WSDL file we already made in the my-cxf-bc-su to the my-cxf-se-su because we need it to generate
the java classes from it. So copy it now:
...
We must implement our service in java. In our example, it's HelloImpl.javadirectory src/main/java/org/apache/servicemix/examples is generated java file ExampleService.java.
So, we must rename this file to HelloImpl.java and change its content on this:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
package org.apache.servicemix.examples; import javax.jws.WebService; import javax.xml.ws.Holder; import org.apache.servicemix.examples.types.SayHello; import org.apache.servicemix.examples.types.SayHelloResponse; @WebService(serviceName = "HelloService", targetNamespace = "http://servicemix.apache.org/examples", endpointInterface = "org.apache.servicemix.examples.Hello") public class HelloImpl implements Hello { public void sayHello(Holder<String> name) throws UnknownWordFault { if (name.value == null || name.value.length() == 0) { org.apache.servicemix.examples.types.UnknownWordFault fault = new org.apache.servicemix.examples.types.UnknownWordFault(); throw new UnknownWordFault(null, fault); } name.value = "Hi " + name.value; } } |
...