简体   繁体   English

WCF服务未运行

[英]Wcf service not running

While i am adding a new wcf service to my existing application by choosing (Solution Explorer->Add new folder->gave name ,then on that folder i choose add new item->wcf service ->name->ok) result: a interface and a implementation class. 当我通过选择(Solution Explorer-> Add new folder-> gave name,然后在该文件夹上,我选择添加新项目-> wcf service-> name-> ok)将新的wcf服务添加到现有应用程序时:a接口和实现类。 after doing some logic while i'm trying to run the wcf service its getting error . 在我尝试运行wcf服务时做了一些逻辑后,它得到了错误。

Changed (Added)my web.config as below: Collapse | 更改(添加)了我的web.config,如下所示:折叠| Copy Code (for 1st service) 复制代码(用于第一项服务)

   <service name="Intranet.WCF_Service.CGI_Automated" behaviorConfiguration="Intranet.WCF_Service.CGI_AutomatedBehavior">
    <endpoint address="../WCF Service/CGI_Automated.svc" binding="webHttpBinding" contract="Intranet.WCF_Service.ICGI_Automated" behaviorConfiguration="webBehaviour" />
    <endpoint name="mexHttpBinding" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service> (for 2nd one)

</services>

Collapse | 收合| Copy Code 复制代码

     <behavior name="Intranet.WCF_Service.CGI_AutomatedBehavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>

    <behavior name="Serviceforcgi.Service1Behavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>

please suggest me on this ,i am confused here . 请对此提出建议,我在这里感到困惑。

Make sure you followed the app.config file structure . 确保遵循app.config文件结构 There is no need to give same behaviour in different name. 无需使用不同的名称给出相同的行为。 Check the endpoint address, it should not contains space. 检查端点地址,它不应包含空格。

Use WCF Configuration Editor (available in Tools) for simple service/endpoint/behaviour/etc. 使用WCF配置编辑器 (可在工具中使用)来实现简单的服务/端点/行为/等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM