I am trying to setup a simple WCF web service with wsHTTPBinding and using a custom Username.
I have the service on a remote server setup with a self signed cert on a different port.
eg: https://service.myserice.com:442/service1.svc
For some reason the client seems to default to windows security even though I hjave set it up as UserName Security.
Here is my web Service config file:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<services>
<service name="AutoSenderWCF.Service1" behaviorConfiguration="Behavior1">
<host>
<baseAddresses>
<add baseAddress="https://service.autosender.com.au:442/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" bindingName="TransportBinding" contract="AutoSenderWCF.IService1"></endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="TransportBinding">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Behavior1">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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"/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="AutoSenderWCF.CustomValidator, AutoSenderWCF"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
and my client code (notic ethe security=windows)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="TransportBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://service.autosender.com.au/Service1.svc"
binding="wsHttpBinding" bindingConfiguration="TransportBinding_IService1"
contract="ServiceReference1.IService1" name="TransportBinding_IService1">
<identity>
<servicePrincipalName value="host/wserver" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
It is clearly specified to use Windows in your Client config:
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
Copy that section from Server config.
I beleive i have solved it:
this line.
<endpoint address="" binding="wsHttpBinding" bindingName="TransportBinding" contract="AutoSenderWCF.IService1"></endpoint>
it should not be bindingName it should be bindingConfiguration
Related
We have a service
RENEWAL (service run in cl-app1) using a service "UQPDF" (using https://abc/Html2Pdf.svc in server cl-web1)
when I try to publish RENEWAL with same content but a staging version of
it in cl-app2 using a staging service "UQPDF" (using https://abc-staging/Html2Pdf.svc in server cl-web2)
there is no error for production which is the one in cl-app1 and call cl-web1 pdf service,
and no problem running locally for staging RENEWAL.
the only problem is when I publish it in app2 using https://abc-staging/Html2Pdf.svc.
it throws the following exception
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Could not find default endpoint element that references contract 'EmailToPdf_Staging.IHtml2PdfService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
AppConfig of Renewal
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IHtml2PdfService" maxBufferPoolSize="20000000"
maxReceivedMessageSize="20000000" allowCookies="true">
<readerQuotas maxDepth="32" maxStringContentLength="200000000"
maxArrayLength="200000000" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="false"
establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://abc/Html2Pdf.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHtml2PdfService"
contract="EmailToPdf.IHtml2PdfService" name="WSHttpBinding_IHtml2PdfService" />
<endpoint address="https://abc-staging/Html2Pdf.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHtml2PdfService"
contract="EmailToPdf_Staging.IHtml2PdfService" name="WSHttpBinding_IHtml2PdfService" />
</client>
</system.serviceModel>
UQPDF Webconfig
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IHtml2PdfService" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="6553600"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="65536000" maxArrayLength="65536000" maxBytesPerRead="4096"
maxNameTableCharCount="1638400" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None"
negotiateServiceCredential="false"
establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="Ubiquity.uSuite3.PdfServices.Html2PdfService" behaviorConfiguration="uqpdf.ServiceBehavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHtml2PdfService"
contract="Ubiquity.uSuite3.PdfServices.IHtml2PdfService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="uqpdf.ServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
I suspect that your client did not find your contract through your configuration file.You can refer to my configuration.
Here is my demo:
<client>
<endpoint address="http://localhost:8012/ServiceModelSamples/service"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="Client4.IService1" name="BasicHttpBinding_Client4" />
<endpoint address="http://localhost:8012/ServiceModelSamples/service"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="Client2.IService1" name="BasicHttpBinding_Client2" />
</client>
This is the configuration file of the endpoint,I suggest you do not set their names to the same.
ChannelFactory<Client4.IService1> Client4 = new ChannelFactory<Client4.IService1>("BasicHttpBinding_Client4");
Client4.IService1 chanel4 = Client4.CreateChannel();
ChannelFactory<Client2.IService1> Client2 = new ChannelFactory<Client2.IService1>("BasicHttpBinding_Client2");
Client2.IService1 chanel2 = Client2.CreateChannel();
We create different channels according to different endpoints to call services.
I a have a problem, my client calls a Wcf Service via Net.Tcp.
In a Cycle after almost 200 calls, the service remains locked for approximately 10 minutes, and blocks any other client working with net.tcp protocol.
I Have other clients who call the wcf service via Https, these ones continue to work without problems.
What kind of misconfiguration can be?
Thanks!
here is my web.config
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="AttoCreditoConnection" connectionString="MyConnectionstring" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5.2"/>
<pages controlRenderingCompatibilityVersion="4.0"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="LargeList" name="AttoCredito.AttoCreditoBiz.AttoCreditoWcf">
<endpoint address="tcp" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
name="AttoCreditoNetTcp" contract="AttoCredito.AttoCreditoBiz.IAttoCreditoWcf" />
<endpoint binding="wsHttpBinding" bindingConfiguration="TransportSecurityBinding"
name="AttoCreditoWcfHttp" contract="AttoCredito.AttoCreditoBiz.IAttoCreditoWcf" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:808" />
<add baseAddress="https://localhost:443" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAttoLegacyWcf" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxBufferSize="10000000" maxReceivedMessageSize="10000000"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="TransportNetTcpBinding" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="50" maxBufferPoolSize="524288"
maxBufferSize="10000000" maxConnections="50" maxReceivedMessageSize="10000000">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:30:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="DocumentaleNetTcp">
<security mode="None" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="TransportSecurityBinding" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="10000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="10000000"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:30:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="false"
establishSecurityContext="false" />
</security>
</binding>
<binding name="DocumentaleHttp">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/AttoLegacy/AttoLegacyWcf.svc"
behaviorConfiguration="LargeList" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IAttoLegacyWcf" contract="AttoLegacyHost.IAttoLegacyWcf"
name="BasicHttpBinding_IAttoLegacyWcf" />
<endpoint address="net.tcp://localhost/AnagraficaBiz/AnagraficaSrv.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AnagraficaHost.IAnagraficaSrv" name="AnagraficaNetTcp" />
<endpoint address="net.tcp://localhost/AttoBiz/AttoExtraction.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AttoHost.IAttoExtraction" name="AttoNetTcp" />
<endpoint address="net.tcp://localhost/ContoCorrenteBiz/ContoCorrenteSrv.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="CcHost.IContoCorrenteSrv" name="ContoCorrenteNetTcp" />
<endpoint address="net.tcp://localhost/ContrattoBiz/ContrattoWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="ContrattoHost.IContrattoWcf" name="ContrattoNetTcp" />
<endpoint address="net.tcp://localhost/MembershipBiz/Membership.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="MembershipHost.IMembership" name="MembershipNetTcp" />
<endpoint address="net.tcp://localhost/ToponomasticaBiz/Toponomastica.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="TopoHost.IToponomastica" name="ToponomasticaNetTcp" />
<endpoint address="net.tcp://localhost/CreditoBiz/CreditoWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="CreditoHost.ICreditoWcf" name="CreditoNetTcp" />
<endpoint address="net.tcp://localhost/EnteDebitoreBiz/EnteDebitoreWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="EnteDebitoreHost.IEnteDebitoreWcf" name="EnteDebitoreNetTcp" />
<endpoint address="net.tcp://localhost/AciBiz/AciBiz.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="AciHost.IAciBiz" name="AciBizNetTcp" />
<endpoint address="net.tcp://localhost/DocumentaleBiz/DocumentaleWcf.svc/tcp"
behaviorConfiguration="LargeList" binding="netTcpBinding" bindingConfiguration="TransportNetTcpBinding"
contract="DocumentaleHost.IDocumentaleWcf" name="DocumentaleNetTcp" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="LargeList">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="LargeList">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
<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>
I have a WCF Service hosting in web site IIS, in Windows Server 2012.
Site Bindings has only
https myhostname.labsoa 443
I call URL in IExplorer https://myhostname.labsoa/RoutingService.svc
I want ONLY call to Wcf Service using https
Note: replace real value by myhostname.labsoa
I get the message error:
Could not find a base address that matches scheme http for the
endpoint with binding WSHttpBinding. Registered base address schemes
are [https]
In my WCF Service host, I have this configuration files:
web.config
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<customErrors mode="Off"></customErrors>
</system.web>
<system.serviceModel>
<bindings configSource="Config\system.serviceModel.bindings.config"/>
<services configSource="Config\system.serviceModel.services.config"/>
<behaviors configSource="Config\system.serviceModel.behaviors.config"/>
<client configSource="Config\system.serviceModel.client.config"/>
<routing configSource="Config\system.serviceModel.routing.config"/>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="false"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Config\system.serviceModel.behaviors.config
<behaviors>
<serviceBehaviors>
<behavior name="routingData">
<serviceMetadata httpGetEnabled="True"
httpsGetEnabled="true" />
<routing filterTableName="routingTable1" routeOnHeadersOnly="false" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
Config\system.serviceModel.bindings.config
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Default" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBinding_Default" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Config\system.serviceModel.services.config
<services>
<service behaviorConfiguration="routingData"
name="System.ServiceModel.Routing.RoutingService">
<host>
<baseAddresses>
<add baseAddress="https://myhostname.labsoa/RoutingService.svc"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<endpoint
address="/Contacto"
binding="wsHttpBinding"
contract="System.ServiceModel.Routing.IRequestReplyRouter"
name="ContactoRouting"
bindingConfiguration="wsHttpBinding_Default"
/>
Any suggestions about it?
Your endpoing configuration doesnt have bindinginConfiguration.
Following configuration
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
should be
<endpoint address=""
binding="wsHttpBinding"
name="reqReplyEndpoint"
bindingConfiguration="wsHttpBinding_Default"
contract="System.ServiceModel.Routing.IRequestReplyRouter" />
I have a WCF Service with only the xml configuration file and the .exe (so not the complete solution). Can i make existing endpoints secure with https?
If so, how can i do this and how can i connect to it with my client which will be on another pc in the network?
this will be my service xml config:
my binding:
<wsHttpBinding>
<binding
name="HighQuotaWSHttpBinding"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
bypassProxyOnLocal="true"
maxBufferPoolSize="2147483647"
useDefaultWebProxy="false"
maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
my endpoint:
<service
behaviorConfiguration="WebDataServiceBehaviour"
name="Humiq.Integral.WebDataService.Impl.ServiceLayer.WcfLibrary.WebDataService">
<endpoint
address="WebDataService"
binding="wsHttpBinding" bindingConfiguration="HighQuotaWSHttpBinding"
contract="Humiq.Integral.WebDataService.Intf.ServiceLayer.IWebDataService"
name="WebDataServiceHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange"
name="mexManagement" />
<host>
<baseAddresses>
<add baseAddress="http://mylocalip:9650/" />
<add baseAddress="https://mylocalip:9651/" />
</baseAddresses>
</host>
</service>
behaviour:
<behaviors>
<serviceBehaviors>
<!-- Behavior for WebserviceData interface -->
<behavior name="WebDataServiceBehaviour">
<!-- Set throttling of (concurrent) cals -->
<serviceThrottling
maxConcurrentCalls="100"
maxConcurrentSessions="100"
maxConcurrentInstances="100"/>
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpsGetEnabled="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" />
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
</behavior>
</serviceBehaviors>
</behaviors>
And this is my client:
<bindings>
<wsHttpBinding>
<binding name="WebDataServiceHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Basic" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://mylocalip:9651/WebDataService" binding="wsHttpBinding"
bindingConfiguration="WebDataServiceHttpBinding" contract="wcf1.IWebDataService"
name="WebDataServiceHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
you need to define the port to use ssl on windows.
it is done with the netsh command, you can read its help:
netsh http add sslcert ipport=0.0.0.0:8732 certhash=4745537760840034c3dea27f940a269b7d470114 appid={00112233-4455-6677-8899-AABBCCDDEEFF}
At server I have web.config to my application:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
</appSettings>
<connectionStrings>
</connectionStrings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2097152000" maxBufferPoolSize="524288000" maxReceivedMessageSize="2097152000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="524288000"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Server.FileServer.Service" behaviorConfiguration="Server.FileServer.Service1Behavior">
<host>
<baseAddresses>
<add baseAddress="http://192.168.1.217/FileServer/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address="" contract="Server.FileServer.IService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService">
<!--
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 -->
<!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
<!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Server.FileServer.Service1Behavior">
<!-- 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>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<compilation debug="true" />
<httpRuntime maxRequestLength="2097151" executionTimeout="1000" />
<customErrors mode="RemoteOnly" />
</system.web>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
But when I check it by wcf test client I have:
xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://SOMEADRESS.pl/FileServer/Server.FileServer.Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
contract="IService" name="BasicHttpBinding_IService" />
</client>
</system.serviceModel>
</configuration>
As you can see parameters of binding are not the same
Any ideas ?
Binding parameters such as the buffer size do not automatically propagate from server to client when you create a service reference. You will have to adjust hem manually on the client side as well.
Was that the question? It's a little unclear to me what the problem is exactly.
I think Thorarin is right, some information can't be propagated to client from server.
Checkout here http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/dde72fbe-e741-48fd-a9e1-253800d5227a