在WCF服务问题中找不到端点

时间:2017-12-22 03:12:59

标签: wcf web-config wcf-data-services

我已经创建了WCF服务并将其托管在IIS上,它运行正常。然后几天后我在现有的课程上又增加了一个方法,但是在浏览那个我遇到的问题时,就像没有找到终点一样。但是现有的方法在浏览时工作正常。

我在下面添加了web.config,

<configuration>

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <identity impersonate="false"/>
    <customErrors mode="RemoteOnly"/>
    <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>
  </system.web>

  <system.serviceModel>

    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBinding1" messageEncoding="Text" textEncoding="utf-8">
          <security mode="None">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

    <services>
      <service name="Application.Login" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="webHttpBinding" behaviorConfiguration="web" contract="Application.ILogin"/>
      </service>

      <service name="Application.Home" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="webHttpBinding" behaviorConfiguration="web" contract="Application.IHome"/>
      </service>

    </services>

    <behaviors>

      <endpointBehaviors>
        <behavior name="web">
          <webHttp defaultOutgoingResponseFormat="Json"/>
        </behavior>
      </endpointBehaviors>

      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>

        <behavior name="">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>

      </serviceBehaviors>

    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" minFreeMemoryPercentageToActivateService="0" />
  </system.serviceModel>

 <system.webServer>
   <httpErrors errorMode="Detailed"/>
   <asp scriptErrorSentToBrowser="true"/>
    <modules runAllManagedModulesForAllRequests="true"/>
   <security>
     <requestFiltering>
       <fileExtensions>
         <add fileExtension=".svc" allowed="true" />
       </fileExtensions>
       <requestLimits>
         <headerLimits>
           <add header="Content-Type" sizeLimit="100" />
         </headerLimits>
       </requestLimits>
     </requestFiltering>
   </security>
   <directoryBrowse enabled="true" />
  </system.webServer>

  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="2147483644 "/>
      </webServices>
    </scripting>
  </system.web.extensions>

是否需要对web.config进行任何更改,

0 个答案:

没有答案