Creating custom bindings for UML-to-WSDL transformations

You can customize existing bindings or create bindings that the UML-to-WSDL transformation uses to generate WSDL artifacts.

Before you begin

The following procedure assumes that you know how to create, test, and distribute plug-ins, and that you are familiar with the Eclipse Plug-in Development Environment (PDE).

You must be in the Modeling perspective.

Procedure

  1. Create a plug-in project in the Eclipse workspace. This plug-in project will contain the implementation of the custom binding.
  2. In the plugin.xml file of the plug-in, create the following extension point:
    <extension point="com.ibm.xtools.transform.core.transformationExtensions"></extension>
  3. In the extension point, create a TransformationExtension element that contains the following information:
    <TransformationExtension version="7.0.0" 
    	name="MY-NEW-BINDING binding extension" 
    	enabled="true"  
    	targetTransformation="com.ibm.xtools.transform.uml2.wsdl.internal.Uml2WsdlTransform.RS" 
    	id="com.ibm.xtools.transform.uml2.wsdl.extension.MY-NEW-BINDING">
  4. In the TransformationExtension element, create a property that contains the following information:
    <Property 
    	id="com.ibm.xtools.transform.uml2.wsdl.bindings.MY-NEW-BINDING" 
    	metatype="string" 
    	name="com.ibm.xtools.transform.uml2.wsdl.bindings" 
    	readonly="true" 
    	value="MY-NEW-BINDING"/>
  5. In the property that you created in the previous step, define the following rules:
    <RuleDefinition 
    	class="org.someuri.MyAddressExtensionRule" 
    	id="MyAddressExtensionRule" 
    	name="MyAddressExtensionRule"/>
    <RuleDefinition 
    	class="org.someuri.MyBindingExtensionRule" 
    	id="MyBindingExtensionRule" 
    	name="MyBindingExtensionRule"/>
    <RuleDefinition 
    	class="org.someuri.MyBindingOperationExtensionRule" 
    	id="MyBindingOperationExtensionRule" 
    	name="MyBindingOperationExtensionRule"/>
  6. In the TransformationExtension element, create the following ExtendTransform elements:
    <ExtendTransform 
    	targetTransform="AddressExtensionTransform"> 
    	<AddRule id="MyAddressExtensionRule"/>
    </ExtendTransform>
    <ExtendTransform 
    	targetTransform="BindingExtensionTransform">
    	<AddRule id="MyBindingExtensionRule"/>
    </ExtendTransform>
    <ExtendTransform 
    	targetTransform="BindingOperationExtensionTransform">
    	<AddRule id="MyBindingOperationExtensionRule"/>
    </ExtendTransform>
  7. Click File > Save. The next time that you open the transformation configuration file, the Properties page of the Transformation Configuration editor displays the property that you created in steps 4 and 5.
  8. For each class that you define in step 5, create the corresponding Java™ class in the plug-in that you create in step 1. The Java classes that you create must extend the corresponding abstract classes, and implement the corresponding abstract methods in the com.ibm.xtools.transforms.uml2.wsdl.utility plug-in. Consider the following example:
    • The org.someuri.MyAddressExtensionRule class that you define in step 5 must extend the AbstractExtensionRule class in the com.ibm.xtools.transforms.uml2.wsdl.utility plug-in.
    • The org.someuri.MyBindingExtensionRule that you define in step 5 must extend the AbstractBindingExtensionRule method.
    • The org.someuri.MyBindingOperationExtensionRule class that you define in step 5 must extend the AbstractOperationExtensionRule method.

Results

The next time that you open the transformation configuration file, the WSDL Options page displays the new binding. You can now specify that the UML-to-WSDL transformation use this custom binding.

Feedback