Setting response and exiting from SOAP web service request handler without entering the end pointSvc

Hi,

I am trying to set the SOAP response in the request handler and send it back to the caller without generating the fault and not even going to end point service(This a web service provider service).
Please let me know if this is possible and any examples if you have already tried.

Appreciate your help!

Thanks,
Varun.

Confused by your request.
Request header is what you received, you won’t be able to send back.
Do you mean response header?
What’s the use case for this?

Hi Tong,

I would like to look up custom cache in the request handler service and if it is found would like to set the SOAP response and return to the caller without going to end point service. If the cache not available, proceed to the end point service.

Thanks for your reply!

Thanks,
Varun.

I don’t think you can do any customization before entering the end point service.
but you can do your check as the first step in the end point service.
For getting request header, try: pub.flow:getTransportInfo
even for SOAP, I think you can still get some header fields.
HTH,

If you have Mediator-Centrasite you could use the pre and post processing steps tab to handle fault and if the validation passes then only call the native web service. In your case you have to use pre-processing step to validate the incoming message to determine if the Request is valid(call Native web service) or invalid(generate SOAP fault).

Thanks Akshith & Tong for your responses!

I have found a kind of work around for this as below :

We need to set the statusCode(output of any handler service) to 1 in Request Handler Service to skip end point service and directly invoke response handler service.This might create a fault. Hence we need to create a new SOAP message(pub.soap.utils:createSoapData) in Response handler service and add body(pub.soap.utils:addBodyEntry) and “set” SOAP message(pub.soap.handler:setSOAPMessage).

We can use pub.soap.handler:get(set)Property services to carry the data/controls between handler services.

Please let me know if you have any better alternatives.

Thanks,
Varun.