none
Expose WSDL RRS feed

  • Question

  • Hi all,

    I use  BizTalk2006 R2. I publish schema as WCF service with "WCF Service Publishing Wizard" on WCF-WShttp. It create all artefacts correctly. I create an orchestration, bind it to my receive location (request - response), start my orchestration.
    In My IE the page http://localhost/ME.Service2/CreateOrder/Service1.svc  display correctly.

    I write a .Net client to call my service, i add "Service Reference" but i get the error : 

    " There was an error downloading 'http://localhost/ME.Service2/CreateOrder/Service1.svc'.
    The request failed with the error message:
    --
    <html>
        <head>
            <title>Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>

        <body bgcolor="white">

                <span><H1>Server Error in '/ME.Service2/CreateOrder' Application.<hr width=100% size=1 color=silver></H1>

                <h2> <i>Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].</i> </h2></span>

                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

                <b> Description: </b>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.

                <br><br>

                <b> Exception Details: </b>System.InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].<br><br>

                <b>Source Error:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>

    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.</code>

                      </td>
                   </tr>
                </table>

                <br>

                <b>Stack Trace:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>

    [InvalidOperationException: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].]
       System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +4569067
       System.ServiceModel.ServiceHostBase.AddServiceEndpoint(String implementedContract, Binding binding, Uri address, Uri listenUri) +92
       System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, Uri address, Uri listenUri) +147
       System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, String address, Uri listenUri) +58
       System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, String address) +17
       Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime() +882
       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHost`3.InitializeRuntime() +107
       System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +63
       System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +268
       System.ServiceModel.Channels.CommunicationObject.Open() +30
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +104
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +498

    [ServiceActivationException: The service '/ME.Service2/CreateOrder/Service1.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 WSHttpBinding. Registered base address schemes are [http]..]
       System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +183
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +205
       System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +322
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    </pre></code>

                      </td>
                   </tr>
                </table>

                <br>

                <hr width=100% size=1 color=silver>

                <b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

                </font>

        </body>
    </html>
    <!--
    [InvalidOperationException]: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].
       at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
       at System.ServiceModel.ServiceHostBase.AddServiceEndpoint(String implementedContract, Binding binding, Uri address, Uri listenUri)
       at System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, Uri address, Uri listenUri)
       at System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, String address, Uri listenUri)
       at System.ServiceModel.ServiceHost.AddServiceEndpoint(Type implementedContract, Binding binding, String address)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime()
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHost`3.InitializeRuntime()
       at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open()
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
       at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
    [ServiceActivationException]: The service '/ME.Service2/CreateOrder/Service1.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 WSHttpBinding. Registered base address schemes are [http]..
       at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext)
       at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    -->
    --.
    Metadata contains a reference that cannot be resolved: 'http://localhost/ME.Service2/CreateOrder/Service1.svc'.
    The requested service, 'http://localhost/ME.Service2/CreateOrder/Service1.svc' could not be activated. See the server's diagnostic trace logs for more information.
    If the service is defined in the current solution, try building the solution and adding the service reference again.
    "


    Does anyone have an answer ?  here is the web.config generated by WCF service publishing wizard  :

    <?xml version="1.0" encoding="utf-8"?>
    <!--
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <!--
        The <configSections> section declares handlers for custom configuration sections.
      -->
      <configSections>
        <section name="bizTalkSettings" type="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkConfigurationSection, Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </configSections>
      <!--
        The <bizTalkSettings> section specifies BizTalk specific configuration.
      -->
      <bizTalkSettings>
        <!--
          mexServiceHostFactory debug:
          Set to "true" to launch debugger when MexServiceHostFactory.CreateServiceHost(...) is called by IIS.
          Used to debug from initial point of activation by IIS.
          Default value is "false" for normal operation.
        -->
        <mexServiceHostFactory debug="false">
          <receiveLocationMappings>
            <!--add markupFileName="*.svc" receiveLocationName="?" publicBaseAddress="protocol://host[:port]" /-->
          </receiveLocationMappings>
        </mexServiceHostFactory>
        <!--
          webServiceHostFactory debug:
          Set to "true" to launch debugger when WebServiceHostFactory.CreateServiceHost(...) is called by IIS.
          Used to debug from initial point of activation by IIS.
          Default value is "false" for normal operation.
        -->
        <webServiceHostFactory debug="false" />
        <!--
          isolatedReceiver disable:
          Set to "true" to skip IBTTransportProxy.RegisterIsolatedReceiver(...) and IBTTransportProxy.TerminateIsolatedReceiver(...) calls.
          Used for testing metadata exchange without having to setup receive location.
          Default value is "false" for normal operation.
        -->
        <isolatedReceiver disable="false" />
        <!--
          btsWsdlExporter disable:
          Set to "true" to skip adding BtsWsdlExporter behavior extension to service endpoint.
          Used for testing or comparing strongly-typed WSDL customization versus weakly-typed WSDL of generic WCF service.
          Default value is "false" for normal operation.
        -->
        <btsWsdlExporter disable="false" />
      </bizTalkSettings>
      <appSettings />
      <connectionStrings />
      <system.web>
        <!--
          Set compilation debug="true" to insert debugging symbols into the compiled page.
          Because this affects performance, set this value to true only during development.
        -->
        <compilation defaultLanguage="c#" debug="false">
          <assemblies>
            <add assembly="mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" />
            <add assembly="Microsoft.BizTalk.Adapter.Wcf.Common, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add assembly="Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          </assemblies>
        </compilation>
        <!--
          The <authentication> section enables configuration of the security authentication mode
          used by ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows" />
        <!--
          The <customErrors> section enables configuration of what to do if/when an unhandled error
          occurs during the execution of a request. Specifically, it enables developers to configure
          html error pages to be displayed in place of a error stack trace.
        -->
        <!--
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
          <error statusCode="403" redirect="NoAccess.htm" />
          <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
      </system.web>
      <!--
        The <system.serviceModel> section specifies Windows Communication Foundation (WCF) configuration.
      -->
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviorConfiguration">
              <serviceDebug httpHelpPageEnabled="true" httpsHelpPageEnabled="false" includeExceptionDetailInFaults="false" />
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <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>
    </configuration>


    Thanks,
    Nicolas

    Thursday, October 22, 2009 4:59 PM

Answers

  • Just use http:// rather than https:// in the address to the service reference from your .net project.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Friday, October 23, 2009 11:46 AM
    Moderator
  • WCF will check to see if the hosting environment actually supports SSL before it will allow that to binding to be used. Please use http:// instead of https:// as Ben suggested.
    Sincerely WenJun Zhang - MSFT Microsoft Online Community Support Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, October 29, 2009 9:57 AM
    Moderator

All replies

  • Just use http:// rather than https:// in the address to the service reference from your .net project.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Friday, October 23, 2009 11:46 AM
    Moderator
  • WCF will check to see if the hosting environment actually supports SSL before it will allow that to binding to be used. Please use http:// instead of https:// as Ben suggested.
    Sincerely WenJun Zhang - MSFT Microsoft Online Community Support Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, October 29, 2009 9:57 AM
    Moderator