locked
WCF client in a separate dll RRS feed

  • Question

  • I need to make an API which provides WCF-client instantiation and WCF-service operation invokation. Also, it should be configurable. This API is a service itself for it's client. A client of this API should be able to create a channel and invoke service's operations through this API. How can I provide the configurability of a WCF-client within dll? And of course I will be happy to get some advices of how to accomplish such a task.
    Thursday, January 19, 2012 5:33 PM

Answers

  • No, the dll containing your API will read the config file of the application (api) that is calling it. In this case, that will be the consumer of your api.

    For API also consider to do the configuration of the WCF through code. Variables that may change often (like the address) can be passed in the constructor.

     

    • Proposed as answer by Peter Borremans Sunday, January 22, 2012 8:07 PM
    • Marked as answer by Yi-Lun Luo Thursday, January 26, 2012 11:29 AM
    Sunday, January 22, 2012 8:07 PM

All replies

  • By default, the dll will use the config file of the calling application (exe).

    Is it an option to store the configuration in that config file?

    Thursday, January 19, 2012 5:51 PM
  • On 1/19/2012 12:33 PM, FofanovIS wrote:
    > I need to make an API which provides WCF-client instantiation and
    > WCF-service operation invokation. Also, it should be configurable. This
    > API is a service itself for it's client. A client of this API should be
    > able to create a channel and invoke service's operations through this
    > API. How can I provide the configurability of a WCF-client within dll?
    > And of course I will be happy to get some advices of how to accomplish
    > such a task.
     
    Are you saying you want a Service layer that sits between the WCF client
    and the WCF service?
     
    Thursday, January 19, 2012 6:33 PM
  • I should develope an API which will be used by my collegue for connection (and operations invokation) to the WCF service.
    Friday, January 20, 2012 2:44 PM
  • I faced only with clients which were developed by creation of an executable application of console or WinForms type and there were a reference to the WCF-service. As I understand, in my case I will not be able to add a service reference and use a config file directly. Am I right?

    Friday, January 20, 2012 2:48 PM
  • No, the dll containing your API will read the config file of the application (api) that is calling it. In this case, that will be the consumer of your api.

    For API also consider to do the configuration of the WCF through code. Variables that may change often (like the address) can be passed in the constructor.

     

    • Proposed as answer by Peter Borremans Sunday, January 22, 2012 8:07 PM
    • Marked as answer by Yi-Lun Luo Thursday, January 26, 2012 11:29 AM
    Sunday, January 22, 2012 8:07 PM