0

私はGoogleとSOに関する他の投稿を試しましたが、これまで試したことは何も私の問題を解決していません。

これが答えになると思いました。サイコロはありません。私はまた、このように、私が受け取っているのと同じエラーメッセージに言及しているSOに関するほとんどの投稿を読みました。

私のサイトは安全です、https。このサイトで実行されている非同期ajaxのものを処理する3つのWCFサービスがあります。これらのサービスのいずれかにアクセスしようとすると、次のエラーが発生します。

WebHttpBindingをバインドしているエンドポイントのスキームhttpに一致するベースアドレスが見つかりませんでした。登録されているベースアドレススキームは[https]です。

私の設定:

<behaviors>
    <endpointBehaviors>
        <behavior name="ajaxBehavior">
            <enableWebScript />
        </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
        <behavior name="ajaxAsynchBehavior">
            <serviceMetadata httpsGetEnabled="true" />
            <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
     </serviceBehaviors>
</behaviors>  
<bindings>
    <webHttpBinding>
        <binding name="webBinding">
            <security mode="Transport" />
        </binding>
    </webHttpBinding>
</bindings>
<services>
    <service name="MyApp.Web.Services.CascadingList">
        <endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
                    binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.CascadingList" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
            </baseAddresses>
        </host>
    </service>
    <service name="MyApp.Web.Services.AutoComplete">
        <endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
                    binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.AutoComplete" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="https://[domain]/MyApp/Services/AutoComplete.svc" />
            </baseAddresses>
        </host>
    </service>
    <service name="MyApp.Web.Services.Validation">
        <endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
                    binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.Validation" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="https://[domain]/MyApp/Services/Validation.svc" />
            </baseAddresses>
        </host>
    </service>
</services>

https:// [domain] /MyApp/SubmitNew.aspx」にアクセスでき、カスケードリストが機能するはずです。

現在、「親」リストには「[メソッド500]」が表示され、子リストは無効のままです。

「SubmitNew」ページにアクセスすると、サーバーのイベントログに「送信者情報:System.ServiceModel.Activation.HostedHttpRequestAsyncResult / 51442863例外:System.ServiceModel.ServiceActivationException:サービス「/MyApp/Services/CascadingList.svc」をアクティブ化できません」と表示されます。コンパイル中の例外が原因です。例外メッセージは次のとおりです。WebHttpBindingをバインドしているエンドポイントのスキームhttpに一致するベースアドレスが見つかりませんでした。登録されているベースアドレススキームは[https]です。 "

「 https:// [domain] /MyApp/Services/CascadingList.svc 」に直接移動すると、前述のエラーも発生します。


更新

これは本番サーバーで発生します。私が入社するずっと前に、SSL証明書付きの安全なサイトが開設されました。新しいWebアプリの安全なサイトの下に新しい仮想ディレクトリを追加しました。

IISの場合:

Secure Web Applications (has SSL cert)
    MyApp
    WebApp1
    WebApp2

正しいbehaviorConfigurationを使用するように構成(上記)を修正しました。

--2012.04.24 13:15CDT-

構成を次のように変更すると(以下)、次のエラーが発生しました:「System.ServiceModel.ServiceActivationException:コンパイル中の例外のため、サービス'/MyApp/Services/CascadingList.svc'をアクティブ化できません。例外メッセージは次のとおりです。'ajaxAsynchBehavior' "という名前のエンドポイント動作はありません

<serviceBehaviors>
    <behavior name="ajaxAsynchBehavior">
        <serviceMetadata httpsGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
</serviceBehaviors>

<services>
    <service name="MyApp.Web.Services.CascadingList">
        <endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
                    binding="basicHttpBinding" bindingConfiguration="ajaxBinding" contract="MyApp.Web.Services.CascadingList" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
            </baseAddresses>
        </host>
    </service>
    .
    .
    .
</services>

だから私はそれを次のように戻しました:

<behaviors>
    <endpointBehaviors>
        <behavior name="ajaxBehavior">
            <enableWebScript />
        </behavior>
        <behavior name="clientBehavior" />
    </endpointBehaviors>
    <serviceBehaviors>
        <behavior name="ajaxAsynchBehavior">
            <serviceMetadata httpsGetEnabled="true" />
            <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
    </serviceBehaviors>
</behaviors>

<services>
    <service name="MyApp.Web.Services.CascadingList">
        <endpoint address="" behaviorConfiguration="ajaxBehavior"
                    binding="basicHttpBinding" bindingConfiguration="ajaxBinding" contract="MyApp.Web.Services.CascadingList" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
            </baseAddresses>
        </host>
    </service>
    .
    .
    .
</services>
4

3 に答える 3

0

私は答え(すべてのコメントを含む)についてdmusialにクレジットを与えますが、これが他の誰かに利益をもたらす場合に備えて、最終的な構成変更を投稿したいと思いました。

この投稿は、私が解決策にたどり着くのにも役立ちました。

<system.serviceModel>
    <behaviors>
        <endpointBehaviors>
            <behavior name="webScriptEnablingBehavior">
                <enableWebScript />
            </behavior>
            <behavior name="clientBehavior" />
        </endpointBehaviors>
        <serviceBehaviors>
            <behavior name="webScriptEnablingBehavior">
                <serviceMetadata httpsGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <webHttpBinding>
            <binding name="webBinding">
                <security mode="Transport" />
            </binding>
        </webHttpBinding>
        <wsHttpBinding>
            <binding name="customBinding" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="1048576" maxReceivedMessageSize="1048576"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true" />
                <security mode="None">
                    <transport clientCredentialType="None" />
                    <message clientCredentialType="None" negotiateServiceCredential="false" establishSecurityContext="false" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
        <service name="MyApp.Web.Services.CascadingList" behaviorConfiguration="webScriptEnablingBehavior">
            <endpoint address="" behaviorConfiguration="webScriptEnablingBehavior"
            binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.CascadingList" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
        <service name="MyApp.Web.Services.AutoComplete" behaviorConfiguration="webScriptEnablingBehavior">
            <endpoint address="" behaviorConfiguration="webScriptEnablingBehavior"
            binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.AutoComplete" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
        <service name="MyApp.Web.Services.Validation" behaviorConfiguration="webScriptEnablingBehavior">
            <endpoint address="" behaviorConfiguration="webScriptEnablingBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.Validation" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
    </services>
</system.serviceModel>
于 2012-04-25T12:14:38.917 に答える
0

タグbehaviorConfigurationに適切な名前を追加しなかったためにアタッチされないサービス動作を除いて、構成は正常に見えます。<service>しかし、これはエラーの原因ではありません。

Visual Studioの組み込みWebサーバー(Cassini)を使用していますか?あなたがそうしているように見えるので、 HTTPSをサポートしていないことに注意してください。これがおそらくエラーが発生する理由です。サイトをローカルIISサーバーに展開してみて、それが機能するかどうかを確認してください。IIS7でhttps開発Webサイトを設定する方法についてはこちらをご覧ください。もう1つ、サイトをIISに展開すると、baseAddressタグは無視されますが、サービスには元の名前、つまりCascadingList.svcでアクセスできることに注意してください(別の方法で構成されている場合を除く)。

于 2012-04-23T21:06:35.130 に答える
0

私はこの構成で私のケースを解決しました:

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding name="webBinding">
                <security mode="Transport">
                </security>
            </binding>
        </webHttpBinding>
    </bindings>
    <protocolMapping>
      <add binding="webHttpBinding" bindingConfiguration="webBinding" scheme="https" />
    </protocolMapping>
</system.serviceModel>
于 2016-01-15T16:41:17.097 に答える