none
WCF Published Orch - Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

    Question

  • I have an orchestration published as a web service.  It was working fine on our test environment, we deployed to production, and now getting this error.  The website wouldn't go in the BizTalk MSI, so we copied the files.  We reset the Authentication to match the test system (we are using Basic Auth).

    When we try to browse the webservice in the browser, it prompt for userid/password, we enter it, then it gives the following error. 

    I'm not even sure what it means by "base address", if URL was https://prod.mydomain.com/myapp/myservice.svc, would https://prod.mydomain.com be the based address? In the test environment, the URL is https://test.mydomain.com/myapp/myservice.svc.  In both environments, we have a customer calling this webservice.

    Also, I don't know what it means "scheme http".  We are using https:... on the URL.

    I'm thinking this is either security related, something to do with the app pool being different, or maybe something to do with bindings. 


    Thanks,
    Neal Walter
    http://MyLifeIsMyMessage.net

    Web.config:

        <services>
          <!-- Note: the service name must match the configuration name for the service implementation. -->
          <service name="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance" behaviorConfiguration="ServiceBehaviorConfiguration">
            <endpoint name="HttpMexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
            <!--<endpoint name="HttpsMexEndpoint" address="mex" binding="mexHttpsBinding" bindingConfiguration="" contract="IMetadataExchange" />-->
          </service>
        </services>
      </system.serviceModel>
        <system.webServer>
            <security>
                <authorization>
                    <remove users="*" roles="" verbs="" />
                    <add accessType="Allow" users="myCustomer" />
                </authorization>
            </security>
        </system.webServer>

    Server Error in '/eSecuritelIn' Application.

     

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

    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 http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https]. 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 http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https].]

       System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16582113

       System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +1082

       System.ServiceModel.ServiceHostBase.ApplyConfiguration() +156

       System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +215

       System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses) +400

       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHost`3..ctor(IsolatedReceiverType isolatedReceiver, BizTalkServiceInstance serviceInstance, Uri[] baseAddresses) +36

       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses) +533

       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413

       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50

       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172

     

    [ServiceActivationException: The service '/eSecuritelIn/eSecuritelIn_OrchPublished_RepairEquipmentService.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https]..]

       System.Runtime.AsyncResult.End(IAsyncResult result) +901424

       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178702

       System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272




    Monday, March 30, 2015 4:07 PM

Answers

  • We tried several changes to web.config, including what Prashant mentioned, and the baseAddressPrefixFilters.  The first blog Prashant referred sounded on target, that we had two Virtual Applications in the same Website on PROD, but not in TEST. 

    However, what fixed the issue for us was adding Port 80 http to the IIS Bindings for that website. I don't understand how that fixed it.  It must be that even though we use https: in the URL, some internal process is still using related to returning the WSDL must be using regular http.

    Neal Walters
    http://MyLifeIsMyMessage.net

    • Marked as answer by Neal Walters Monday, March 30, 2015 8:47 PM
    Monday, March 30, 2015 8:47 PM

All replies

  • When you want to migrate Web Applications from one environment to other there are multiple ways to achieve it.

    1) Migrate in MSI- Export MSI and select the option for your Web Application, however I don't recommend this option

    2) Is to browse the folder for Web Application(Right click on web app and browse). Copy this folder(normally within inetpub folder) and take it to the inetpub folder of other environment. Later from the IISManager create application.

    Are you not using the same Binding file?

    Check you web.config file and see if the endpoint is configured for mexHTTpBinding.

    Old: binding="mexHttpBinding"

    New: binding="mexHttpsBinding"

    web.config snippet:

    <services>
        <service behaviorConfiguration="ServiceBehavior" name="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService">
            <endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" 
                contract="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService" />
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>

    Also look into the below article- How to fix: "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding" Errors

    Moving to https = Could not find a base address that matches scheme


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, March 30, 2015 4:21 PM
  • We tried several changes to web.config, including what Prashant mentioned, and the baseAddressPrefixFilters.  The first blog Prashant referred sounded on target, that we had two Virtual Applications in the same Website on PROD, but not in TEST. 

    However, what fixed the issue for us was adding Port 80 http to the IIS Bindings for that website. I don't understand how that fixed it.  It must be that even though we use https: in the URL, some internal process is still using related to returning the WSDL must be using regular http.

    Neal Walters
    http://MyLifeIsMyMessage.net

    • Marked as answer by Neal Walters Monday, March 30, 2015 8:47 PM
    Monday, March 30, 2015 8:47 PM