Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Swordfish Documentation: Generating Dynamic WSDL"

 
(6 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
==About Dynamic WSDL Generation==
 
==About Dynamic WSDL Generation==
 
This feature allows users to access dynamically generated WSDLs for JAX-WS endpoints deployed within the Swordfish.<BR/>
 
This feature allows users to access dynamically generated WSDLs for JAX-WS endpoints deployed within the Swordfish.<BR/>
Let's consider the following example:<BR/>
+
Consider this example:<BR/>
 
The jaxws endpoint is deployed with the descriptor:
 
The jaxws endpoint is deployed with the descriptor:
 
<pre>
 
<pre>
 
  <jaxws:endpoint id="bookingService"
 
  <jaxws:endpoint id="bookingService"
 
                implementor="org.eclipse.swordfish.samples.cxf.BookingServiceImpl"
 
                implementor="org.eclipse.swordfish.samples.cxf.BookingServiceImpl"
                address="nmr:BookingService">
+
                address="nmr:BookingService"/>  
</jaxws:endpoint>
+
 
</pre>
 
</pre>
 
The http endpoint is used to access the jax-ws service externally:
 
The http endpoint is used to access the jax-ws service externally:
Line 27: Line 26:
 
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
 
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
 
  </pre>
 
  </pre>
 +
The HTTP endpoint points to <tt>swordfishCxf:BookingServiceImpl</tt> service and it is managed and deployed by the JBI ServiceMix HTTP binding component.
 +
The problem is that there is no default mechanism to access the dynamically generated booking service WSDL document via the HTTP Endpoint facilities. The [https://dev.eclipse.org/svnroot/rt/org.eclipse.swordfish/trunk/org.eclipse.swordfish.plugins.ws.wsdlgenerator| org.eclipse.swordfish.plugins.ws.wsdlgenerator] project was created  to solve
 +
these partictular problems.<br>
 +
The project:
 +
<ol>
 +
<li> Tracks all deployed HTTP endpoints
 +
<li> Searches for the targeted JAX-WS services. <br>
 +
NOTE: The HTTP endpoint's deployment descriptor should contain  <tt>targetService</tt> or <tt>targetEndpoint</tt> or targetInterface attributes, otherwise the WSDL generator will not be able the find the corresponding JAX-WS service
 +
<li> Generates the WSDL for the service and injects it in the HTTP endpoint.
 +
</ol>
 +
To leverage the use of the Swordfish Dynamic WSDL Generation feature, the org.eclipse.swordfish.plugins.ws.wsdlgenerator project should be added to the target platform.
 +
To access the generated WSDL document for the HTTP endpoint just add the "?wsdl" to the locationURI. For example, httpConsumerEndpoint publishes its wsdl document to the address
 +
http://localhost:8192/cxfsample/?wsdl
  
 
+
--------------
 
+
 
+
  
 
[[Swordfish_Documentation |Swordfish Documentation Home]] <br/>
 
[[Swordfish_Documentation |Swordfish Documentation Home]] <br/>
 
[[Swordfish | Swordfish Wiki Home]] <br/>
 
[[Swordfish | Swordfish Wiki Home]] <br/>

Latest revision as of 04:03, 25 June 2009

Generating Dynamic WSDL

This section contains instructions on implementing the dynamic WSDL generation feature.

Prerequisites

Eclipse Galileo M7 build or later. The examples described here are based on Eclipse Galileo M7.

About Dynamic WSDL Generation

This feature allows users to access dynamically generated WSDLs for JAX-WS endpoints deployed within the Swordfish.
Consider this example:
The jaxws endpoint is deployed with the descriptor:

 <jaxws:endpoint id="bookingService"
	                implementor="org.eclipse.swordfish.samples.cxf.BookingServiceImpl"
	                address="nmr:BookingService"/> 

The http endpoint is used to access the jax-ws service externally:

   <http:endpoint                  
                 endpoint="httpConsumerEndpoint"                 
                 service="httpConsumerEndpoint"
                 targetService="swordfishCxf:BookingServiceImpl"
                 soap="true"
                 role="consumer"                  
                 locationURI="http://0.0.0.0:8192/cxfsample/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
 

The HTTP endpoint points to swordfishCxf:BookingServiceImpl service and it is managed and deployed by the JBI ServiceMix HTTP binding component. The problem is that there is no default mechanism to access the dynamically generated booking service WSDL document via the HTTP Endpoint facilities. The org.eclipse.swordfish.plugins.ws.wsdlgenerator project was created to solve these partictular problems.
The project:

  1. Tracks all deployed HTTP endpoints
  2. Searches for the targeted JAX-WS services.
    NOTE: The HTTP endpoint's deployment descriptor should contain targetService or targetEndpoint or targetInterface attributes, otherwise the WSDL generator will not be able the find the corresponding JAX-WS service
  3. Generates the WSDL for the service and injects it in the HTTP endpoint.

To leverage the use of the Swordfish Dynamic WSDL Generation feature, the org.eclipse.swordfish.plugins.ws.wsdlgenerator project should be added to the target platform. To access the generated WSDL document for the HTTP endpoint just add the "?wsdl" to the locationURI. For example, httpConsumerEndpoint publishes its wsdl document to the address http://localhost:8192/cxfsample/?wsdl


Swordfish Documentation Home
Swordfish Wiki Home

Back to the top