2012-04-22 12 views
0

私の設定が正しく動作するようになったので、実際のファイル構造とVisual Studioのプロジェクト構造との間に不一致がありました。ばかげた愚かな間違い:WCF BasicからwsHttpBindingへ

しかし、今私はbasicHttpBindingからWsHttpBindingに移行する問題があります。これはwebconfigです。ご覧のとおり、最初のエンドポイントをwsHttpBindingタイプに変更しました。

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <connectionStrings> 
    <add name="RENTIT05ConnectionString" connectionString="Data Source=rentit.itu.dk;Initial Catalog=RENTIT05;Persist Security Info=True;User ID=Rentit05db;Password=omitted" providerName="System.Data.SqlClient" /> 
    <add name="RENTIT05Entities" connectionString="metadata=res://*/RentIt.csdl|res://*/RentIt.ssdl|res://*/RentIt.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=rentit.itu.dk;Initial Catalog=RENTIT05;Persist Security Info=True;User ID=Rentit05db;Password=omitted;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> 
    </connectionStrings> 
    <system.web> 
    <httpRuntime executionTimeout="3600" maxRequestLength="10000000"/> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
     </assemblies> 
    </compilation> 
    <customErrors mode="Off" /> 
    </system.web> 

    <system.serviceModel> 
    <services> 
     <service name="RentIt05.Services.Service" behaviorConfiguration="ServiceBehavior"> 
     <endpoint address="RentIt05.Services.AgeRatingService" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="RentIt05.Interfaces.IAgeRatingService"></endpoint> 
     <endpoint address="RentIt05.Services.CommentService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.ICommentService"></endpoint> 
     <endpoint address="RentIt05.Services.ItemService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IItemService"></endpoint> 
     <endpoint address="RentIt05.Services.ItemTypeService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IItemTypeService"></endpoint> 
     <endpoint address="RentIt05.Services.LabelService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.ILabelService"></endpoint> 
     <endpoint address="RentIt05.Services.LoginService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.ILoginService"></endpoint> 
     <endpoint address="RentIt05.Services.RatingService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IRatingService"></endpoint> 
     <endpoint address="RentIt05.Services.SectionService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.ISectionService"></endpoint> 
     <endpoint address="RentIt05.Services.StateLogService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IStateLogService"></endpoint> 
     <endpoint address="RentIt05.Services.StateService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IStateService"></endpoint> 
     <endpoint address="RentIt05.Services.UserGroupService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IUserGroupService"></endpoint> 
     <endpoint address="RentIt05.Services.UserService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.IUserService"></endpoint> 
     <endpoint address="RentIt05.Services.TransferService" binding="basicHttpBinding" bindingConfiguration="RentItBinding" contract="RentIt05.Interfaces.ITransferService"></endpoint> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="ServiceBehavior"> 
      <serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000" maxConcurrentInstances="1000"/> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="RentItBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="StreamedRequest"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     </binding> 
     </basicHttpBinding> 
     <wsHttpBinding> 
     <binding name="wsHttpBinding"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    </system.webServer> 
</configuration> 

私はローカルホスト上でローカルにこれを実行しようとすると、私は次のようなエラーメッセージが出ます:

Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].. 

をので、私はIISが複数のベースアドレスを解決話していくつかのartilesを発見したが、これはローカルでありますなぜそれが動作していないのかわかりません。

ここに何か不足していますか?私がbasicHttpBindingsだけを使用する限り、設定ファイルは正常に動作します。

ご協力いただければ幸いです。

+0

設定ファイルのパスワードを編集しました。あなた自身をさらに匿名にするのは悪い考えではありません。 –

答えて

1

セキュリティが有効になっている必要がありますか? sslを探すwsHttpBindingで転送セキュリティが有効になっている。あなたのbasicHttpBindingはanyを使用していません。

<binding name="wsHttpBinding"> 
     <security mode="None"> 

     </security> 
    </binding> 

また、IISでsslを設定することもできます。

+0

ありがとうございました:)しかし、これを行うと信頼できるセッションが偽である場合、次のエラーメッセージが表示されます。 契約にはセッションが必要ですが、バインディング 'WSHttpBinding'はサポートしていないか、それ... 信頼できるセッションをtrueに設定すると、405エラーが発生します(メソッドは許可されません) –

関連する問題