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 contenido no está disponible en el idioma seleccionado.
40.2. Generating the Stub Code
Overview Copiar enlaceEnlace copiado en el portapapeles!
jaxws:bindings tag (where the jaxws prefix is tied to the http://java.sun.com/xml/ns/jaxws namespace). There are two ways of specifying a binding declaration:
- External Binding Declaration
- When using an external binding declaration the
jaxws:bindingselement is defined in a file separate from the WSDL contract. You specify the location of the binding declaration file to code generator when you generate the stub code. - Embedded Binding Declaration
- When using an embedded binding declaration you embed the
jaxws:bindingselement directly in a WSDL contract, treating it as a WSDL extension. In this case, the settings injaxws:bindingsapply only to the immediate parent element.
Using an external binding declaration Copiar enlaceEnlace copiado en el portapapeles!
Example 40.2. Template for an Asynchronous Binding Declaration
wsdl:definitions, if you want the entire WSDL contract to be affected. The jaxws:enableAsyncMapping element is set to true to enable the asynchronous invocation feature.
GreeterAsync interface, you can specify <bindings node="wsdl:definitions/wsdl:portType[@name='GreeterAsync']"> in the preceding binding declaration.
async_binding.xml, you would set up your POM as shown in Example 40.3, “Consumer Code Generation”.
Example 40.3. Consumer Code Generation
-b option tells the code generator where to locate the external binding file.
Using an embedded binding declaration Copiar enlaceEnlace copiado en el portapapeles!
jaxws:bindings element and its associated jaxws:enableAsynchMapping child directly into the WSDL. You also must add a namespace declaration for the jaxws prefix.
Example 40.4. WSDL with Embedded Binding Declaration for Asynchronous Mapping
wsdl:definitions element the code generator creates asynchronous methods for all of the operations defined in the WSDL document. If it is placed as a child of a wsdl:portType element the code generator creates asynchronous methods for all of the operations defined in the interface. If it is placed as a child of a wsdl:operation element the code generator creates asynchronous methods for only that operation.
Generated interface Copiar enlaceEnlace copiado en el portapapeles!
GreeterAsync SEI (in the file GreeterAsync.java) is defined as shown in Example 40.5, “Service Endpoint Interface with Methods for Asynchronous Invocations”.
Example 40.5. Service Endpoint Interface with Methods for Asynchronous Invocations
greetMeSometime(), two asynchronous methods are also generated for the greetMeSometime operation: