Last post Jan 08, 2014 03:36 AM by ramana123
Jan 07, 2014 05:52 AM|dotnetmohan.msn.com|LINK
My Client given
Client requirements , In config file Create Like
<add key="DEVT" value="Service URL" />
<add key="UAT" value="Service URL" />
<add key="PROD" value="Service URL" />
Now according environment access the URL , Create the Proxy then utilize the functions.
Important : Production Services URL , I don’t know, That’s when deployment they just add in Config file.
Please help me any one , how to achieve this?
Jan 07, 2014 04:48 PM|l.laxmikant|LINK
you can create dynamic proxy using WCF ChannelFactory which will create service proxy on the fly.
It has certain advantages and disadvantages
For more info check WCF dynamic proxy
Jan 08, 2014 01:24 AM|dotnetmohan.msn.com|LINK
Thank you. laxmi.
I have got some points in clear way. Hope this help me to do further.
When to use Proxy?
Creating proxy by Visual Studio or SvcUtil.exe tool will update client configuration file to make necessary changes. If you know your services are generic enough and services should be
loosely coupled you should use Proxy.
When to use ChannelFactory?
In some scenario services needs to be tightly coupled
and needs to share not only ServiceContract but also other dependant methods, contracts etc. When you do not want to force client to change or rebuild on frequent service schema, you have to share utility methods, different internal services, contracts
along with ServiceContract then you should use ChannelFactory.
Jan 08, 2014 03:36 AM|ramana123|LINK
the proxy will be having URL propertyl; you just need to set that during runtime like getting it from config file. simple enough.