1.05 Configuring the cxf-se-su service unit has been edited by Vladislav Krejcirik (Aug 04, 2008).

(View changes)


On this page, we are going to configure the cxf-se-su service unit to provide our service .

Configuring pom.xml

Changing the project name

In order to make the build output a little bit more comprehensible, we first change the project name in the generated pom.xml file.

  <name>CXF WSDL Tutorial :: CXF SE SU</name>

Adding version of cxf to pom.xml

We must specify version of CXF.

	<cxf-version> 2.0.7</cxf-version>

Adding org.apache.cxf plugin

We add this plugin to the generated pom.xml file to element plugins.


Where service.wsdl is WSDL file, which we made in my-cxf-bc-su. We must copy this WSDL file from my-cxf-bc-su/src/main/resources to

Implementing generated ExampleService.java

We must implement our service in java. In our example, it's HelloImpl.java

package org.apache.servicemix.examples;

import javax.jws.WebService;
import javax.xml.ws.Holder;

import com.mycompany.hello.types.SayHello;
import com.mycompany.hello.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;


Next, we are going to create service assembly.

Things to remember

  • You specify the plugin for a SU in Maven's pom.xml file
  • In ServiceMix, most service units will be configured by a file named xbean.xml

Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request

Unsubscribe or edit your notifications preferences