Using a WCF service hosted on a Windows service externally

I installed the WCF library hosted on a Windows service using the following run:

http://msdn.microsoft.com/en-us/library/ff649818.aspx

Consumer winforms are in the same solution that is locally located on my working C: drive PC.

Walking i.e. winforms button give me the correct answer.

If I create a new solution in C-drive with one Windows Forms project, I cannot successfully add service referenceto this running service, I get the following message:

enter image description here

The detailed message says the following:

URI . , : 'net.tcp://localhost: 8526/Service1'. net.tcp://localhost: 8526/Service1. 00: 00: 02.0020000. TCP 10061: , 127.0.0.1:8526. , 127.0.0.1:8526 , .

Service Reference , , ?


EDIT

MSDN -

+5
2

MSDN , , , , . , , (= scencarios, ) , :

1- :

  net.tcp://localhost:8526/Service1/mex

- , ​​ , .

: "mex" " " Visual Studio WCF. , ( "", " -..." ).


: , , , "Update Service-Reference".

systray " ()"., . , , , , . , Visual Studio. Visual Studio

WcfSvcHost.Exe /Service:<Service1Binary> /Configuration:<Service1Config> 

( Visual Studio Common7\IDE, WcfTestClient.Exe - , , WCF).

, client.exe Windows Visual Studio, , , .

Microsoft :

, , 3rd.


3- : InstallUtil ? , [...]/bin/Debug, , .EXE.

. , ServiceInstaller, . - InstallUtil - ( .config .dll) .


4- :. , IP- localhost, , ( Windows ) 8526 ( , ). , .


5- (UPDATE): - Service1 - , Wcf. , , WCF , .. WcfServiceLibrary1.Service1, . Whytheq .


: , : "WCF: ". WCF. , , - using a

ServiceHost host = new ServiceHost(typeof(Service));
try
{
    host.Open();

    Console.WriteLine("WCF Service is ready for requests." +  
    "Press any key to close the service.");
    Console.WriteLine();
    Console.Read();

    Console.WriteLine("Closing service...");
}
finally
{
    if (host!=null) {
            host.Close();
            host=null;
    }
}

, : " ".

+12

:

  • URL- WSDL- WSDL .
  • :
  • , wsdl: binding i.e. change name= "wb: wsclocks-inboundSoapBinding" name= "wsclocks-inboundSoapBinding"
  • wsdl: port , name, wsclocks-inbound.

svcutil/o: Client\WBServices/noConfig

0

All Articles