none
generate client code for net.tcp RRS feed

Answers

  • Hi Tony,

    As far as I know when generate service file in client, we can try add the service reference or

    use svcutil.exe tool.  When we use the svcutil.exe tool we can entry the metadata address

    directly. Also, we can generate the wsdl file by svcutil.exe then generate the proxy class

    for client.

    First, we need to generate the  metadata file from the project assembly(.dll or .exe) file.

    Like this :

    svcutil D:\Sample\WCF\DiscoveryProxyService\bin\Debug\DiscoveryProxyService.exe
    

    Then, it will generate four files. Next, we can use the following command, it will help us to generate

    the proxy class and configuration file.

    like below:

    svcutil D:\Sample\WCF\DiscoveryProxyService\bin\Debug\DiscoveryProxyService.exe
    svcutil *.wsdl *.xsd

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Friday, December 25, 2015 1:57 AM
    Moderator

All replies

  • Please refer to the following page for details: https://msdn.microsoft.com/en-us/library/ms733133(v=vs.110).aspx

    Open up the Developer Command Promt for VS 20XX (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat) and issue the following command:

    svcutil.exe /language:cs /out:GeneratedClient.cs /config:app.config http://localhost:8000/ServiceModelSamples/service

    This will generate the "GeneratedClient.cs" class definition based on the metadata obtained from the service at http://localhost:8000/ServiceModelSamples/service. Of course you need to change this address to the actual address of your service and make sure that your service exposes metadata.

    Instead of using svcutil, you could also add a service reference to the service as described here: https://msdn.microsoft.com/en-us/library/bb386386.aspx


    Hope that helps.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Wednesday, December 23, 2015 1:33 PM
  • Hi Tony,

    As far as I know when generate service file in client, we can try add the service reference or

    use svcutil.exe tool.  When we use the svcutil.exe tool we can entry the metadata address

    directly. Also, we can generate the wsdl file by svcutil.exe then generate the proxy class

    for client.

    First, we need to generate the  metadata file from the project assembly(.dll or .exe) file.

    Like this :

    svcutil D:\Sample\WCF\DiscoveryProxyService\bin\Debug\DiscoveryProxyService.exe
    

    Then, it will generate four files. Next, we can use the following command, it will help us to generate

    the proxy class and configuration file.

    like below:

    svcutil D:\Sample\WCF\DiscoveryProxyService\bin\Debug\DiscoveryProxyService.exe
    svcutil *.wsdl *.xsd

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Friday, December 25, 2015 1:57 AM
    Moderator