none
About WCF Services References in Presentation Layred RRS feed

  • Question

  • Hi All,

     I have an application in n tier architecture. After hosting WCF services in the IIS, then I need to add the references to the presentation layer.  I used the WCF services in “wsHttpBinding “. My question is

    1.  When I am adding references in presentation layer of UI.Process  project then in the “app.config”  the “service endpoint address” for the service was not generated.
    2. Suppose when the “service endpoint address” was generated then, In the Auto generated files we have the entities was references through service. Here ambiguous references was generated.

    How to solve these issues.


    prathap

    Wednesday, June 6, 2012 12:15 PM

Answers

  • Hi,

    1.If your wcf service is hosted you can add service reference to call the service. Then the client will generate the setting in the web.config file. The setting will include the wsHttpBinding in the client side.

    2.You can also configure the app.config file in the client side. And you can specify the contract and endpoint address.

    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 2:09 PM
  • On 6/6/2012 8:15 AM, Prathap Kumar wrote:
    > Hi All,
    >
    > I have an application in n tier architecture. After hosting WCF services
    > in the IIS, then I need to add the references to the presentation layer.
    > I used the WCF services in “wsHttpBinding “. My question is
    >
    >  1. When I am adding references in presentation layer of UI.Process
    >     project then in the “app.config” the “service endpoint address” for
    >     the service was not generated.
    >  2. Suppose when the “service endpoint address” was generated then, In
    >     the Auto generated files we have the entities was references through
    >     service. Here ambiguous references was generated.
    >
    In a N-Tier application, the WCF client should not be in the UI layer.
    You should be using either Model View Presenter or Model View Controller
    UI design pattern to keep such logic out of the UI. The UI should not
    care or see the WCF service -- loosely coupled.
     
    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 4:49 PM
  • Have you browsed to the service location and checked if the service is active ?

    If it is active , please close your Visual Studio solution and launch it again to add the service reference.

    Prashanthi.

    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 7:45 PM

All replies

  • Hi,

    1.If your wcf service is hosted you can add service reference to call the service. Then the client will generate the setting in the web.config file. The setting will include the wsHttpBinding in the client side.

    2.You can also configure the app.config file in the client side. And you can specify the contract and endpoint address.

    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 2:09 PM
  • On 6/6/2012 8:15 AM, Prathap Kumar wrote:
    > Hi All,
    >
    > I have an application in n tier architecture. After hosting WCF services
    > in the IIS, then I need to add the references to the presentation layer.
    > I used the WCF services in “wsHttpBinding “. My question is
    >
    >  1. When I am adding references in presentation layer of UI.Process
    >     project then in the “app.config” the “service endpoint address” for
    >     the service was not generated.
    >  2. Suppose when the “service endpoint address” was generated then, In
    >     the Auto generated files we have the entities was references through
    >     service. Here ambiguous references was generated.
    >
    In a N-Tier application, the WCF client should not be in the UI layer.
    You should be using either Model View Presenter or Model View Controller
    UI design pattern to keep such logic out of the UI. The UI should not
    care or see the WCF service -- loosely coupled.
     
    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 4:49 PM
  • Have you browsed to the service location and checked if the service is active ?

    If it is active , please close your Visual Studio solution and launch it again to add the service reference.

    Prashanthi.

    • Marked as answer by Yi-Lun Luo Tuesday, June 26, 2012 2:23 AM
    Thursday, June 7, 2012 7:45 PM