Tuesday, August 30, 2011

Exposing MDM Business Proxy as Webservice

It has been a while I was thinking about writing a post on exposing a composite transaction(BP) as webservice.I know this had been a reason for concern for people who are still using the MDM workbench prioir to9.x

1. Created a custom business proxy say AddCustomerBP.java - addCustomer
2. Create the equivalent transaction(provide appropriate request and response) in a new MDM Module  using the exact same names as your BP transaction name (addCustomer)  and generate the code.

This will generate the usual 5 projects:
***BPModule
***BPModuleEJB
***BPModuleWS
***BPModuleWSEJB
***BPModuleWS_HTTPRouter

3. Insert the generated lines from ***BPModule_DWLCommon_extension.properties into the appropriate properties files in Customer resources.
 a)Update DWLCommon_Extension.properties with the request parser & response constructor generated.
 b)Update tcrm_extension.properties with  converters.
4. Delete/Close the projects :
***BPModule
***BPModuleEJB
5. Add com.ibm.ws.webservices.thinclient_6.1.0.jar to the projects.
6. Check the J2EE Dependencies (see project Properties) for your WSEJB project and ensure that they include all the WS projects which it depends on directly or indirectly - this is probably: 
PartyWS,
FinancialServicesWS,
BusinessServicesWS,
DWLBusinessServicesWS,
DWLCommonServicesWS
7. Modify the properties for the WS project:
Right-click the client WSproject, and select Properties.
Select Java build path.
Click the Libraries tab.
Click Add Variable.
In the New Variable Classpath Entry dialog, select WAS_50_PLUGINDIR from the list.
Click Extend.
In the Variable Extension dialog, expand the lib folder.
Select the following five JAR files by holding the CTRL key as you make your selections:
commons-discovery.jar
commons-logging-api.jar
qname.jar
webservices.jar
wsdl4j.jar
8.  Identify the correct port which it gets bind.
9.  Verify whether your WS projects are deployed to MDM Deployment Descriptor file.
10. Disable serurity.xml files
11. Verify the RouterService Definition points to the respective project HTTPRouter in xml-ws-bind-xmi
Reference:
Here goes an excellent post which helps you in accomplishing the same.

Thanks Catherine & Roshni for the detailed explanations.