cancel
Showing results for 
Search instead for 
Did you mean: 

BPM steps for multiple calls to a webservice

Former Member
0 Kudos

Hi,

We have a scenario where an outbound proxy call is made to webservice. The webservice then returns data as part of the standard webservice response. Now based on the success/ failure string in the response message, we need to make a second webservice call which again is a synchronous call. My approach is to use the following steps:

Recieve (Aysnc) ->Transform -> Send (Synch) -> Send (Sync)- Send(Async)

Transform step is to validate success/failure, for now I would like to keep this optional. I want to make multiple calls first.

Final response is sent back to ECC via proxy (Although its still not decided yet). To accomplish the above steps, the problem that I see is with respect to the second sync webservice call.

I know a Sync-Async bridge scenario where we make the sync call, get the response and then pass that response to a target service.

In my case, my second webservice call has structure that is completely different from the first i.e., I am not taking the first response and then constructing a synchronous call. My first question is

1) Is this achievable with BPM. If yes, what would my steps in ESR and IB be ?

Note: The second proxy call will have data that is totally independent of the first call. The first call is just make sure user authentication goes through. Second call will contain the actual data. Any thoughts/ suggestions would be appreciated.

Thanks,

Ravali

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

Hi,

I had done a similar ccBPM some time ago. My case was that PI should call two webservices in such a manner that data would be sent to the first webservice synchronously & then to the second webservice. The response of second webservice would be routed to the Sender system. However I was having file of multiple records at sender & I had to pick one record each time, so I had to use forEach within a block as shown:


If you don't have to pick up single records out of multiple, then you can have a block of type 'Default'. As far as steps of ESR & ID are concerned, the steps would be like:

1. Sender Agreement, Receiver Determination, Interface Determination from Sender System to Integration Process(BPM). No Rec Agreement required. Here for Receiver Service Interface(Abstract Async) you will specify the Interface which you have provided in first receive step in BPM.

2. From Integration Process to Two webservices,you have two synchronous service Interfaces(Abstract) so two separate Receiver Determinations,Interface Determinations, Receiver Agreements from BPM to the two webservices.

3. From BPM to Sender System, the response(Async Abstract) would be sent corresponding to the last step. For this have a receiver determination, Rec agreement & Int determination.

However, here the case was such that the same data was getting posted to both the webservices. Please let me know if your requirement is different from this one.

Former Member
0 Kudos

Hi Adarsh,

I have done File-RFC-File scenario using Sync-Async bridge, but my scenario is something that goes along the lines of extending that. So here is how it goes.

1) Call the first sycn service with username/password info.

2) Response from first service will contain success/ error info.

3) Based on success/ error info, call the second webservice(synch call). This second service will contain user email address info which gets registered with the service. So the structure will contain fields like <user> and <email>

4) Now I need to take the final response of this second webservice call and send it across back to SAP using a proxy call.

I am fairly clear regarding steps 1,2 and 4 since I have done scenario where I can make sync call and grab the response and send it across. My question is pertaining to the third step. How do I make the second webservice call with dynamic information(user/email). Do I have to save persist that info in the first receive step ? How do I construct the request for the second webservice call ?

My approach is the following:

1) Receive - send(sync) -> send(sync) -> send (async)

I can probably put a condition in the second/ third synch step to check for the success flag and then only call the third receiver ? but assuming it is a success scenario, how do I construct the third xml message ? Any suggestions regarding this ? Am I on the right track ?

Thanks,

Ravali

former_member184789
Active Contributor
0 Kudos

Hi,

Could you explain as to what should be done if the call in third step is a failure. I did one more BPM in which I had two types of response to be sent to the original Sender system, based on successful or unsuccessful call to the webservice. I used a fork & container for that in such a way that if the call is successful, then the value of variable in container is changed from 0 to 1. This step of calling webservice was followed by step of successful response to Sender. All these steps were in one branch of fork. The other branch of fork had only one step, which would be executed in case if the value of container variable is not changed to 1, which means there was some error in calling the webservice which is why the value is not changed. In this branch of fork I had the response which would denote an unsuccessful call.

Former Member
0 Kudos

Hi Anish,

Thanks for the prompt response. If the third call fails, the idea is to send out an alert email just like any other Async failure scenario. So we encapsulate that in an exception block and I believe that will trigger the alert. Correct ? If it succesful, obviously an application data needs to be sent back to SAP using proxy.

But my question is, how do I formulate the third request to the webservice ? I could possible get <usercredentials>,<username>, <email> in the first receive step, but how do I use the data from the fields <username> and <email> in a later send step inside BPM. Any thoughts or suggestions will be appreciated.

Thanks,

Ravali

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Below are the steps required in BPM.

Note - please ignore the content which was in black color.

1. Receive step - it will receive the request payload from the proxy

2. Transformation Step - mapping between proxy request message type and first webservice request message type.

3. Send Step - It will make the first webservice call with the output of above transformation step.

4. Switch Step - it will validate the response received from the first webservice call. If it is a valid response, it will invoke the block-1.

5. Transformation step in block1 - During mapping in this step, select source message type as your request payload or response of your first webservice and target message type as second webservice request structure.(This will answer your confusion on using the output of second webservice)

6. Send Step in Block1- Invoke the second webservice with the output of above transformation step.

7. Transformation step in Block1 - In this step, map the response of second webservice to the response structure of proxy.

Regards,

Veerendra.