Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.4.2. Implementing the Service Provider
Generating the implementation code Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
You generate the implementation class used to build your service provider with the code generator's
-impl
flag.
Tip
If your service's contract includes any custom types defined in XML Schema, you must ensure that the classes for the types are generated and available.
For more information on using the code generator see cxf-codegen-plugin.
Generated code Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The implementation code consists of two files:
portTypeName.java
— The service interface(SEI) for the service.portTypeNameImpl.java
— The class you will use to implement the operations defined by the service.
Implement the operation's logic Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To provide the business logic for your service's operations complete the stub methods in
portTypeNameImpl.java
. You usually use standard Java to implement the business logic. If your service uses custom XML Schema types, you must use the generated classes for each type to manipulate them. There are also some Apache CXF specific APIs that can be used to access some advanced features.
Example Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
For example, an implementation class for the service defined in Example 3.1, “HelloWorld WSDL Contract” may look like Example 4.2, “Implementation of the Greeter Service”. Only the code portions highlighted in bold must be inserted by the programmer.
Example 4.2. Implementation of the Greeter Service