【发布时间】:2015-03-11 05:14:29
【问题描述】:
当我点击链接时它给我的例子
class Test
{
static void Main()
{
InternalCommunicationClient client = new InternalCommunicationClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
}
但是当我将此代码复制到控制台时,InternalCommunicationClient 需要
(InstanceContect回调) 作为参数。
我在 2 年前做过 wcf,那时还没有。请帮忙
这是 web.conf 代码
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" >
<services>
<service name="Workflowms.Web.webservices.Internalcommunication.InternalCommunication">
<endpoint address="" binding="wsDualHttpBinding" contract="Workflowms.Web.webservices.Internalcommunication.IInternalCommunication" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
【问题讨论】:
-
是双工服务吗?
-
是的,它是双工服务
-
所以,在双工服务中它是必需的。 msdn.microsoft.com/en-us/library/ms574928(v=vs.110).aspx
标签: c# wcf constructor