WCF related - System.ServiceModel.FaultException: The message could not be processed - vb.net

This is similar to: http://social.msdn.microsoft.com/Forums/vstudio/en-US/71c31684-1ce7-4fd9-bf24-674e6dc707bf/the-message-could-not-be-processed?forum=wcf
However, I did not forget an entry like that person did yet I still get the same error.
I get:
System.ServiceModel.FaultException: The message could not be processed. This is most likely because the action 'http://tempuri.org/IBackupServerService/DeleteBySpaceIdProcess' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
Note: I'm hosting the service from a console app on a server and then calling the service from a web app located on another server.
My client web.config file looks like: (Note: the "IP address" and "userPrincipalName" are both fictitious for this posting.)
<!-- Specifies the version of WCF to use. -->
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IBackupServerService" >
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://999.999.999.999:8000/Application/BackupServerServiceLibrary/BackupServerService/BackupServerService"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBackupServerService"
contract="ServiceReference1.IBackupServerService" name="WSHttpBinding_IBackupServerService">
<identity>
<userPrincipalName value="AAAAA5-415-B\jbrown" />
</identity>
</endpoint>
</client>
</system.serviceModel>
My service app.config looks like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="BackupServerServiceLibrary.BackupServerService">
<host>
<baseAddresses>
<add baseAddress = "/BackupServerServiceLibrary/BackupServerService/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding"
contract="BackupServerServiceLibrary.IBackupServerService"
bindingConfiguration="NoSecurity">
<!-- Upon deployment, the following identity element should be removed or replaced
to reflect the identity under which the deployed service runs. If removed,
WCF will infer an appropriate identity automatically. -->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<!-- Metadata Endpoints -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="NoSecurity">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Any ideas?

Related

Using Static WAN IP Address for WCF in IIS

I have set up a WCF service hosted in IIS. The server that it is hosted on does not have a DNS Name (no domain), just an external static WAN IP address.
When I try to connect to the service in either iOS or Windows client using MEX to generate proxies, it uses the domain name which cannot be resolved and fails.
The WSDL document contains links that could not be resolved.
- There was an error downloading 'https://blah.com.au/NimThaiService.svc?xsd=xsd3'.
- The remote name could not be resolved: 'blah.com.au'
How can I change my Web config file or configure IIS so that instead of using the domain name it uses the static IP.
I need the MEX to be https://123.123.123.123/NimThaiService.svc
I've tried to follow directions in other articles. For example one suggests to add <useRequestHeadersForMetadataAddress />. But when I do that I get an error saying that the resource cannot be found.
My Web config file is as follows:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpsGetEnabled="true"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="NimThaiService.Authenticator, NimThaiService" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="NimThaiService.NimThaiService">
<endpoint address="https://mystaticwanipaddress:443/NimThaiService.svc" binding="basicHttpBinding" contract="NimThaiService.INimThaiService" bindingConfiguration="secureHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange">
<identity>
<dns value="mystaticwanipaddress" />
</identity>
</endpoint>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="Basic" />
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
After some more research I managed to fix this by adding an attribute to the serviceMetadata node.
I needed to add the "httpsGetUrl" attribute as follows:
<serviceMetadata httpsGetEnabled="true" httpsGetUrl="http://mystaticwanipaddress/NimThaiService.svc/basic" />

How enable http and https with wcf service?

I need publish a wcf service, and this should be accessed with Http and Https protocols.
I tried to configure this in my server, but the problem with is that only one of this protocols can work.
Is it possible?
This is my Web.config code:
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviorConfiguration">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceBehaviorConfiguration" >
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration" name="TestSvc" contract="ServiceTest.ITest" />
</service>
</services>
It's possible, but in a way you might not expect. You host your service on HTTPS. Then create another site on the same pool. This site is HTTP and it contains only web.config file looking like this
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="https://your_https_url" exactDestination="true" childOnly="false" />
</system.webServer>
</configuration>
Now every time someone tries to use the HTTP site will be automatically redirected to HTTPS.
Try using multiple endpoints for same service one with basicHttpBindind and one with wsHttpBinding
<service name="NorthwindServices.Services.CustomerService"
behaviorConfiguration ="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:7741/NorthwindServices/Services
/CustomerService" />
<add baseAddress="https://localhost:4512/Services/CustomerService" />
</baseAddresses>
</host>
<endpoint address ="" binding="wsHttpBinding"
contract="NorthwindServices.ServiceContracts.ICustomerService"
bindingNamespace = "http://dotnetmentors.com/services/customer" />
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
<endpoint address ="" binding ="basicHttpBinding"
contract ="NorthwindServices.ServiceContracts.ICustomerService"
bindingNamespace = "http://dotnetmentors.com/services/customer" />
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>

Modify Program Using Sync Framework to use WCF

I'm trying to synchronize a client database with a central database. I successfully did that using the Synchronization framework as long as both the client and central database are on the same network. However, I need for this to work with the client being outside the network and the firewall. The firewall prevents communications on port 1433, so I started to explore WCF as an option so port 80 is used.
I tried this and put the WCF service under IIS 7:
http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208
but have gotten this error:
Failed: The caller was not authenticated by the service.
I searched high and low for a solution to this error but have found none. Does anyone know a tutorial on how to use the sync framework over WCF?
Here is the web.config file on the IIS server:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime maxRequestLength="65536" />
<customErrors mode="Off" />
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="WebSyncContract.SqlWebSyncService" name="WebSyncContract.SqlWebSyncService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="WebSyncContract.ISqlSyncContract">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://web-services.hexagroup.us/WebSyncContract.SqlWebSyncService.svc" />
</baseAddresses>
</host>
</service>
<service name="WebSyncContract.SqlSyncProviderProxy" behaviorConfiguration="WebSyncContract.SqlSyncProviderProxy" >
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
<service behaviorConfiguration="WebSyncContract.SyncService" name="WebSyncContract.SyncService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="largeMessageHttpBinding" contract="WebSyncContract.ISyncContract">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<!--<add baseAddress="http://localhost:8080/"/>-->
<add baseAddress="http://web-services.hexagroup.us/WebSyncContract.SqlWebSyncService.svc" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<!-- We are using Server cert only.-->
<binding name="largeMessageHttpBinding" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxArrayLength="2147483647" />
<!--<reliableSession enabled="true" />
<security mode="None" />-->
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="WebSyncContract.SqlWebSyncService">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
<behavior name="WebSyncContract.SqlSyncProviderProxy" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="WebSyncContract.SyncService" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>

Can't Access Net TCP service From WCF Test Client

I'm trying to run two WCF services from within IIS one is a web service and one is a Net TCP Binding Service.
Here is a simulcrum of my Web.config (I've anonymized the service name):
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="ServerService">
<endpoint address="ServerService"
binding="netTcpBinding"
bindingConfiguration=""
name="NetTcpEndPoint"
contract="IServerService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8523/"/>
<add baseAddress="htt://localhost:8523/"/>
</baseAddresses>
</host>
</service>
<service name="MyWebService">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration=""
name="AACCWSEndPoint"
contract="IMyWebService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8523/IMyWebService"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
When I run this in the IDE it opens a page running on port 51953 and I can get the WSDL for the webservice by browsing to http://localhost:51953/WebService.svc?wsdl (Note the port is different).
I can't seem to get the WSDL by changing to port to what I've specified in the webconfig file (8523).
When I point the WcfTestClient app at "net.tcp://localhost:8523/ServerService and it gives me an error saying that it can't access the meta data, which as far as I can see I've configured (the second end point in the service).
What am I doing wrong here?
UPDATE:
I've tried changing the port number on the project properties to 8523 as suggested that didn't seem to work, I've also tried changint the address of the mex endpoint to "ServerService\mex" the test client spent some time churning but then it threw the following error:
Error: Cannot obtain Metadata from
net.tcp://localhost:8523/ServerService If this is a Windows (R)
Communication Foundation service to which you have access, please
check that you have enabled metadata publishing at the specified
address. For help enabling metadata publishing, please refer to the
MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
Error URI: net.tcp://localhost:8523/ServerService Metadata
contains a reference that cannot be resolved:
'net.tcp://localhost:8523/ServerService'. You have tried to create
a channel to a service that does not support .Net Framing. It is
possible that you are encountering an HTTP endpoint. Expected
record type 'PreambleAck', found '72'.
I'm going to keep digging but I'd appreciate any help.
UPDATE 2:
I've changed the mex endpoint to a mexTcpBinding:
Here is the service tag:
<endpoint address="ServerServiceWS"
binding="wsHttpBinding"
bindingConfiguration=""
name="WSEndPoint"
contract="IServerService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexTcpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8523/"/>
<add baseAddress="http://localhost:8523/"/>
</baseAddresses>
</host>
</service>
Still no luck. Just to be sure I am entering the correct url into the tester the Url I am using is:
net.tcp://localhost:8523/ServerService
I've also Tried:
net.tcp://localhost:8523/mex
and
net.tcp://localhost:8523/
All of which give me some variation of the following error:
Error: Cannot obtain Metadata from
net.tcp://localhost:8523/ServerService If this is a Windows (R)
Communication Foundation service to which you have access, please
check that you have enabled metadata publishing at the specified
address. For help enabling metadata publishing, please refer to the
MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
Error URI: net.tcp://localhost:8523/ServerService Metadata
contains a reference that cannot be resolved:
'net.tcp://localhost:8523/ServerService'. You have tried to create
a channel to a service that does not support .Net Framing. It is
possible that you are encountering an HTTP endpoint. Expected
record type 'PreambleAck', found '72'.
UPDATE 3
FWIW I think there might be a bigger problem with my WEb.config Here is what it currently looks like:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="ServerService">
<endpoint address=""
binding="netTcpBinding"
bindingConfiguration="DefaultBindingConfig"
name="NetTcpEndPoint"
contract="IServerService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexTcpBinding"
contract="IMetadataExchange"
bindingConfiguration="mexBinding"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8523/"/>
</baseAddresses>
</host>
</service>
<service name="MyWebService">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration=""
name="MyWSEndPoint"
contract="IMyWebService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"
bindingConfiguration="mexHttpBinding"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8523/MyWebService"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="DefaultBindingConfig"
maxConnections="5"
portSharingEnabled="true" >
</binding>
<binding name="mexBinding"
portSharingEnabled="true">
<security mode="None"></security>
</binding>
</netTcpBinding>
<mexTcpBinding>
<binding name="mexTcpBinding"/>
</mexTcpBinding>
<mexHttpBinding>
<binding name="mexHttpBinding"/>
</mexHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServerServiceBehaviour">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
<behavior name="MexBehaviour">
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
I can browse to the Webservice and that allows me to get the WSDL using ?wsdl but if I put the Adddress http://localhost:8523/MyWebService into the WCF tester it throws an error too.
Error: Cannot obtain Metadata from http://localhost:8523/MyWebService
If this is a Windows (R) Communication Foundation service to which you
have access, please check that you have enabled metadata publishing at
the specified address. For help enabling metadata publishing, please
refer to the MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange
Error URI: http://localhost:8523/MyWebService Metadata contains
a reference that cannot be resolved:
'http://localhost:8523/MyWebService'. An error occurred while
receiving the HTTP response to http://localhost:8523/MyWebService.
This could be due to the service endpoint binding not using the HTTP
protocol. This could also be due to an HTTP request context being
aborted by the server (possibly due to the service shutting down). See
server logs for more details. The underlying connection was closed:
An unexpected error occurred on a receive. Unable to read data from
the transport connection: An existing connection was forcibly closed
by the remote host. An existing connection was forcibly closed by
the remote hostHTTP GET Error URI:
http://localhost:8523/MyWebService There was an error downloading
'http://localhost:8523/MyWebService'. The request failed with HTTP
status 404: Not Found.
I think the issue is either something to do with paths or I'm just putting the wrong URL into the test application. Either that or I've still not configured the meta data correctly.
For the HTTP endpoint, you need to reconfigure the Project Properties so that it starts your web.config defined endpoint at port 8523 if hosted using IIS Express. Use specific port (8523) instead of auto-assigned port (51953).
For the TCP metadata, you need to support a TCP-enabled mex endpoint (mexTcpBinding).
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
The net.tcp and HTTP bindings must be set on different ports on IIS.
It can be tested with the same port or different. It will crash in the first case. Also, you can use whatever port numbers you want. In this case, the TCP port can be changed to 8524. It's just that you cannot use two separate protocols on the same port. On the other hand, the base addresses make sense only for self-hosted services. Here the base address is determined by the URL from IIS.
just try to keep this as it is, and changing your service inside and paste it inside your config file, it should work perfectly.
to test the net.tcp you can use SvcUtil.exe
<system.serviceModel>
<services>
<service name="MyWCFServices.HelloWorldService">
<endpoint
binding="netTcpBinding"
bindingConfiguration="ultra"
contract="MyWCFServices.IHelloWorldService"/>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8086/HelloWorldService.svc" />
<add baseAddress="http://localhost:8081/HelloWorldService.svc" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="ultra"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
portSharingEnabled="false"
transactionFlow="false"
listenBacklog="2147483647" >
<security mode="None">
<message clientCredentialType="None"/>
<transport protectionLevel="None" clientCredentialType="None"/>
</security>
<reliableSession enabled="false"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

Changing WCF service to require SSL

I have a WCF service which was running fine on a http binding. I've tried to update this to use SSL but i am getting the following error:
"Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]."
This only occurs when i set the site to "Require SSL" in IIS 7.5 if I uncheck it it works fine.
Here's my config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior" >
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="WcfService1.Service1">
<host>
<baseAddresses>
<add baseAddress="http://localhost/WcfService1/"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" bindingConfiguration=""
name="wsHttpEndpoint" contract="WcfService1.IService1" />
<endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration=""
name="MexHttpsBindingEndpoint" contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
I've tried allsorts and nothing seems to get me there, any help is greatly appreciated!
Modify your binding configuration:
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security mode="Transport" />
</binding>
</wsHttpBinding>
</bindings>
And reference that configuration in your endpoint by setting its bindingConfiguration attribute to the name of configuration.
<endpoint address="" binding="wsHttpBinding"
bindingConfiguration="wsHttpEndpointBinding"
name="wsHttpEndpoint" contract="WcfService1.IService1" />
You can also delete the host section with base address because it is not used when hosting in IIS.
In addition to changing the binding configuration settings (as Ladislav mentioned)... Change HTTP in the base address to HTTPS.