cancel
Showing results for 
Search instead for 
Did you mean: 

Sync message split to (1) sync Soap and (2) async Idoc receiver

che_eky
Active Contributor
0 Kudos

Hi All,

System: PI 7.4 dual stack

What are the options for splitting a Sync Soap message so that (1) first message goes to Soap receiver with response back to sender (2) second message goes to Async Idoc receiver.

- I believe this could be done using a BPM but want to avoid using a BPM

- Alternatively is there some way to write the original Soap message to a file (via a UDF perhaps?) which will then trigger the second Async interface to create an Idoc? if so how?

- Some other way to do this?

Che

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Che,

What you can do is :

  • Interface# 1 --> Build a SOAP to SOAP synchronous scenario -> This will be for the Synchronous flow which receives your input synch SOAP Message.
  • Interface# 2 --> Build a SOAP to IDoc Scenario ( Asynchronous ) -> This will be triggered using the SOAP Lookup API from the Message Mapping of above flow.
  • In the request message mapping of Interface#1->
    • Write a UDF that pushes the entire Request XML message to a SOAP Receiver Channel of PI using the SOAP LookUp API.
    • The SOAP Receiver will contain the URL that points to the SOAP Sender of Interface#2

No BPM and two independent flows linked using a SOAP LoopBack Concept!

Regards,

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

This is what the design i proposed would look like!

che_eky
Active Contributor
0 Kudos

Hi Bhavesh,

That looks super useful, great tip. I did find references to Soap Lookup but did not know it was that straight forward. How would you pass the entire Request XML message to the Soap Lookup? The examples I have seen are based on WebService calls where the request XML message is built in the UDF itself.

Che

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Che,

  • To get the entire XML you can use the function : return as XML as shown in this blog :
  • This would then be the input to your UDF where the entire XML is persisted into a single variable.
  • Then you can use the SOAP LookUp concept as I have described in this blog of mine:

Regards,

Bhavesh

former_member187447
Participant
0 Kudos

Hi Bhavesh,

Have you tested this by sending an async message to the SOAP receiver, as I am testing the SOAP API in the message mapping, I see it is expecting a response back because of the accessor class. Please let me know your thoughts if you haven't tried. If it can be achieved by tweaking the SOAP API in some way.

Regards

Kalyan.

bhavesh_kantilal
Active Contributor
0 Kudos

Hello,

I dont remember if i did this but if you are making a Asynchronous call, make sure

  • In the SOAP Sender Adapter, you have selected the QOS as Exactly Once
  • In this case, the system will then return a HTTP 200 with a empty payload. This will then move on to the next line of code in your UDF..

Regards

Bhavesh

former_member187447
Participant
0 Kudos

Thanks for the response. But first the call is made to the receiver and there is no option for that. Do you mean the Target URL in the receiver which is pointing to the SOAP sender . Is that the SOAP sender you refrerring to which has to QOS as Exactly Once?

Regards

Kalyan.

bhavesh_kantilal
Active Contributor
0 Kudos

yes make sure your QOS in the sender adapter has exactly once.

generate the wsdl for this soap sender channel and then ise the SOAP url from this in the receiver channel.

the point I don't remember is will the url contain a QOS parameter. This will be known when your generate the wsdl and examine the url in the same.

former_member187447
Participant
0 Kudos

Hi Bhavesh,

I have the receiver channel configured with the sender channels SOAP URL as following and also tested in browser which shows "Message servelet status is in OK" But it is throwing an error when the UDF pushes the request to the receiver channel saying the Unable to create socket.

http://xxxxxxx:xxxx/XISOAPAdapter/MessageServlet?senderParty=&senderService=XXXXXXX&receiverParty=&r...

Is there anything that I could be missing here?

The following is my UDF

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Kalyan,

Things to check

- Make sure the request sent via the SOAP UDF is a Valid XML.

- Check if the request reaches the SOAP Sender channel?

- Make sure SOAP Receiver Channel has the user name password etc maintained.

- Check if the request hits the SOAP Sender channel or fails directly in the SOAP Receiver. If SOAP Receiver, make sure the URL is pointing to a http://localhost:port rather than the PI server name as it might not be resolvable to the PI Server. Make sure the user / password of your PI system is mainained.

- Did you test the other SOAP Sender scenario with SOAP UI with this payload? Does it work?

Would suggest a new thread for this so you get more responses if this does not help. At this moment, this question is not relevant to this thread.

Regards

Bhavesh

former_member187447
Participant
0 Kudos

Hi Bhavesh,

May be I will open a separate question as the message is failing in SOAP receiver and I even tried it with localhost for the url and I am still getting the same error in the channel about unable to create a socket.

Regards

Kalyan.

0 Kudos

Hi Bhavesh,

you have a graphic example of what you indicated.

Best regards

Umberto

Answers (4)

Answers (4)

apu_das2
Active Contributor
0 Kudos

Hi Che/Bhavesh,

Was not the requirement like -  only after sender of interface 1 receiving response data will be sent to an IDOC ?

If SOAP Look up is done from the request MM of first interface then how is it guaranteed. Here -

Data will be sent to idoc first I think here.

It can also happen that data is sent to idoc but not to soap receiver of 1st inteface.

Thanks,

Apu

bhavesh_kantilal
Active Contributor
0 Kudos

Apu,

SOAP Lookup can be done in either the Request Mapping or in the Response mapping. Obviously there are certain trade offs to be considered and among those in terms of resubmissions , error handling etc!

For the requirement that the original poster had asked for this seems to suffice,i.e, the original Synchronous message should be branched to 2 receivers.

For dependent or independent processing is not asked and if there is a dependent processing you cannot escape a BPM but considering it has been marked closed I assume it is independent processing!

Regards

Bhavesh

apu_das2
Active Contributor
0 Kudos

Hi Bhavesh,

Absolutely, I saw that its closed . Just tried to understand how its fulfilled the requirement as requested before so wrote to you. For ensuring all short coming we need to incorporate BPM here anyhow.

The process you have mentioned is definitely a brilliant one. Even we can apply this for other more or less same requirements as well . But for this there are shortcomings for sure -

  1. Calling from request dont ensure that it will pass to first soap receiver.

  2. Even if we call from response dont ensure that insertion into the idoc will be successful. But definitely if we call from response that will make more sense here. If SOAP look up will fail or SOAP look up successful but response back to the 1st sender fail can be handled through triggering message again and proper duplicate handling in receiver end.

By the way, if the requirement is fulfilled it absolutely fine and thanks a lot for clarification.

Thanks,

Apu

bhavesh_kantilal
Active Contributor
0 Kudos

Hello Apu,

your concerns are defijntely valid. If the requirement is for a guaranteed delivery with exactly once QOS there are definitely flaws in this design and the one you have pointed out is valid.

while PI does not support them, there are other QOS in the integration space that is supported by other middlewares,

  • utmost once - what this QOS means is that the middleware should send the message a maximum of one time. If it fails, it fails. No restarts etc. Something like our best effort.
  • atleast once - what this QOS means is the middleware should send the message minimum once and can resend the same Message any number of times.

What I am trying to say is in the context of this requirement, it could Satisfy both of these QOS and maybe that is the requirement   it is not explicit and I assume that it is . For pure exactly once where no duplications allow your concerns are valid.

hope this clarifies..!

che_eky
Active Contributor
0 Kudos

Good suggestions from both Bhavesh and Raghuraman. Will wait for a response from Praveen as a split in the adapter would be ideal but not sure if this copes with a sync sender.

bhavesh_kantilal
Active Contributor
0 Kudos

As far as I know, the modules are used to convert a asynch request to a synch request and then direct the response to another interface.

What happens if the request itself is synchronous to the Original calling application? Well its pretty interesting and something I haven't tried. Interesting option I must admit though!

Regards,

Bhavesh

former_member182412
Active Contributor
0 Kudos

Hi Che,

You can include two receivers in the receiver determination step one for web service and other one for IDOC receiver.

The first interface do async to sync bridge using modules in the receiver soap adapter. Response message you can send it to original sender.

I have actually one interface which uses async-sync bridge with modules in receiver channel, i added another receiver and send the same message via receiver file adapter and it is working, i have tested in my system.

You can check this blog for async-sync bridge

Regards,

Praveen.

che_eky
Active Contributor
0 Kudos

Hi Praveen,

My scenario starts with a Sync interface not Async as in your example. I really like the idea of using Adapter modules, will this concept work in my case?

Che

iaki_vila
Active Contributor
0 Kudos

Hi Che,

You have sync-async cases in these links:

http://saprainbow.com/wordpress/wp-content/uploads/2015/06/AsyncSync_and_SyncAsync_Bridge_without_BP...

If you use the IDOC_AEE instead the IDOC ABAP adapter, it should works.

I was/am abaper and i like solutions with ABAP code involved, i am faster. If you do a SOAP - PROXY scenario, you can control inside the proxy the call to the its IDOC and to call a second scenario with a SOAP receiver, with all the error control that you want to.

Regards.

che_eky
Active Contributor
0 Kudos

Hi Iñaki,

Good to hear from you. You are right a Proxy could handle this scenario, controlling both the sync and async interfaces. I will certainly keep this solution in mind, thanks!

Che

former_member186851
Active Contributor
0 Kudos

Hello,

So you scenario is like

                                    |-----------------------------------Soap

                                    |

Soap-----------------------|

                                    |

                                    |

                                    |-----------------------------------IDOC

You can try refering the below link and write it as file in some directory

BufferedWriter (Java Platform SE 7 ).

Then second scenario will be File--PI--SFTP.

Any stopback for using BPM?

che_eky
Active Contributor
0 Kudos

Hi Raghuraman,

It is more like this:

Soap<----------sync------------> PI <---------------sync-------------- >Soap

                                           |

                                           |------------------async-------------->IDOC

Stopback for BPM is to try getting away from the Abap stack.

How would the BufferedWrite work? I mean what would I pass as input to the UDF, would i have to use the function "Return As XML" and pass the payload as a string which can then be written to file?

Thanks

former_member186851
Active Contributor
0 Kudos

Hello Che,

Yes,you can use return as XML and buffered writer will write in the target directory mentioned.

You can try the approach suggested by Bhavesh as well,Seems interesting.