GenericParallel Primer: Calling Multiple Services

Fafu4oN

This is the shortest guide for making an OSB parallel call with GenericParallel.

I assume the GenericParallel service is already deployed on your domain.

(If not, here’s the guide.)

All you need to do then is to call the GenericParallel entry proxy located at GenericParallel/GenericParallel path. The entry proxy takes a list of requests to execute.

For example, collecting the monthly bill for electricity and heating may look like this:

<typ:GPS xmlns:typ="http://genericparallel/types">
  <typ:Requests>

   <typ:Request GPSTarget="Billing/Electricity">
     <GetMonthlyBilling>
       <Period>2012/02</Period>
       <AccountNo>12345678</AccountNo>
     </GetMonthlyBilling> 
   </typ:Request> 

   <typ:Request GPSTarget="Billing/Heating">
     <RetriveCharges> 
       <Period>2012/02</Period>
       <AccountNo>56789012</AccountNo> 
     </RetriveCharges> 
   </typ:Request> 
  
  </typ:Requests> 
</typ:GPS>

GenericParallel takes the content under each <Request> element as a request body, and then calls a proxy service under the path specified in the GPSTarget attribute – in parallel.

Then it assembles the responses and returns the combined message to the caller, like this:

<types:GPSResponse xmlns:types="http://genericparallel/types">
  <types:Responses>

    <types:Response GPSIndex="1" GPSBatchIndex="1">
      <soap-env:Envelope>
        <soap-env:Body>
          <GetMonthlyBillingResponse>
            <Amount>35.50</Amount>
          </GetMonthlyBillingResponse>
        </soap-env:Body>
      </soap-env:Envelope>
    </types:Response>

    <types:Response GPSIndex="2" GPSBatchIndex="1">
      <soap-env:Envelope>
        <soap-env:Body>
          <RetriveChargesResponse>
            <Charges>35.50</Charges>
          </RetriveChargesResponse>
        </soap-env:Body>
      </soap-env:Envelope>
    </types:Response>

  </types:Responses>
</types:GPSResponse>

All that is left to do for you is use the responses. And yes, you may forget about split-join horrors now.

If you want to learn more, feel free to try GenericParallel.

Vladimir Dyuzhev, author of GenericParallel

About Me

My name is Vladimir Dyuzhev, and I’m the author of GenericParallel, an OSB proxy service for making parallel calls effortlessly.

I’m building SOA enterprise systems for clients large and small for almost 20 years. Most of that time I’m working with BEA (later Oracle) Weblogic platform, including OSB and other SOA systems.

Feel free to contact me if you have a SOA project to design and implement. See my profile on LinkedIn.

I live in Toronto, Ontario, Canada.  canada   Email me at info@genericparallel.com


Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*