0

Trying to deploy a super barebones WCF Web Service and test it locally. I'm getting an error:

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

I'll include my endpoint tags from the web.config file here:


    <services>
      <service name="Company.PrototypeWebService.PrototypeWebService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHTTPBinding" contract="Company.PrototypeWebService.ServiceContracts.IPrototypeWebService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
      </service>
    </services>

Is there something I'm missing here? I'm new to web service development.

5
  • It doesn't seem odd to you that the address attribute is empty? Commented Jul 17, 2020 at 23:48
  • I'm going off a template from my employer which seems to work for similar web services ... it did seem a touch odd though. Commented Jul 20, 2020 at 14:15
  • Turns out I should be using the Visual Studio Publish tool ... Still figuring this out. More information to come Commented Jul 20, 2020 at 20:22
  • I abandoned this project and started fresh. I think the issue was that I started from the wrong template in Visual Studio, but I can't say for sure. Thanks for your information Commented Jul 28, 2020 at 15:22
  • yes, you need to use WCF Service Application template to deploy WCF project in IIS. Commented Jul 29, 2020 at 6:52

1 Answer 1

0

This is because your base address is Http, but I see that your metadata endpoint uses https, which is the cause of the error,modify your Service:

<services>
      <service name="Company.PrototypeWebService.PrototypeWebService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="secureHTTPBinding" contract="Company.PrototypeWebService.ServiceContracts.IPrototypeWebService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
</services>

Modify mexHttpsBinding to mexHttpBinding.

If you want to use https binding, you need to configure the SSL certificate on the server. Normally, it is more convenient to use https in IIS.

UPDATE

If hosted in IIS, we need to create the following WCF project:

enter image description here

The directory of this project looks like this:

enter image description here

We can deploy the project directly to IIS, set the base address when deploying in IIS, we do not need to configure the base address in the configuration file. This is the base address of the service:

enter image description here

After the deployment is successful, we click on the .svc file to view the service:

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Tried it but it did not help. I need to publish my service. See my above comment. Thanks for the idea though
Do you host the service in IIS? If it is not hosted in IIS, you need to provide the base address in the configuration file.
What should I provide when it asks for a file location when registering in IIS? I tried the bin folder and the folder the .sln is in. (I'm using VS2017 if that matters)
WCF hosting in IIS requires a .svc file. The .svc file contains the implementation class of the service interface. WCF in IIS is equivalent to a web service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.