Conditional Check for Incoming Request and Custom Response

VirtEyesVirtEyes Posts: 2

Is it possible to set up a responder to respond multiple ways based on the incoming request format?

Example: A SOAP based request sent yields type "A" response, and a REST based request yields type "B" response. The response is from the same responder

If this is possible, can it be detailed as to how to do this?

Comments

  • OmarROmarR Posts: 216 admin

    Hello,
    Is there a particular reason why you need the response to be from the same responder?

    It will be easier and much cleaner to have two responders: SOAP Responder and JSON Responder.
    You can configure the SOAP Responder to have correlation based on a transport header or an XML field. You could do the same with the JSON Responder and have its correlation based on a different transport header or JSON field.
    Example:

  • VirtEyesVirtEyes Posts: 2

    Thank you Omar,

    We are trying to recreate something similar we have in another tool. We want to have some sort of logic where the user can detect what is the format of the incoming request, and based on that will send a SOAP or REST based response, both of which could be very similar but just in two different formats.

    You are saying that we can just set it to where the Responder Correlation detects if a particular header (such as text/xml or application/json) is detected, and based off that, it then will hit the appropriate responder?

  • OmarROmarR Posts: 216 admin

    You are saying that we can just set it to where the Responder Correlation detects if a particular header (such as text/xml or application/json) is detected, and based off that, it then will hit the appropriate responder?

    Yes, exactly. Give it a shot and let us know if you have any questions.

Sign In or Register to comment.