cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP.RESPONSE in synch BPM

Werner_Magerl
Participant
0 Kudos

Hello,

I want to receive a XML message from a HTTP sender synchron into a BPM.

In the BPM I have to to several steps, one is a mapping step and another is an asynchronus SEND of an IDOC to an R/3.

I have setup this BPM and everything works ok.

The BPM sends a HTTP-200OK back and a response message.

But in some cases the mapping step throws an exception. e.g. a mandatory field is missing.

In this case the HTTP-500 ERROR code is sent back, but with the response message

"Internal Server Error

<SAP:Error><SAP:Category>XIServer</SAP:Category><SAP:Code>INTERNAL.PL_TIMEOUT</SAP:Code><SAP:Stack>Pipeline timeout condition satisfied</SAP:Stack></SAP:Error>"

If I handle the exception in an exception branch everything work ok again, but then the HTTP-200OK is sent back.

Now my question:

How can I send back an HTTP-500 ERROR code from this synchronous BPM with my own response message.

I have tried with CONTROL STEP-CANCEL PROCESS, but I also get the same missleading error message back for the TIMEOUT. Also in this case the process is canceled after 60seconds with this timeout error.

Is is possible to send an HTTP-500 ERROR status and to cancel the process immediatly?

If yes, how can I set a specific RESPONSE message?

best regards

Werner Magerl

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Werner,

usually following should work:

- create a block

- define a exception for your mapping (just fill a field)

- define a excption branch for your block

- put a execption handler for that exception there

- create a second mapping - you should be able to use all containers - and fill your response container

- now in case of exceptions the container should be filled and the block after that finished

Regards,

Udo

Werner_Magerl
Participant
0 Kudos

Hello Udo,

this is what I have implemented.

But in this case the HTTP-200OK code is sent back.

My question is, can I have the same functionality as you excplained with the response container, but with the error code HTTP-500 (or something else, but not 200-OK)

Best regards

Werner

udo_martens
Active Contributor
0 Kudos

Hi Werner,

why dont you map some constants in the way you would like to have the answer into your response during the second mapping (in the exeption branch)? If the process control jumps to the exception branch it is your decision how to fill response container. I suppose there could be a missunderstandig?...

Regards,

Udo

Former Member
0 Kudos

Hello Udo, hello Werner,

for the moment i am not sure but i think if i want to use a mapping i need a xsd that i have imported to my scenario, haven't i? (defined in MessageType?)

and other question: if i have a javamapping infront of the real mapping and this mapping throws an exception: can i catch this javamapping-exception and put this into the second transformation?

thanks a lot

Alex Schramm

Message was edited by: Alexander Schramm (18:36, 31.03.2006)

Werner_Magerl
Participant
0 Kudos

Hello Udo,

yes, I think there is a missunderstanding.

It is no problem to fill the RESPONSE container with my message.

What I want to have is, there should be also an HTTP-Error code sent back from the BPM to the sender.

At the moment I always get an HTTP-OK(200).

But I want to give another HTTP-code back.

Is this possible?

best regards

Werner

Answers (0)