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.Este conteúdo não está disponível no idioma selecionado.
25.3. Implementing the Service Provider
Generating the implementation code Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
You generate the implementation class used to build your service provider with the code generator's
-impl
flag.
Note
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 Section E.2, “cxf-codegen-plugin”.
Generated code Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
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 Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
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 Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
For example, an implementation class for the service defined in Example 24.1, “HelloWorld WSDL Contract” may look like Example 25.2, “Implementation of the Greeter Service”. Only the code portions highlighted in bold must be inserted by the programmer.
Example 25.2. Implementation of the Greeter Service