I have been trying to deploy a simple Sync Service in .NET 3.5 in a production IIS server (Made it using the WCF Service Library of VS2008). While deploying and testing it, it has thrown the following error:
"Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]."
And this is the web.config
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MobileSyncServiceLibrary.AdventureWorksSyncService" behaviorConfiguration="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<endpoint address="http://194.165.0.8:80/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.svc" binding="basicHttpBinding" contract="MobileSyncServiceLibrary.IAdventureWorksSyncContract" bindingConfiguration="basicHttpBindingConfiguration"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<defaultDocument>
<files>
<remove value="Default.htm" />
<remove value="Default.asp" />
<remove value="index.htm" />
<remove value="index.html" />
<remove value="iisstart.htm" />
<remove value="default.aspx" />
<add value="MobileSyncServiceLibrary.AdventureWorksSyncService.svc" />
</files>
</defaultDocument>
</system.webServer>
I have already done the solution pointed out in most posts about this question:
Setting security mode=None
Setting httpsGetEnabled="false"
All answers that I have seen, point to this two settings, but I have not been able to fix the error on the configuration.
Any ideas on what Im missing or what do i need to change? This is the current exception the service is throwing.
[ServiceActivationException: The service '/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.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 BasicHttpBinding. Registered base address schemes are [https]..] System.Runtime.AsyncResult.End(IAsyncResult result) +594083 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +238 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +327 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92
This are the current bindings on the site.
Ok. Found the solution. I misread the multiple binding solution.
I read the following section as telling the site to which binding i was pointing the service.
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
When it is the exact opposite according to this answser.
I was causing the problem, the service was being redirected to the https binding
So i changed the prefix to https://194.165.0.8:443 to filter out the https and send it to the http connection.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.