简体   繁体   中英

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. after doing some logic while i'm trying to run the wcf service its getting error .

Changed (Added)my web.config as below: Collapse | 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 . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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