Search code examples
web-serviceswsdlesbbpelopen-esb

OpenESB CASA: Multiple operations in single WSDL


I have a series of webservices endpoints that provide basic CRUD operations on my entities. For instances, take these WS methods: userService?wsdl --getUser(id) --getUsers --addUser(User) --removeUser(id)

I would like to create a CA on OpenESB to provide a single proxy endpoint to all these operations.

So what I do is create a new BPEL module on NetBeans, then I add a new WSDL document which will be my descriptor. I then add multiple operations to this WSDL.

Then I create a BPEL for each operation implemented in my backend WS.

This effectively gives me a resulting output WSDL with multiple operations.

The problem comes when adding this BPEL module to my CA; When linking a Port to a PartnerLink I can only do it once per Port. You can see it more clearly on this screencap:

enter image description here

I can only trace one "arrow" from aulaServicesPort to a single PartnerLink, while I would need to link it to both operations shown on the screenshot.

This result in multiple WSDL, one for each operation while I would like to create sort of a "hub" WSDL including all related operations (in my previous example, that would be a User CA with all given operations)


Solution

  • I don't think you can solve that in the CA, but you could probably solve it by modifying the BPEL process.

    The best way to achieve this in the current structure is to reduce your application to a single process, with only one myRole partnerLink. This means that instead of having multiple processes with receive/reply pairs, you should build one process with an intial pick and multiple parallel branches. The rough structure looks like this:

    <pick name="ServiceSelector" createInstance="yes">
    
         <!-- Each onMessage replaces one of your original processes -->
         <onMessage partnerLink="aulaLink" operation="getAula" portType="aulaServicesPortType">
             <sequence name="Sequence">
                  <!-- call the actual service for getAula-->
                  <reply name="ReplyToGetAula" partnerLink="aulaLink" operation="getAula" portType="aulaServicesPortType"/>
             </sequence>
        </onMessage>
    
         <onMessage partnerLink="aulaLink" operation="getAulas" portType="aulaServicesPortType">
             <sequence name="Sequence">
                  <!-- call the actual service for getAulas-->
                  <reply name="ReplyToGetAula" partnerLink="aulaLink" operation="getAulas" portType="aulaServicesPortType"/>
             </sequence>
        </onMessage>
    
    </pick>