|
Page Edited :
SM :
4.05. Configuring the cxf-se-su service unit
4.05. Configuring the cxf-se-su service unit has been edited by Gert Vanthienen (Aug 16, 2008). Content:Configuring the cxf-se-su service unitOn this page, we are going to configure the cxf-se-su service unit to provide our webservice . Configuring the pom.xmlFirst of all we need to move into the created folder my-cxf-se-su. Changing the project nameIn order to make the build output a little bit more comprehensible we first change the project name in the generated pom.xml file. <project> ... <name>CXF WSDL Tutorial :: CXF SE SU</name> ... </project>
Implementing generated ExampleService.javaWe must implement our service in java. In directory src/main/java/org/apache/servicemix/examples is generated java file ExampleService.java. HelloImpl.java 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; } } Configuring xbean.xmlNext we have to configure our new SU to really provide some webservice. We do this by modifying the file <cxfse:endpoint>
<cxfse:pojo>
<bean class="org.apache.servicemix.examples.HelloImpl" />
</cxfse:pojo>
</cxfse:endpoint>
Next, we are going to create service assembly. Things to remember
Proceed to the next step
|
Unsubscribe or edit your notifications preferences
