My client WPF application which reads a big CSV file and creates list of object based on data. Records is almost 40,000 so list of object is 40,000. Now, I tried to send these collection but not able to send to Wcf service though i changed binding attributes of web.config and app.config file. I tried to debug wcf code but nothing happens i.e no exception or control does not move to debug point. For example:
<binding name="BasicHttpBinding_IRulesEngineManagementService"
maxBufferSize="2147483647" maxBufferPoolSize="524288"
maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
I searched in google but did not find solution. I am totally stuck. How can i solve this issue? Any kind of hints/idea/ code sample is appreciable.
Please post your complete web.config.
Typical mistake with settings binding configuration is that you won't set it to your service elements
with bindingConfiguration attribute.
sou you have to have something like this
<service ... >
<endpoint .... binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRulesEngineManagementService" .... >
</service>
If you don't get any exception or even hit a breakpoint that means your service fail before your code was executed at WCF/IIS side
Please set these config to your web.config so you can see a error on this side.
in your system.serviceModel section
<system.serviceModel>
...
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" />
</diagnostics>
....
</system.serviceModel>
and add new element system.diagnostics. It will save your log to c:\temp\WCFLoging.svclog.
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
</switches>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\temp\WCFLoging.svclog" />
</sharedListeners>
</system.diagnostics>
Related
Currently I'm facing a problem trying to use the EWS, the original requirement is to connect to the mail of a specific user, after that, search for a specific folder, search for a mail and then download the attachment to a specific folder to the local machine so that later it can be processed by Integration Services, I don't want to use the EWS Managed API because I don't want to install anything when migrating to the production server, right now my idea is to develop a WCF service that connects to the EWS service through the .asmx uri and that will be able to fulfill my requirement, right now I'm ok connecting to the company's EWS but I have a few doubts:
According to Microsoft: http://msdn.microsoft.com/en-us/library/exchange/bb408524(v=exchg.150).aspx they say you must add a web service reference to your project, although it only mentions VS 2005 and VS 2008 (I'm working with VS 2012), it should automatically creates the class ExchangeServiceBinding which gives you everything you need in order to impersonate an account, my first question is: why I'm not seeing this class added to my project? should I expect this is because I am using VS 2012?
ok, anyway I'm able to use some methods like getPasswordExpirationTime, but when I use the FindFolder method, I'm getting the error: "The account does not have permission to impersonate the requested user.", this is my method:
using (ExchangeServicePortTypeClient exchangeServicePortTypeClient = new ExchangeServicePortTypeClient())
{
exchangeServicePortTypeClient.ChannelFactory.Endpoint.Address = new EndpointAddress("https://email.kraft.com/EWS/Exchange.asmx");
FindFolderResponseType findFolderResponseType = null;
exchangeServicePortTypeClient.FindFolder(
new ExchangeImpersonationType
{
ConnectingSID = new ConnectingSIDType
{
Item = #"gilberto.gutierrez#mdlz.com",
ItemElementName = ItemChoiceType1.PrimarySmtpAddress
}
},
null,
new RequestServerVersion { Version = ExchangeVersionType.Exchange2010_SP2 },
null,
new FindFolderType
{
FolderShape = new FolderResponseShapeType
{
BaseShape =
DefaultShapeNamesType.Default
}
}, out findFolderResponseType);
}
I have tried to set the credentials through this:
exchangeServicePortTypeClient.ClientCredentials.Windows.ClientCredential.UserName
exchangeServicePortTypeClient.ClientCredentials.Windows.ClientCredential.Password
exchangeServicePortTypeClient.ClientCredentials.Windows.ClientCredential.Domain
exchangeServicePortTypeClient.ChannelFactory.Credentials.Windows.ClientCredential.UserName
exchangeServicePortTypeClient.ChannelFactory.Credentials.Windows.ClientCredential.Password
exchangeServicePortTypeClient.ChannelFactory.Credentials.Windows.ClientCredential.Domain
with no luck :(.
by the way, this is my wcf config file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--Diagnostics section, we will only catch error and warning in production-->
<system.diagnostics>
<sources>
<source propagateActivity="true" name="System.ServiceModel" switchValue="Error, Warning">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add type="System.Diagnostics.DefaultTraceListener" name="SellOut.ExchangeWcfService">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Error, Warning">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add type="System.Diagnostics.DefaultTraceListener" name="SellOut.ExchangeWcfService">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\Users\LFH2623\Documents\SellOut\SellOut\SellOut.Hosts.ExchangeWcfService\SellOut.ExchangeWcfService_web_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Callstack">
<filter type="" />
</add>
<add initializeData="C:\Users\LFH2623\Documents\SellOut\SellOut\SellOut.Hosts.ExchangeWcfService\SellOut.ExchangeWcfService_web_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Callstack">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
<!--Framework Section-->
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<!--Web section-->
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="2147483646" />
</system.web>
<!--Web server section-->
<system.webServer>
<directoryBrowse enabled="false"/>
<defaultDocument enabled="true"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<!--WS section-->
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true"
maxMessagesToLog="10000"
logMessagesAtTransportLevel="true"
logMessagesAtServiceLevel="True"
logEntireMessage="true"/>
<endToEndTracing activityTracing="false" />
</diagnostics>
<!--For the ExchangeWebService we will aply the following service and endpoint behaviors-->
<behaviors>
<serviceBehaviors>
<behavior name="ExchangeWebService">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" httpHelpPageEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
<serviceTimeouts transactionTimeout="01:00:00" />
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" maxConcurrentInstances="100"/>
<serviceDiscovery>
<announcementEndpoints>
<endpoint kind="udpAnnouncementEndpoint"></endpoint>
</announcementEndpoints>
</serviceDiscovery>
</behavior>
</serviceBehaviors>
<!-- Define the corresponding scope for the clients to find the service through resolve message -->
<endpointBehaviors>
<behavior name="ExchangeWebService">
<endpointDiscovery enabled="true">
<scopes>
<add scope="http://SellOut.ExchangeWcfService/"/>
</scopes>
</endpointDiscovery>
</behavior>
</endpointBehaviors>
</behaviors>
<!-- In case you want to scale this service -->
<standardEndpoints>
<!-- We allow the service to be discoverable through the network in an adhoc architecture through UDP -->
<udpDiscoveryEndpoint>
<standardEndpoint name="adhocDiscoveryEndpointConfiguration"
discoveryMode="Adhoc"
discoveryVersion="WSDiscovery11"
maxResponseDelay="00:00:10">
</standardEndpoint>
</udpDiscoveryEndpoint>
<!-- We allow the service to be discoverable through the network in a managed architecture -->
<discoveryEndpoint>
<standardEndpoint name="managedDiscoveryEndpoint" discoveryMode="Managed" maxResponseDelay="00:01:00"/>
</discoveryEndpoint>
<!-- We announce the service with hello & bye -->
<announcementEndpoint>
<standardEndpoint name="udpAnnouncementEndpointConfiguration"
discoveryVersion="WSDiscovery11" />
</announcementEndpoint>
</standardEndpoints>
<!--All the Kraft's clients are .net, so we will use the proprietary binary message encoding to reduce the message's size -->
<bindings>
<customBinding>
<binding name="wsHttpBindingBynaryEncoding"
closeTimeout="00:10:00"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00">
<binaryMessageEncoding>
<readerQuotas maxDepth="32"
maxStringContentLength="5242880"
maxArrayLength="2147483646"
maxBytesPerRead="4096"
maxNameTableCharCount="5242880" />
</binaryMessageEncoding>
<httpTransport
transferMode="Buffered"
maxBufferPoolSize="2147483646"
maxReceivedMessageSize="2147483646">
</httpTransport>
</binding>
</customBinding>
<basicHttpBinding>
<binding name="KraftEWS" messageEncoding="Text" transferMode="Buffered">
<security mode="Transport">
<transport clientCredentialType="Windows" proxyCredentialType="Windows"></transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<!-- We reference the Kraft EWS -->
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="KraftEWS"
contract="KraftEWS.ExchangeServicePortType"
name="ExchangeServiceBinding_ExchangeServicePortType">
</endpoint>
</client>
<!--Services section-->
<services>
<service name="SellOut.Services.Exchange.ExchangeWebService" behaviorConfiguration="ExchangeWebService">
<endpoint name="rules"
address="rules"
binding="customBinding"
bindingConfiguration="wsHttpBindingBynaryEncoding"
behaviorConfiguration="ExchangeWebService"
contract="SellOut.Contracts.Exchange.IExchangeRulesContract"/>
<endpoint name="udpDiscovery"
kind="udpDiscoveryEndpoint"
endpointConfiguration="adhocDiscoveryEndpointConfiguration" />
<endpoint name="mex"
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
another thing to mention, in this config:
<basicHttpBinding>
<binding name="KraftEWS" messageEncoding="Text" transferMode="Buffered">
<security mode="Transport">
<transport clientCredentialType="Windows" proxyCredentialType="Windows"></transport>
</security>
</binding>
</basicHttpBinding>
if I remove the part client credential type "Windows", when trying to run the service the exception is :
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
can you guys give me a hand.
Thanks in advice.
I highly suggest that you use the EWS Managed API for this. I don't understand what you mean when you state that you don't want to install anything on the production server since you will have to install the WCF service on your production server, along with the object model created by the Add Web Service reference project. But, it looks like you got passed this part, so let's move on....
Excellent, good to know that you could call getPassowrdExpirationTime. Thank you for providing me that info.
The reason why you get the message "The account does not have permission to impersonate the requested user" is because the account that runs your WCF service doesn't have impersonation rights to the mailbox. You will need to setup Exchange impersonation before your service account can access the user's account. Once your service has credentials that Exchange can lookup in AD (which it already does), and it has rights to impersonate your users (which is on your TODO list), your code should work since authentication is done based on the service account's identity.
All parts of your question after your code example are not in scope. You don't need to make any changes to the web.config (at least I don't think so). I assume that you are testing against an on-premise server since the Auth schemes were Negotiate and NTLM.
With regards,
The article you linked to
The server did not provide a meaningful reply this might be caused by
a contract mismath, a premature session shutdown or an internal server
error
Hey, I got an exception after calling a wcf service. I know this exception can get found a lot on stackoverflow, but I have a special behaviour. I also tried nearly all solution which are recommended, without success...
My project does the following: The module is like a normal chat, a wpf and asp usercontrol calls the service every 5 seconds and gets the online users. this normally worked fine on my windows 7 workstation. After I started to develope software on my new workstation with win 8 on it, I got this exception. The IIS Configuration are still the same. After the first user starts to frequently call the service everything works, until a second user calls the same service the exception above shows up.
I set up a testmachine on win 7 and look what happens... Everything works again... I don't have a clue what to do ...
Service web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchName="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="myUserTraceSource" switchName="Information, ActivityTracing">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="hi5.PSA.ServiceLog.svclog" />
</sharedListeners>
</system.diagnostics>
<appSettings>
<add key="Log4NetPath" value="config.log4net" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
<!-- that many MB should be enough :) -->
<httpRuntime maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPmiLookup" />
</basicHttpBinding>
</bindings>
<services>
<service name="SolutionName.ChatService" behaviorConfiguration="chatServiceBehavior">
<endpoint address="" binding="wsDualHttpBinding" contract="SolutionName.contracts.Chat.IChatManager" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="chatServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/Users.csdl|res://*/Users.ssdl|res://*/Users.msl;provider=System.Data.SqlClient;provider connection string="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI;MultipleActiveResultSets=True"
" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
Client app.config:
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IChatManager" 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">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/SolutionName/ChatService.svc" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IChatManager" contract="hi5.medview.server.contracts.Chat.IChatManager" name="WSDualHttpBinding_ChatManager">
<identity>
<servicePrincipalName value="host/MyName"/>
</identity>
</endpoint>
</client>
Does anyone has any idea. The thing which makes me crazy is that, the service works fine for the first user who is calling it, but after a second user calls it, the damn thing doesn't work anymore...
Please help...
Thx
Here is my Web.config on Windows Azure Services Project
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
</configSections>
<!-- To collect diagnostic traces, uncomment the section below or merge with existing system.diagnostics section.
To persist the traces to storage, update the DiagnosticsConnectionString setting with your storage credentials.
To avoid performance degradation, remember to disable tracing on production deployments.
<system.diagnostics>
<sharedListeners>
<add name="AzureLocalStorage" type="NutriLeaf.Services.AzureLocalStorageTraceListener, NutriLeaf.Services"/>
</sharedListeners>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
</sources>
</system.diagnostics> -->
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="true" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
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=""/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<!-- 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>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
<connectionStrings>
<remove name="LocalSqlServer" />
<add connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" name="LocalSqlServer" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
and Here's the Exception I get on my Windows Phone 7 client
For TransferMode.Buffered, MaxReceivedMessageSize and MaxBufferSize must be the same value.
Parameter name: bindingElement
I've even tried setting the TransferMode="Streamed" but this didnot help, I get the same exception. Could you please help me out. Am I missing the parts of the Web.config file?
Please help!
The problem is probably being generated on the client. Check your ServiceReferences.ClientConfig file on your WP7 app and check the bindings.
They should look like this:
<bindings>
<basicHttpBinding>
<binding name="{YOUR SERVICE NAME HERE"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
You need to make sure that the maxBufferSize and maxReceivedMessageSize are the same as those values in your server config.
I encountered the same issue. I don't know whether this is a bug in the WP7 Silverlight runtime, however it worked properly if the binding was rather defined in code instead of the ServiceReferences.ClientConfig. Something like this:
var client = new MyServiceClient(
new BasicHttpBinding( BasicHttpSecurityMode.None )
{
MaxReceivedMessageSize = 2147483647,
MaxBufferSize = 2147483647
},
new EndpointAddress( yourAddress ) );
I couldn't figure out the reason for this yet.
Error :
Could not find default endpoint element that references contract
'LDServiceHost.ILDService' 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.
App.Config :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\_Demos\EF Code Samples\EFLayers\LDPresentation\app_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="C:\_Demos\EF Code Samples\EFLayers\LDPresentation\app_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ILDService" 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" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<client>
<endpoint address="http://localhost:8732/Design_Time_Addresses/LibraryService/LDService/"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ILDService"
contract="LDServiceHost.ILDService" name="WSHttpBinding_ILDService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
How to solve?
Your configuration is in a library project. Config files are application not library specific in .NET so the config needs to be in in the .exe not in the DLL
Copy the system.serviceModel section of your DLLs config into a config file for your application and it should find it OK
Btw: Its generally better to keep a question all in one place rather than add links to external sites - these have a habit of getting out of sync with SO and so the question ends up not making much sense
I've got an error while updating WCF service reference in Visual Studio 2010:
There was an error downloading 'https://192.16.0.76/MyService.svc'.
The request was aborted: Could not create SSL/TLS secure channel.
Metadata contains a reference that cannot be resolved: 'https://192.16.0.76/MyService.svc'.
The HTTP request was forbidden with client authentication scheme 'Anonymous'.
The remote server returned an error: (403) Forbidden.
Two weeks ago reference update worked fine and nothing was changed in web.config file. Now I can't update service reference and add new features to the Silverlight application. I've looked for answer on the Internet and most people advice to check certificates on the developer's pc. I haven't canged any certificates fon my pc and I also add ny certificate to the local machine store as well. Maybe I should change the default certicate for Visual Studio but I can't find how to do this.
Here is my web.config file :
<source name="System.ServiceModel"
switchValue="Error,Warning"
propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener"
name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging"
switchValue="Warning, Error">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
<httpRuntime executionTimeout="600" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="MyForm.Web.MyService.customBinding0"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
openTimeout="00:10:00" closeTimeout="00:10:00">
<binaryMessageEncoding/>
<httpsTransport maxReceivedMessageSize="2147483647" />
</binding>
</customBinding>
<wsHttpBinding>
<binding name="CertificateWithTransport"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
openTimeout="00:10:00" closeTimeout="00:10:00"
maxReceivedMessageSize="2147483647">
<security mode="Transport" >
<transport clientCredentialType="Certificate" />
</security>
<readerQuotas maxDepth="2640000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</wsHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ServiceBehavior" name="MyForm.Web.MyService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="MyForm.Web.MyService" />
</service>
</services>
<diagnostics >
<messageLogging logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
/>
</diagnostics>
Any help will be appreciated.
[Upd] It seems that it can be caused by problems with certificate on my pc. How can I choose the certificate that will be used for https connection to the web service ? I've found similar topics on the internet but there were no solutions for it.
Going through WCF – 2 Way SSL Security using Certificates , might help you.