cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous Interafce

Former Member
0 Kudos

Hello All,

I have a synchronous Proxy - WS interface, i have a requirement where in the response mapping i have to send the number which is coming in the request message. Means i have to save some values in request mapping and somehow retrieve the same while sending the reponse back to proxy.

Please guide me how to proceed further.

Regards!!

Vasant

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

This requirement can be achieved using mutiple designa

1)Creating a table in RFC and store the value while sending request to Web service , in response mapping perform rfc look up to retrive the value and send back to Proxy.

2)Request your web service team to add one more field  in response structure and ask them to send the number which is coming in the request message ,this is very much possible and good design.

3)ECC it self store the value at the time of sending a proxy request and write a logic in proxy to take the value once you receiver response from web service.this is also good design.

4)Same as 1st design but use JDBC look and ceate JDBC table in oracle data base.

Regards,

Raj

Former Member
0 Kudos

Hello,

Client is reluctant to change the WS so i have to do it in PI.

I am thinking of using RFC lookup but i am not sure what will be the input to RFC lookup in response mapping so that it can return me the same number which is coming in the request.

Let me give you a brief background:

The response from WS will be empty if in case the execution of message is sucessful in receiver system then in PI i have to map the number (which is coming in the request) and send it back to the sender application.

Regards!!

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Vasant,

   Take help from ABAPer,

1)Create a table in ECC and create one function module.

2)Function module should have logic like take number and one flag from input and both should be optional.

3)first request mapping  send the number which is coming in the request message as a input and the logic in function module should be to save the value and response should be success. and supress the response in mapping.

4)Response mapping send flag value X as a input and function module return value which is stored in first RFC lookup(request message look up) and replace value with blank.

I hope you are clear.

Regards,

Raj

Answers (2)

Answers (2)

former_member201264
Active Contributor
0 Kudos

Hi Vasant,

You can do this by using Function Library concept.

Step1.

In Function library you have to create two methods as below (Similarly).

setID_Method: Method to set the data to File for that field(This is required to persist the data between mappings).

getID_Method: Method to get the data from File: (This is used in response mapping):

Then go to your REQUEST MAPPING, set the  value to a file while mapping any other field as below:

Now come to RESPONSE Mapping, and call that method from Function Library as below:

Then TEst the mapping you will get your business requirement:

Regards,

Sreeni.

Former Member
0 Kudos

Hello Sreeni,

Your answer is very helpful!!

But can you please share the getId method code also?

Regards!!

former_member201264
Active Contributor
0 Kudos

Hi Vasant,

Its there in the in my reply at second screenshot.

Regards,

Sreeni.

Former Member
0 Kudos

Hello Sreeni,

Sorry for the late reply.

The second screen shot which you have showed above is depicting the code for "SetId" method but i want to check the code for "GetId".

I have one more question, the "data.txt" file is created and placed on PI file system?

So i think its file path should be something like "usr/sap/DPI/SYS/src/Data.txt" ?

Regards!!

former_member201264
Active Contributor
0 Kudos

Hi Vasant,

Sorry I though the second scereen shot for getID_Method.

Please find the same here now as below one:

Moreover, you have to persist the data between mappings, so i have given this idea to use temp file. The system will take the default directoty automatically.

Regards,

Sreeni.

nabendu_sen
Active Contributor
0 Kudos

Hi Vasant,

I think the solution provided by Raja and Baskar have very less risk and would be more close Best practices compare to writing the files in local PI folder.

Risks:

1. If tomorrow this type of requirement again arises and another developer uses the same File name it will create mess.

2. For any IO exception debugging part is more difficult.

3. In Production environment this type of solution is very risky.

former_member201264
Active Contributor
0 Kudos

Hi Sen,

I aggee with you .. But something is better than nothing if client ristrict in all possible ways.

Better approch is from Reddy points 2 and 3.

Regards,

Sreeni.

nabendu_sen
Active Contributor
0 Kudos

Hi Sreeni,

Sorry but I can not totally agree on this. I have never seen a single client who would agree to go this type of solution if you inform these risks, may be it happend only for me. In a project, its our responsibility to find out the risks and come up with better solutions. If its going to be more time taking or need development from other team, they will agree, trust me.

Former Member
0 Kudos

Hello All,

I am having PI7.3 Java only isnatllation.

Regards!!

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Your pi version supports RFC or JDBC lookup. Use either one in the request mapping to save. Use the same in the response mapping to retrieve to send back to proxy.   This is better approach.

Another approach is writing in the file and read it for retrieve. This requires UDF coding. if you want to proceed in that direction you can see this link

http://wiki.sdn.sap.com/wiki/display/XI/File+Lookup+in+UDF