WCF REST (webHttpBinding) Web Services + https 方法 ( WCF Restful Service over https 404 error resource not found )

 
WCF REST (webHttpBinding) Web Services + https 方法 ( WCF Restful Service over https 404 error resource not found )
 
Solution : 解決 – WCF Restful Service over https 404 error resource not found

   web.conf
 
   <?xml version="1.0"?>
   <configuration>
      <appSettings>
         <add key="Key" value="KeyValue"/>
      </appSettings>
      <connectionStrings/>
      <system.web>
         <compilation debug="true" targetFramework="4.0"/>
         <authentication mode="Windows"/>
         <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
      </system.web>
      <system.serviceModel>
        <bindings>
            <webHttpBinding>
               <binding>
                  <security mode="Transport" />
               </binding>
            </webHttpBinding>
       </bindings>

         <services>
            <service name="RestfulWCFService.Service" behaviorConfiguration="RestfulWCFService.ServiceBehavior">
               <endpoint address="" behaviorConfiguration="webBehavior" binding="webHttpBinding" contract="RestfulWCFService.IService"/>
            </service>
         </services>
         <behaviors>
            <endpointBehaviors>
               <behavior name="webBehavior">
                  <webHttp/>
               </behavior>
            </endpointBehaviors>
            <serviceBehaviors>
               <behavior name="RestfulWCFService.ServiceBehavior">
                 <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
               </behavior>
            </serviceBehaviors>
         </behaviors>
      </system.serviceModel>
   </configuration>