|
Page Edited :
SM :
1.05 Configuring the cxf-se-su service unit
1.05 Configuring the cxf-se-su service unit has been edited by Lars Heinemann (Aug 11, 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.xmlChanging 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>
After doing this, we need to run mvn install in order to get the java classes generated. Implementing generated ExampleService.javaWe must implement our service in java. In our example, it's HelloImpl.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
