The structure of the output that the UML-to-WSDL transformation generates depends on the structure of the UML source model. The IBM® Rational® Software Architect UML-to-WSDL transformation uses the bindings to generate Web Service Description Language (WSDL) files. The specific steps are described here.
To follow the steps, you need to understand the Java™ programming model, Eclipse plug-in architecture and development, and IBM Rational Software Architect transformation authoring concepts. The steps described in this article are performed using IBM Rational Software Architect Version 7.
The Rational Software Architect UML-to-WSDL transformation uses the bindings to generate Web Service Description Language (WSDL) files. These are the main steps for customizing the bindings:
- Import an existing UML project with predefined UML elements by using the project interchange capability. Run the UML-to-WSDL transformation to generate the WSDL file. Save and export the project by using the project interchange mechanism. You will use this project later to test the transformation and compare the generated WSDL files.
- Create a plug-in project to create the transformation extension.
- Add a set of required plug-in dependencies. These plug-ins define the extension point that you are implementing and provide the APIs that you will need to invoke your extension.
- Define the extension point in the plug-in descriptor, which identifies the transformation that you want to extend and the point within it that you want to make a contribution.
- Provide Java implementations of the rules that will be invoked each time the transformation encounters the element types that you registered.
- Test the transformation by invoking a runtime workbench and executing the transformation. You will need to import the UML project that you exported earlier and run the UML-to-WSDL transformation to observe the behavior and effect of the transformation extension that you created.
When you run the transformation, it will also execute the rules that you defined in your transformation extension. As a result, it will change the WSDL binding to SOAP binding.
Import the project interchange
In this task, you will import the UML project and run the UML-to-WSDL transformation. Then you will save and export the UML project.
- Launch Rational Software Architect.
- Switch to the Modeling perspective.
- Select File > Import.
- In the Import dialog, replace "
type filter text"withproject. Then select Project Interchange under Other.
Figure 01. Select Project Interchange as the import type
- Click Next.
- Click Browse and then navigate to the location of the
TestUML1.zipfile (see the download section for this artifact). Click Open. - Click Select All.
- Click Finish.
- Take a moment to review the UML Model within this imported project.
Figure 2. The imported project
- Double-click the preconfigured WSDLconfig1.tc transformation configuration. Take a moment to review the Transformation Configuration; review the Source and Target and Common tabs. Notice that the Visual Merge option is selected for Merge Options.
- Right-click on WSDLconfig1.tc transformation configuration and Transform > UML to WSDL
. - Click OK to merge the transformation output (see Figure 3).
Figure 3. Visual display of the merge configuration
- Click OK to save (see Figure 4).
Figure 4. Save the target resources that you selected to replace
- Open the generated Component1.wsdl file within the
Test\Samplefolder under theTestUMLproject. Review the WSDL binding section, which is shown in bold in Listing 1.
Listing 1. WSDL binding section
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://test.sample/Component1/"
xmlns:wsdl_1="http://test.sample/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="Component1"
targetNamespace="http://test.sample/Component1/">
<wsdl:import location="test.sample.wsdl" namespace="http://test.sample/"/>
<wsdl:binding name="Interface1Binding" type="wsdl_1:Interface1">
<wsdl:operation name="Operation1">
<wsdl:input/>
<wsdl:output/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="interface1">
<wsdl:port binding="tns:Interface1Binding" name="Interface1Port"/>
</wsdl:service>
</wsdl:definitions>
|
- You are going to use this project to test your plug-in project in the next task. Export your project by selecting File > Export.
- In the Import dialog, replace "
type filter text"withproject. - Then select Project Interchange under Other, as shown in Figure 5.
Figure 5. Select Project Interchange as the export type
- Click Next.
- Click Browse and then navigate to a folder of your choice and type the name of the
TestUML2.zipfile. - Click Save and then Finish.
- Right-click on the
TestUMLproject and select Close Project.
You will now create a plug-in project to extend the included UML-to-WSDL transformation so that it generates WSDL files.
- Select File > New > Project.
- In the New dialog, replace "
type filter text"withplug-in, and then select Plug-in Project, as shown in Figure 6.
Figure 6. Create a plug-in project
ALT: Plug-in Project wizard view
- Click Next
- Name the project
com.ibm.uml2.wsdl.binding.extension,and leave the rest of the default settings as they are (see Figure 7).
Figure 7. Create a plug-in project
- Change the default Plug-in Name field to
UML-to-WSDL Transformation Extension,and leave the rest of the default settings (see Figure 8).
Figure 8. Create a plug-in project
- Click Next.
- In the next view (Figure 9), uncheck the Create a plug-in using one of the templates option and click Finish.
Figure 9. Create a plug-in project
- In the Open Associated Perspective? dialog (shown in Figure 10), click Yes to switch to the Plug-in Development perspective.
Figure 10. Switch to the Plug-in Development view
- If it is not already open, open the
plugin.xmlfile, switch to the Dependencies tab and click Add. - Type
com.ibm.xtools.transform.core,select the first option in the list, and click OK.
Figure 11. Add dependencies
- Repeat the previous step to add the following dependencies (shown in Figure 12):
- com.ibm.xtools.transform.uml2.wsdl
- org.eclipse.xsd
- org.eclipse.wst.wsdl
- org.wsdl4j
- com.ibm.xtools.transform.uml2.wsdl
Figure 12. Add dependencies
- Switch to the Extensions
tab and click to addcom.ibm.xtools.transform.core.transformationExtensions.
Figure 13. Add dependencies
- Save the
plugin.xmlfile.
Although you could do the rest of the changes by using the respective tabs, it will be quicker to do them in the raw code of the plugin.xml file.
- Switch to the
plugin.xmltab. - In the extension point, add the following element that contains the information shown in Listing 2 (also shown in Figure 14).
Listing 2. Add an element to the extension point
<TransformationExtension version="7.0.0" name="TEST-BINDING binding extension" enabled="true" targetTransformation="com.ibm.xtools.transform.uml2.wsdl.internal.Uml2WsdlTransform.RS" id="com.ibm.xtools.transform.uml2.wsdl.extension.TEST-BINDING"> </TransformationExtension> |
Figure 14. Element added to the extension point
- In the
TransformationExtensionelement, create a property that contains the information shown in Listing 3 and Figure 15.
Listing 3. Property to add
<Property
id="com.ibm.xtools.transform.uml2.wsdl.bindings.TEST-BINDING"
metatype="string"
name="com.ibm.xtools.transform.uml2.wsdl.bindings"
readonly="true"
value="TEST-BINDING"/>
|
Figure 15. Property added
- In the property that you created in the previous step, define the following rules as shown in Listing 4 and Figure 16.
Listing 4. Define rules
<RuleDefinition class="com.ibm.uml2.wsdl.binding.extension.TestBindingAddressExtensionRule" id="TestBindingAddressExtensionRule" name="TestBindingAddressExtensionRule"/> <RuleDefinition class="com.ibm.uml2.wsdl.binding.extension.TestBindingBindingExtensionRule" id="TestBindingBindingExtensionRule" name="TestBindingBindingExtensionRule"/> <RuleDefinition class="com.ibm.uml2.wsdl.binding.extension.TestBindingBindingOperationExtensionRule" id="TestBindingBindingOperationExtensionRule" name="TestBindingBindingOperationExtensionRule"/> |
Figure 16. Rules defined
- In the
TransformationExtensionelement, create the ExtendTransform elements as shown in Listing 5 and Figure 17.
Listing 5. ExtendTransform elements
<ExtendTransform targetTransform="AddressExtensionTransform">
<AddRule id="TestBindingAddressExtensionRule"/>
</ExtendTransform>
<ExtendTransform targetTransform="BindingExtensionTransform">
<AddRule id="TestBindingBindingExtensionRule"/>
</ExtendTransform>
<ExtendTransform targetTransform="BindingOperationExtensionTransform">
<AddRule id="TestBindingBindingOperationExtensionRule"/>
</ExtendTransform>
|
Figure 17. Configure the plugin.xml file code
- Click File > Save.
Provide Java implementations for the transformation rules
- For each rule that you defined in the
plugin.xml, create the corresponding Java class in the plug-in that you created in previous task. The Java classes that you create must extend the corresponding abstract classes, and implement the corresponding abstract methods:com.ibm.uml2.wsdl.binding.extension.TestBindingAddressExtensionRuleclass must extendcom.ibm.xtools.transform.uml2.wsdl.util.AbstractAddressExtensionRulecom.ibm.uml2.wsdl.binding.extension.TestBindingBindingExtensionRuleclass must extendcom.ibm.xtools.transform.uml2.wsdl.util.AbstractBindingExtensionRulecom.ibm.uml2.wsdl.binding.extension.TestBindingBindingOperationExtensionRuleclass must extendcom.ibm.xtools.transform.uml2.wsdl.util.AbstractBindingOperationExtensionRule
- Right-click on
src\com.ibm.uml2.wsdl.binding.extensionfolder and select Import - In the Import dialog, replace
type filter textwithfile. Then select File System under General, as shown in Figure 18.
Figure 18. Select File System as the import type
- Click Next
- Browse to the location of Java™ files (see the download section for Java files) and select only the Java files as shown in Figure 19.
Figure 19. Import rules implementations
- Click Finish and take a moment to review the imported Java files (see Figure 20).
Figure 20. Import rules implementations
Test the transformation extension
In this task you will test the transformation plug-in in a separate Eclipse workbench. You will import the test UML model that you used to run the UML-to-WSDL transformation, and you will be able to compare transformation results.
- Select the
com.ibm.uml2.wsdl.binding.extensionplug-in project and then, from the toolbar, select Run > Debug. - Double-click the Eclipse Application in the Run Configuration dialog, and change the name of the configuration to
Transformation Extension Launch.Leave the rest of the default settings as they are. - Click Debug (see Figure 21). This will launch a new Eclipse workbench.
Figure 21. Set the launch configuration
- On the Welcome screen, click the curved arrow icon with the yellow point
to go to the workbench. - Switch to the Modeling perspective.
- Select File > Import.
- In the Import dialog, replace "
type filter text"withproject. Then select Project Interchange under Other, as shown in Figure 22.
Figure 22. Select Project Interchange as the import type
- Click Next.
- Click Browse and then navigate to the location of the TestUML2.zip file, and select the
TestUML2.zipfile that you exported in previous task (you can download it from the download section in case you have not exported your project in Task 1). Click Open. - Click Select All.
- Click Finish.
- Double-click the
WSDLconfig1.tctransformation configuration to open it. - Right-click the
WSDLconfig1.tcin Project Explorer and select Transform > UML to WSDL. - Take a moment to review the changes between the regular transformation result and the extended transformation result in the Transformation Merge dialog. Notice that the binding is changed to
SOAP-Document-Literaland the SOAP address is also added (see Figure 23).
Figure 23. Compare transformation results
- Click the first arrow icon in the middle of the dialog: Copy All from Left to Right.
Figure 24. Accept the changes
- Click OK twice to save the changes.
Figure 25. Save the changes
Now, your WSDL files have been generated and are ready for editing.
Special thanks to Dmitry Gorelik, Lee Ackerman, Aaron Allsbrook, and Jim Conallen for their support and contributions.
| Description | Name | Size | Download method |
|---|---|---|---|
| Simple Project | extend_uml_wsdl_inputs.zip | 9KB | HTTP |
Information about download methods
Learn
- Read an article on Transformation to SOA: Part 3. UML to SOA by Dmitry Gorelik (IBM developerWorks, January 2008)
- Learn how to extend the UML-to-WSDL transformation
- Learn about the SOAP over JMS provider
- Read the article, Which style of WSDL should I use?, by Russell Butek (developerWorks, May 2005)
- Find out about the Charter of the W3C SOAP-JMS Binding Working Group
- Read about Using SOAP headers with JAX-RPC by Andre Tost (developerWorks, October 2003)
- Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
- Explore Rational computer-based, Web-based, and instructor-led online courses. Hone your skills and learn more about Rational tools with these courses, which range from introductory to advanced. The courses on this catalog are available for purchase through computer-based training or Web-based training. Additionally, some "Getting Started" courses are available free of charge.
- Subscribe to the Rational Edge newsletter for articles on the concepts behind effective software development.
- Subscribe to the IBM developerWorks newsletter, a weekly update on the best of developerWorks tutorials, articles, downloads, community activities, webcasts and events.
- Browse the technology bookstore for books on these and other technical topics.
Get products and technologies
- Download trial versions of IBM Rational software.
- Download these IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Tivoli®, and WebSphere®.
Discuss
- Check out developerWorks blogs and get involved in the developerWorks community.

Sefa Sevtekin is a senior solution architect in IBM Rational Software Services Group. He's been working with customers on implementing Model Driven Achitecture (MDA) using IBM Rational Tooling.He has delivered various international seminars, workshops, techinal articles, customer trainings, and consulting services.
Comments (Undergoing maintenance)





