我有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