none
Redirect WCF service from service1 to service 2 then get response back to CLient RRS feed

  • Question

  • Hi

    Client consumed my Service1(stage env), Whenever client calls i want to do some validation based on validation result redirect to service 2 (dev env) process the request and give response back to client.

    **I dont want to use WCF routing**

    My approach:

    > write http module and register in service 1

    > when ever client calls in service 1 check stream object 

                 > I am reading SOAP message and reading for particular namespace attribute and Element then validating my custom logic.

    Till here i have achieved.

    Now if the logic out come true then i want to redirect to service2 with the same SOAP message and process request there and has to send response back to client.

    I am trying with response.redirect / server.Transfer but nothing work. Creating new HTTP client?

    Please give inputs if you have any.. thanks

    • Edited by ragsrams7 Thursday, May 26, 2016 8:48 PM
    Thursday, May 26, 2016 8:44 PM

Answers

All replies

  • Please give inputs if you have any.. thanks

    https://msdn.microsoft.com/en-us/library/ee658090.aspx?f=255&MSPPError=-2147217396

    The use of a Service Layer is being shown to you in the link below. You can make the Service Layer consume the WCF services and write the logic within the Service Layer I would think to do what you want. You can just take the Service Layer code out of the example in the link.

    http://polymorphicpodcast.com/shows/mv-patterns/

    Thursday, May 26, 2016 9:51 PM
  • Hi

    Thanks for your reply,

    the services 1 & 2 already developed and hosted, I don't want to do any code changes any of them also not in client.

    I want to build  a routing module like HttpModule and register in service1.

    So when request hits service1 from client i want to do routing check and route to service2, But the response should go back to client.

    Please let me know if  you have any thoughts.

    Friday, May 27, 2016 1:59 AM
  • Hi

    Thanks for your reply,

    the services 1 & 2 already developed and hosted, I don't want to do any code changes any of them also not in client.

    I want to build  a routing module like HttpModule and register in service1.

    So when request hits service1 from client i want to do routing check and route to service2, But the response should go back to client.

    Please let me know if  you have any thoughts.


    I kind doubt that you can do it without a Service Layer.
    Friday, May 27, 2016 3:50 AM
  • Hello,

    The recommend way to redirect calls in WCF is to use the built-in WCF Routing Service .
    Or you may need to use the Service Layer as suggested by @DA924x.
    For more information, please try to refer to the following similar thread:
    #WCF URL Redirection using HttpModule:
    http://stackoverflow.com/questions/10313167/wcf-url-redirection-using-httpmodule .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 7, 2016 2:14 AM
    Moderator