我有WCF service
如何在一臺機器上運行,simple comsole application client
誰在另一臺機器上運行。 服務器做一些很簡單:返回客戶端發送的2號的值一個方法:添加發現到我的WCF服務
[ServiceContract]
public interface IMySampleWCFService
{
[OperationContract]
int Add(int num1, int num2);
[OperationContract]
void CreateDirectory(string directory);
[OperationContract]
string GetVendorToRun(string path);
}
public class MySampleWCFService : IMySampleWCFService
{
public int Add(int num1, int num2)
{
return num1 + num2;
}
}
的App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WCFServiceHostingInWinService.MySampleWCFService">
<endpoint
name="ServiceHttpEndPoint"
address=""
binding="basicHttpBinding"
contract="WCFServiceHostingInWinService.IMySampleWCFService">
</endpoint>
<endpoint
name="ServiceMexEndPoint"
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://192.0.16.250:8733/MySampleWCFService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
什麼我想要做的,很難找到它實施,因爲我是一個新的開發人員是添加發現我的WCF service
,假設我有幾個服務器安裝在幾臺機器上,什麼客戶端應用程序打開我想現在哪些服務是活着\運行和所有這些數據,我可以從發現。 我嘗試閱讀幾篇文章,但正如我提到不明白如何去做,我會喜歡一些幫助。
[WCF發現(http://msdn.microsoft.com/en-us/library/dd456791.aspx)。這個想法是,你*提前不知道*可能的地址。 – shambulator