none
Consuming WCF Service in a Windows Application RRS feed

  • Question

  • Hi,

    I have a Windows application in one Solution with WCF Service. In this Windows application I am consuming a WCF Service "UserAuthenticationService" and its operations successfully. Now I need to consume this same "UserAuthenticationService" in a different Console Application in different Solution.   

    I tried to achieve this in following manner:

    I just ran the Windows application with WCF Service successfully and used the service URL while adding service references in Console Application. But problem is that in Console application it is not displaying all the Service types/classes in client application for use. Whereas in main Windows application it is displaying all the Service classes/types in References.cs for use.

    May I know what I am missing or is there any other way to achieve this? Please let me know asap.

    Thanks and Regards,

    Pratham

    • Moved by Stanly Fan Monday, February 5, 2018 1:49 AM WCF Related
    Saturday, February 3, 2018 9:04 PM

All replies

  • Do you mean that the classes, which are marked with [DataContract] and are used as input and output parameters, are not visible in your console?

    Or maybe you mean other classes, that are visible inside Windows application since you have added a second reference to WCF as a Class Library, not just a Service Reference.

    Sunday, February 4, 2018 9:24 AM
  • Hi Viorel,

    Thanks for your reply.

    Here I simply mean that there are some client proxy classes that are generated in Windows Application[Service References/WCFService/References.cs] but are not generated in my Console application[Service References/WCFService/References.cs] to access the WCF Service methods.

     For example - I have one WCFServiceRequestClient class generated in Windows Application[Service References/WCFService/References.cs] but not generated in Console application[Service References/WCF Service/References.cs] due to which I am not able to call required methods of service in Console application. 

    Am I missing something or Is there any better alternate way to achieve this? 

    Regards,

    Pratham 

    Sunday, February 4, 2018 7:42 PM
  • Hi Pratham,

    According to your description, your issue is more related about WCF apps. And this forum is discussing and asking questions about the Windows Form and ClickOnce, I will move this thread to corresponding forum: Windows Communication Foundation, Serialization, and Networking Forum for dedicated information.

    Thank you for your understanding.

    Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 5, 2018 1:48 AM
  • Hi prathamjain,

    Could you share us a simple project which could reproduce your issue?

    >> it is not displaying all the Service types/classes in client application for use

    Do you use multiple Service Contract? If so, you need to add service reference by different Service Contract endpoint.

    Do you add DataContract for classes? For sharing model classes between client and service side, you need to add DataContract.

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 5, 2018 2:54 AM