Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
my-cxf-se-su/src/main/resources.

Implementing generated ExampleService.java

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

No Format
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.xml

Next, we will have to configure our new SU to really provide some services. We do this by modifying the file named xbean.xml in the src/main/resources directory of our my-cxf-se-su module.

No Format

<cxfse:endpoint>
   <cxfse:pojo>
      <bean class="org.apache.servicemix.examples.HelloImpl" />
   </cxfse:pojo>
</cxfse:endpoint>

Next, we are going to create service assembly.

...