【问题标题】:wcf client generated code requires constructor parameterswcf客户端生成的代码需要构造函数参数
【发布时间】: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>

【问题讨论】:

标签: c# wcf constructor


【解决方案1】:

按照这些步骤,

  1. 暴露端点
  2. 在您的代码中创建服务引用
  3. 使用您上面提到的鳕鱼,

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-05
  • 2011-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多