6 Replies Latest reply on Jul 8, 2019 2:17 PM by Damir Dev

    bpel invoke any web service over soap

    Damir Dev



      SOA Suite 11g


      I have composite, where

      1. One service (soap) "InputService"

      2. One bpel "Universal" (receive ReplyToAddress_1)

      3. One reference (soap) "OutputService_1" (invoke with endpointURI from ReplyToAddress_1)


      It looks like that

      "InputService" with ReplyToAddress_1 -> "Universal" (make xml transform) -> "OutputService_1" (wsdl_1) with endpointURI from ReplyToAddress_1


      For future reference will be change to another service (with another wsdl, binding port etc) instaed "OutputService_1", for example

      "InputService" with ReplyToAddress_2 -> "Universal" (make xml transform) -> "OutputService_2" (wsdl_2) with endpointURI from ReplyToAddress_2


      Well, I want to make a universal bpel, if it will change reference from "OutputService_1" to "OutputService_2", I change xml transform only.

      Guess, I should create a common reference like "AnyOutputService" (wsdl with root element anyType) instead "OutputService_1" and "OutputService_2".

      But how is it possbile? How is it ignore binding port and etc? Any idea?

        • 1. Re: bpel invoke any web service over soap
          Martien van den Akker



          ..wsdl with root element anyType...


          You cannot have a WSDL with a message that is based on any type. What you can do (and what I'm currently doing on my current project for a MessageDispatcher) is to create a generic MessageEnvelop xsd. This allows you to have a Message header with several properties that you can use to base your routing/dispatching on. That MessageEnvelop can have a Payload element that is of AnyType.


          Base a WSDL on that xsd. And you're good to go.


          If the Exposed Services of the OutputService_1 and OutputService_2 are based on that same wsdl, you just have to set the endpointURI property on the Invoke.


          • 2. Re: bpel invoke any web service over soap
            Damir Dev

            Wsdl's for OutputService_1 and OutputService_2  is too different. And I don't want to delete old and create new reference in a composite every time, I want to change xslt transform only.

            I guess this problem can be solved over some properties or java embedding...

            • 3. Re: bpel invoke any web service over soap
              Martien van den Akker

              Having dynamically call the services requires that the wsdl is exactly the same. Then you only have 1 reference in the composite. If you have them both in the composite, then you need to switch between them. You could use the Mediator component for that with a filter. Actually, the Mediator is exactly designed for precisely this purpose. But SOA Suite requires that your invoke or Mediator route matches the WSDL. And that each reference is wired properly.


              I can't see how you could change the binding and the complete reference of a partnerlink/reference using properties or java. And actually, I would strongly discourage that. But it seems to me that you should use the Mediator.


              I assume that now your universal bpel calls the OutputService_1 directly. Now, add a mediator component. Call it something like OutputServiceRouting. Then whire OutputService_1 to Mediator and replace the wire from bpel to OutputService_1 with a wire to BPEL and the OutputServiceRouting mediator. Then you can add OutputService_2 to the mediator component and add a routing rule that based on a filter expression route and an other xslt routes to OutputService_2.



              • 4. Re: bpel invoke any web service over soap
                Damir Dev

                Hi Martien!


                I created and added to composite special wsdl and then I created reference for this wsdl. As result, I have one reference "CommonOutputService" only with poroperty

                      <property name="weblogic.wsee.wsat.transaction.flowOption"

                                type="xs:string" many="false">NEVER</property>

                instead OutputService_1, OutputService_2 and etc.


                So, It looks like that

                "InputService" with ReplyToAddress -> "Universal bpel" -> "CommonOutputService" (CommonOutputService.wsdl) with endpointURI from ReplyToAddress


                Then in bpel

                1) I created xslt for target Web Service's shcema

                2) I added assign (in Assign Activity) xslt to CommonOutputService's input variable with property

                      <copy keepSrcElementName="yes">

                for root eleemnt saving from xslt

                3) I added Invoke Activity to CommonOutputService with enpointURI from ReplyToAddress


                Well, it works! So, if it will change target web service, I change a xslt only or modify a xslt to more common and universal.


                Martien van den Akker wrote:


                ... and what I'm currently doing on my current project for a MessageDispatcher...



                Can I join to your project? ;-)

                • 5. Re: bpel invoke any web service over soap
                  Martien van den Akker

                  If I read correctly, this is more or less what I suggested in my first answers...

                  • 6. Re: bpel invoke any web service over soap
                    Damir Dev

                    Not really, Matrien.

                    Because, you recommend to use a mediator for routing to few references like OutputService_1, OutputService_2 etc.

                    But I created one common reference only without mediator and I invoked this reference directly over property "endpointURI".

                    So, if consumed web service with wsdl will be change, I edit xslt and ReplyToAddress value only.