Search code examples
c#web-servicessoapasmx

ASMX Web service call its own instance located at different location


I have one service located at US servers say http://myservice/ProfileManagerWS/ProfileMGRWS.asmx

When any client make a call, I need to check request header property. If property say its a call for Canadian instance, then redirect call to http://ca-myservice/ProfileManagerWS/ProfileMGRWS.asmx

Previously service was only located at US servers and we have hosted service into Canadian servers just now.

We do not want to make any code changes at consumers of http://myservice/ProfileManagerWS/ProfileMGRWS.asmx

Should I write HTTPModule or soap extension for US instance?

Also, should I add proxy to US instance to call Canadian instance?


Solution

  • First of all, unless your client application has functionality that will accept a redirect response you won't be able to alter your web service get that functionality.

    What you would probably want to do is to implement Geographical Load Balancing at your DNS server. If a Canadian requests the IP address for myservice, give them an IP address that goes to your Candian server that is also configured to accept requests for the myservice domain.