2012-04-22 3 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].. 

는 좀 artiles은 IIS가 여러 기본 주소를 해결하는 방법에 대한 이야기 ​​발견했다, 그러나 이것은 너무 로컬입니다 왜 작동하지 않는지 모르겠습니다.

여기에 누락 된 것이 있습니까? 구성 파일은 basicHttpBindings 만 사용하는 한 제대로 작동합니다.

도움이 될 것입니다, tyvm!

+0

구성 파일의 암호를 편집했습니다. 더 이상 익명으로 만드는 것은 나쁜 생각이 아닙니다. –

답변

1

보안이 필요합니까? ssl을 찾을 wsHttpBinding에서 전송 보안을 사용하도록 설정해야합니다. basicHttpBinding이 any를 사용하지 않습니다. 설정하면 오류가 사라집니다.

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

     </security> 
    </binding> 

또 다른 옵션은 IIS에서 ssl을 설정하는 것입니다.

+0

고마워, 그게 도움이 :) :)하지만 지금은 내가 신뢰할 수있는 세션이 거짓이면, 다음과 같은 오류 메시지가 나타납니다 : 계약, 세션이 필요하지만 'WSHttpBinding'바인딩을 지원하지 않습니다 또는 지원 제대로 구성되지 않습니다 그것 ... 내가 신뢰할 수있는 세션을 true로 설정하면 405 오류가 발생합니다 (허용되지 않는 메소드) –