WCF ベースの REST Web サービスを立ち上げ、HTTP で動作させています。
HTTPS 経由でアクセスしようとすると、404 エラーが発生します。サービスは主に、AJAX を介してブラウザーでユーザーが行った状態の変更を処理するため、HTTPS が適切に機能する必要があります。で Web サービスを呼び出そうとすると.ajax
、エラーが発生します。
http://site/svc/core.svc/dowork == working
https://site/svc/core.svc/dowork == 404
基本的なコードは次のとおりです。
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json)]
string DoWork();
public string DoWork()
{
return "hullo";
}
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="secureBinding">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
<protocolMapping>
<add binding="webHttpBinding" bindingConfiguration="secureBinding" scheme="https"/>
</protocolMapping>
<services>
<service name="Fusion.core" behaviorConfiguration="Fusion.CoreBehavior" >
<endpoint contract="Fusion.Icore" binding="webHttpBinding" behaviorConfiguration="webBehavior" address="" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Fusion.CoreBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>