cancel
Showing results for 
Search instead for 
Did you mean: 

modify http response message to sender

Former Member
0 Kudos

Hi,

I have a scenario wherer the sender system sends message to XI through HTTP and XI has to send back a HTTP response in the same session. This HTTP response message has to be modified according to the data received.

Any suggestions on how this can be done ?

Thanks

BHarath

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

You would be having Synchronous Interfaces defined.....Develop a Request Message Mapping and a Response Message Mapping

In the Response MEssage Mapping the source will the HTTP response message and the target will be the message format that you want to send to the sender.

Apply the mapping logic according to the way you want to modify the HTTP response.

Now in the Interface Mapping include the Source and Target Synchronous Interface and click Read Operations....You will get two nodes --> Request & Response mapping nodes....inlcude the respective mapping programs.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

THanks for the reply. You have mentioned that in the second mapping

source message target message

HTTP response message format to be sent to sender

But where will i get the HTTP response data from ?

My scenario is HTTP sender (and receiver is a file server which means that the receiver does not give any response back)

former_member200962
Active Contributor
0 Kudos

I am confused

It should not be HTTP response message that is to be modified......looking at the problem I thought HTTP is at the receiving end and sender is something else!

File wont support for response processing.....what is the response message that you are expecting?

Regards,

Abhishek.

Former Member
0 Kudos

I knew this would be a bit tough to convey my problem...

So now it should be clear i guess

- sender system talks to XI through http request

- it expects a response back

- this http response should have a custom response message ..

prob is how does one modify this http response since that my receiver is totaly oblivious of any syncronous behaviour happening on the sender side

Edited by: Bharath Sai R on Sep 18, 2009 8:11 AM

former_member187339
Active Contributor
0 Kudos

Hi Bharath,

If the scenario is HTTP to File then it cannot be made as a synchronous scenario (ie File adapter will not be able to send a response back)

Source will send message to XI using HTTP and XI will write it as a file (using file adapter). There wont be any response back from File adapter

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I guess you have hit the point now..

tht is my problem.. how does one send back a http response in such cases ??

former_member200962
Active Contributor
0 Kudos
how does one send back a http response in such cases

you cannot send the response message in the same session (response wont come from FILE....ack is however possible...refer FAQ on FILE adapter in http://service.sap.com/notes )

What is the response that is expected?

Regards,

Abhishek.

former_member187339
Active Contributor
0 Kudos

Hi,

Do you want to send some response back (with data) or simply an acknowledgment?

Regards

Suraj

Former Member
0 Kudos

Ok.. now for a little deeper dive..

the http response back to the sender in my senario should like anyother http response message have a response code and response message.

In a general http client server scenario, for a successful post to any HTTP server the response code we recevie is '200' and response message we receive is 'OK'

and for a failure we get http response code 400 or 401 or 500 depending on the type of error and it will be followed by a suitable response message.

In my case, the sender system sends an encrypted xml and when the message arrives at XI tthrough http the following might happen

- XI might not be able to decrypt it

- if decryption is successful the xml might not be well formed

- and a few more type of failures...

now i will have to reply back to the sender system with an appropriate response code and response message

for example

response code - 500

response message - unable to decrypt the message, plesae resend with encrypted data

response code - 501

rsponse message - encrypted data was decrypted fine by XI but the resulting xml is not well formed. please make sure xml is well formed

Please let me know if any part is unclear here.. and may thanks for your efforts

former_member187339
Active Contributor
0 Kudos

Hi,

I would suggest you go for BPM then

Check for the type of possible errors in BPM and send back the response using another HTTP receiver

Regards

Suraj

Former Member
0 Kudos

But This would in another session right?

The sender system expects the response in the same session..

former_member200962
Active Contributor
0 Kudos

You can apply the Sync/ Async Bridge....did you check this option already?

Former Member
0 Kudos

Hi Abhishek and Suraj,

Thanks a ton for your help.

Sync Async bridge in BPM worked out well for my requriement.

However the only problem was the response code is always '200 OK' but atleast i was able to modify the response message

Thanks

Answers (0)