4

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

 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].

 Source Error: 

  An unhandled exception was generated during the execution of the current web request.     Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

 Stack Trace: 


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

System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri、Binding binding、UriSchemeKeyedCollection baseAddresses) +12366396 System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase ホスト、ServiceDescription 説明、ServiceElement serviceElement、Action`1 addBaseAddress) +12363749 System.ServiceModel.ServiceHostBase .LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +67 System.ServiceModel.ServiceHostBase.ApplyConfiguration() +108 System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +192 System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +49 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +151 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +30 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +422 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651Uri[] baseAddresses) +422 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651Uri[] baseAddresses) +422 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651

  [ServiceActivationException: The service '/BulkEmailService.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http]..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +688590
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190

     System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +359
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

これが私の Web.config ファイルです。助けてください。

   <?xml version="1.0"?>
   <configuration>

     <system.web>
       <compilation debug="true" targetFramework="4.0" />
     </system.web>
     <connectionStrings>
       <add name="WWDbConnect"
            connectionString="Data Source=(dev0320);USER ID = scott; Password = t;Max Pool Size=200;"
            providerName="System.Data.SqlClient" />
     </connectionStrings>
     <system.serviceModel>
       <bindings>
         <basicHttpBinding>
           <binding name="BasicHttpBindingWithNoSecurity" maxBufferPoolSize="524288" maxReceivedMessageSize="500000">
             <security mode="Transport">
               <transport clientCredentialType="Certificate" proxyCredentialType="None"
                   realm="" />
               <message clientCredentialType="UserName" algorithmSuite="Default" />
             </security>
           </binding>
         </basicHttpBinding>
       </bindings>
       <client/>
       <services>
           <service name="WW.Common.Service.Impl.EmailService" behaviorConfiguration="BasicHttpBindingWithNoSecurity">
             <host>
               <baseAddresses>
                 <add baseAddress = "https://localhost:8270/Design_Time_Addresses/TestWcfEmailServiceLibrary/EmailService/" />
               </baseAddresses>
             </host>
             <endpoint address="EmailService" binding="basicHttpBinding" contract="WW.Common.Service.Contract.IEmailService" />
             <endpoint address="mex" binding="basicHttpBinding" bindingConfiguration="BasicHttpBindingWithNoSecurity" 
                       name="mexEndpoint" contract="IMetadataExchange" />
           </service>
         </services>
         <behaviors>
         <serviceBehaviors>
             <behavior name="EmailService">
               <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true"/>
               <serviceMetadata httpsGetEnabled="true" />
               <serviceSecurityAudit auditLogLocation="Application"
                  suppressAuditFailure="true"
                  serviceAuthorizationAuditLevel="Success"
                  messageAuthenticationAuditLevel="Success" />
           </behavior>
         </serviceBehaviors>
       </behaviors>
       <diagnostics>
         <messageLogging logEntireMessage="true"
                         maxMessagesToLog="3000"
                         logMessagesAtServiceLevel="true"
                         logMalformedMessages="false"
                         logMessagesAtTransportLevel="false" />
       </diagnostics>
       <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
     </system.serviceModel>
    <system.webServer>
       <modules runAllManagedModulesForAllRequests="true"/>
     </system.webServer>

   </configuration>
4

1 に答える 1

1

ベース アドレスに https を使用していますが、バインディングは basicHttpBinding です。あなたの構成を見ると、証明書を使用することを計画していると思います。バインディングを WSHttpBinding に変更することをお勧めします

<endpoint address="test" binding="wsHttpBinding" contract="WW.Common.Service.Contract.IEmailService"/>

または、http のみを使用する場合。以下に示すように、ベース アドレスを http に変更します。コードからバインディング構成も削除したことに注意してください

 <service name="WW.Common.Service.Impl.EmailService">
          <host>
            <baseAddresses>
              <add baseAddress = "http://localhost:8270/Design_Time_Addresses/TestWcfEmailServiceLibrary/EmailService/" />
            </baseAddresses>
          </host>
          <endpoint address="EmailService" binding="basicHttpBinding" contract="WW.Common.Service.Contract.IEmailService" />
          <endpoint address="mex" binding="basicHttpBinding" 
                    name="mexEndpoint" contract="IMetadataExchange" />
        </service>

また、WCFバインディングを読むことをお勧めします

于 2013-02-13T19:23:15.157 に答える