locked
WCF: I have the problem with Creating the Proxy through Add services Reference in different environment RRS feed

  • Question

  • User2098566065 posted

    Because,

    My Client given  

    1. Develop environment   WCF Services URL
    2. UAT  environment    WCF Services URL
    3. Production environment    WCF Services URL

     Client requirements , In config file  Create Like

    <appSettings>

        <add key="DEVT" value="Service URL" />

        <add key="UAT" value="Service URL" />

        <add key="PROD" value="Service URL" />

     </appSettings> 

    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?

    Tuesday, January 7, 2014 5:52 AM

Answers

  • User2098566065 posted

    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.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 8, 2014 1:24 AM

All replies

  • User503812343 posted

    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

    Tuesday, January 7, 2014 4:48 PM
  • User2098566065 posted

    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.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 8, 2014 1:24 AM
  • User-1623675128 posted

    the proxy will be having URL propertyl; you just need to set that during runtime like getting it from config file. simple enough.

    Wednesday, January 8, 2014 3:36 AM