2017-08-14 17 views
0

私はVisual Studio 2015で作業しています。私はXamarin Cross-Platfomのプロジェクトを持っています。 私のWCF Rest Serviceはhttpで正常に動作します。 HTTPSを使用しようとしましたが、リソースにアクセスしようとすると「404エラーが見つかりません」というメッセージが表示されます。私はWCF休憩に関するいくつかのチュートリアルを追っWCF休憩サービスhttpからhttpsエラー404

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 

<appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> 
</appSettings> 
<system.web> 
    <compilation debug="true" targetFramework="4.5.2" /> 
    <httpRuntime targetFramework="4.5.2" /> 
</system.web> 
<system.serviceModel> 
<services> 
    <service name="PrototypeBHost.PrototypeB" behaviorConfiguration="ServiceBehaviour"> 
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpTransportSecurity" 
    behaviorConfiguration="restfulBehavior" 
    contract="PrototypeBHost.IprototypeB" /> 

<endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" />  
    </service> 
</services> 
<bindings> 
    <webHttpBinding> 
    <binding name="webHttpTransportSecurity"> 
     <security mode="Transport" /> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<behaviors> 
    <endpointBehaviors> 
    <behavior name="restfulBehavior"> 
     <webHttp/> 
    </behavior> 
    </endpointBehaviors> 
    <serviceBehaviors> 
    <behavior name="ServiceBehaviour"> 
     <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
     <serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<protocolMapping> 
    <add binding="basicHttpsBinding" scheme="https" /> 
</protocolMapping>  
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
</system.serviceModel> 
<system.webServer> 
<modules runAllManagedModulesForAllRequests="true" /> 
<!-- 
    To browse web app root directory during debugging, set the value below to true. 
    Set to false before deployment to avoid disclosing web app folder information. 
    --> 
    <directoryBrowse enabled="true" /> 
    </system.webServer> 
</configuration> 

のapplicationHost.config

<site name="PrototypeBHost" id="2"> 
      <application path="/" applicationPool="Clr4IntegratedAppPool"> 
       <virtualDirectory path="/" physicalPath="c:\Users\Ludovic\Documents\Visual Studio 2015\Projects\PrototypeB\PrototypeBHost" /> 
      </application> 
      <bindings> 
      <!-- <binding protocol="http" bindingInformation="*:9612:192.168.1.106" /> 
       <binding protocol="http" bindingInformation="*:8023:localhost" />--> 
       <binding protocol="https" bindingInformation="*:9612:192.168.1.106" /> 
       <binding protocol="https" bindingInformation="*:8023:localhost" /> 
      </bindings> 
     </site> 

web.configファイルが、私はと少し混乱しています: あなたはコンフィグファイルの下にありますSSL証明書。私はそれが必要ですか?どのようにSSL証明書をWCF Rest Serviceに添付できますか?私は何か見落としてますか?

My_WCF_proprieties

+0

あなたがSSで動作するようにIISを設定しましたL? – hugoterelle

+0

いいえ、私はwcfの財産と私のポストの最後に画像をリンクしました。私はこれを確認します。 – Ludovic

+0

サービスの簡略版でgithub repoを作成できますか? – hugoterelle

答えて

1

Iようやく見つけた問題は、IIS Expressでデフォルトの証明書は、仕事といくつかのトラブルを起こさないました。 VS2015

netsh http delete sslcert ipport=0.0.0.0:44300 

はその 後、私はすべての証明書

netsh http show sslcert > output.txt 
を表示するには、自己署名証明書

netsh http add sslcert ipport=0.0.0.0:44300 certhash=fb02ea72ab7443604aa8frib298e43l751ce3606 appid={214124cd-d05b-4309-8p76-9caa44b2b74a} 

にコマンドを追加するために、私は証明書のいずれかをまず削除 、私は、コマンドプロンプトを使用します

、それが動作します:)

関連する問題