I've been searching this problem, and I found similar problems posted by other users, but everything I've tried doesn't work, The problem is that I'm using a WCF service hosted on IIS, and a client that try to upload a serialized image on a string, the size of the image is 9mb aprox, everythin else works fine, I can send data without problem except the image.
I have enabled tracelog and the error message says that the MaxReceivedMessageSize exceed
Here is my config on service:
<system.diagnostics>
<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>
<source name="myUserTraceSource"
switchValue="Information, ActivityTracing, All">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<trace autoflush="true" />
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="ErrorSvcLog.svclog" />
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServicioSalud" closeTimeout="10:01:00"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" openTimeout="10:01:00"
receiveTimeout="10:10:00" sendTimeout="10:01:00"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServiceBehavior" name="ServicioSalud">
<endpoint address="" binding="basicHttpBinding" contract="IServicioSalud" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="200000" />
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging
logEntireMessage="true"
logMalformedMessages="false"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="3000"
maxSizeOfMessageToLog="2000"/>
</diagnostics>
</system.serviceModel>
</configuration>
And the client config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServicioSalud" closeTimeout="10:01:00"
openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01: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="4096" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://xxx.xxx.x.xxx:xxxx/wcfservicesalud/Service.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServicioSalud"
contract="IServicioSalud" name="BasicHttpBinding_IServicioSalud" />
</client>
</system.serviceModel>
In your config file you have not assigned the binding configuration you created, so the default values for BasicHttpBinding are being used. You need to explicitly assign the binding you defined (BasicHttpBinding_IServicioSalud) to your endpoint, like this:
<endpoint address="" bindingConfiguration="BasicHttpBinding_IServicioSalud" binding="basicHttpBinding" contract="IServicioSalud" />
Do this for your service config, as the service needs to be set to accept larger data.
This is my version. Make sure you have have the bindingConfiguration specified in the service you want. In my case I have to specify the name basicHttpBinding.
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxBufferSize="64000000" maxReceivedMessageSize="64000000" maxBufferPoolSize="64000000">
<readerQuotas maxDepth="64000000" maxStringContentLength="64000000" maxArrayLength="64000000" maxBytesPerRead="64000000" />
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="WS.Service1Behavior" name="WS.EasyStockWS">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="WS.IEasyStockWS">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
For me, the cause was the fact that in my request I had not set the content type.
Related
I have created WCF and Web Api REST full web services. In this web services i am getting
for Large data transmission.
EX: I have 25 columns and 25000 rows of fetch query in this scenario some times data is coming and some time
this error is coming in both of them.
My WCF Config. Like this
So can anyone suggest me on this.
Try set in web config reader quoata for binding
defualt is small for large transmision
Details : http://msdn.microsoft.com/en-us/library/ms731325(v=vs.110).aspx
Example
<binding name="myLargeBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxArrayLength="2147483647"/>
</binding>
Then don't forget set this bindningConfiguration to endpoint(s)
<endpoint .... binding="basicHttpBinding" bindingConfiguration="myLargeBinding" .... >
For your web.config it should be something like this.
I've created new binding configuration "RESTBinding" and set it to your endpoint.
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" />
<httpRuntime maxRequestLength ="1048576"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"></serviceHostingEnvironment>
<services>
<service behaviorConfiguration="" name="wcfTestHC.TestHC">
<endpoint address="" behaviorConfiguration="RestEndpointBehavior" binding="webHttpBinding" bindingConfiguration="RESTBinding" contract="wcfTestHC.ITestHC" />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RestEndpointBehavior">
<webHttp helpEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" />
<serviceThrottling maxConcurrentCalls="250" maxConcurrentInstances="75" maxConcurrentSessions="50"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="RESTBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxArrayLength="2147483647"/>
</binding>
</webHttpBinding>
<wsHttpBinding>
<binding name="EndpointBehavior" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxArrayLength="2147483647"/>
<reliableSession enabled="True" ordered ="True "/>
</binding>
</wsHttpBinding>
</bindings>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" />
</diagnostics>
</system.serviceModel>
<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>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength ="1073741824"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
</configuration>
If you still getting a error. Maybe problem is somewhere else.
Try insert these settings to your web.config. This will provide you a detailed logging and exceptions details for your service and there we will see what problem is. I've set a location for logs to c:\temp\WCFLoging.svclog, plese change it if you want and I've edited a example of web.config with these settings - copy and paste ready :-)
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" />
</diagnostics>
</system.serviceModel>
and
<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>
Well, until now, I have only one endpoint and the endpoint for the metadata. Then, I use internet explorer for example, and I can see the metadata.
However, when I configure a second endpoint for other contract, I can't get the metadata, so the service does not expose the contract correctly and I can't use the srvice from the client.
My app.config (it is a self host service) is:
<system.serviceModel>
<services>
<service name="GTS.CMMS.Service.Service" behaviorConfiguration="behaviorConfig">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:7997/CMMSHost"/>
<add baseAddress="http://localhost:7998/CMMSHost"/>
</baseAddresses>
</host>
<endpoint address="ServiceCore/"
binding="netTcpBinding"
bindingConfiguration="ServiceCore"
name="ServiceCore"
contract="GTS.CMMS.Service.IService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="ServiceDocumentos/"
binding="ServiceDocumentos"
bindingConfiguration="basicHttpBinding"
name="ServiceDocumentos"
contract="GTS.CMMS.Service.IServiceDocumentos">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="http://localhost:5000/mex" listenUriMode="Explicit" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfig">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
<serviceMetadata/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="ServiceCore" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Buffered" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"
portSharingEnabled="true">
<security mode="None"/>
<readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
<binding name="ServiceDocumentos" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Streamed" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100"
portSharingEnabled="true">
<security mode="None"/>
<readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
</netTcpBinding>
<basicHttpBinding>
<binding name="ServiceDocumentos" messageEncoding="Mtom" transferMode="Streamed" />
<binding name="ServiceCore" messageEncoding="Mtom" transferMode="Buffered" />
</basicHttpBinding>
</bindings>
</system.serviceModel>
Thanks.
I have a problem at hand where I get the message:
"There was no channel that could accept the message with action."
on the server side and
"The message could not be processed. This is most likely because the action."
on the client side.
I am invoking my WCF Service from a Windows service and I have hosted my WCF service in ISS on a server.
All this is working fine on my localhost. I think I am missing something in the configuration.
My Web.config looks like this:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<appSettings>
<add key="FileTransferPath" value="c:\FileServer\"/>
<add key="BackUpFileTransferPath" value="c:\BackedUpFiles\"/>
<add key="DBPath" value="C:\ProjectsSVN\Acso.accdb"/>
</appSettings>
<system.serviceModel>
<services>
<service name="FileTransfer.FileTransfer">
<endpoint address="" binding="wsHttpBinding" contract="FileTransfer.IFileTransfer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:65051/FileTransfer/" />
</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>
<bindings>
<basicHttpBinding>
<binding name="WSHttpBinding_IFileTransfer"
maxReceivedMessageSize="2147483647">
<readerQuotas
maxDepth="64"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="4096"
maxNameTableCharCount="16384"/>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<!--Turn on to log Trace-->
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\logs\FileTransferTraces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
</configuration>
My App.config looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="cs"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ProjectsSVN\Acso.accdb;Persist Security Info=True"
providerName="System.Data.OleDb" />
<add name="csc"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ProjectsSVN\AcsoGPClient.accdb;Persist Security Info=True"
providerName="System.Data.OleDb" />
</connectionStrings>
<appSettings>
<add key="FromEmail" value="abc#igi.com.au"/>
<add key="Subject" value="Your Password"/>
<add key="DBPath" value="C:\Program Files\Default Company Name\GPWindowServiceSetup\AccersoGPClient.accdb"/>
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService11" 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://ws2008.igi.aus/AcsoService/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService11" contract="AccersoService.IService1"
name="BasicHttpBinding_IService11" />
</client>
</system.serviceModel>
</configuration>
Try to make the client binding definition <basicHttpBinding/> an exact copy of the same definition from the service config.
We are getting following exception in the .svclog file generated through system diagnostics config settings at server side.
Exception: System.ServiceModel.ProtocolException
Message: The number of bytes available is inconsistent with the HTTP Content-Length
header. There may have been a network error or the client may be
sending invalid requests.
We have observed that the data sent by WCF client is broken. We came to know about this by viewing the message xml in the .svclog file generated at WCF client side.
Actually we are sending data large data by dividing it into small chunks calling the WCF service method to send data in a loop. Following is the code for the same at WCF client side.
DataTable dtStockDetails = new DataTable("StockDetails");
sqlDataAdapter.Fill(dtStockDetails);
int stockDetailsBatchSize = 100;
DataTable dtStockDetailsBatch = dtStockDetails.Clone();
DataRow dr;
int stockDetailsBatchCount = 0;
int stockDetailsTotalRecords = dtStockDetails.Rows.Count;
while (dtStockDetails.Rows.Count > 0)
{
dr = dtStockDetails.Rows[0];
dtStockDetailsBatch.ImportRow(dr);
dtStockDetailsBatch.AcceptChanges();
dtStockDetails.Rows.Remove(dr);
dtStockDetails.AcceptChanges();
if ((dtStockDetailsBatch.Rows.Count == stockDetailsBatchSize) || (dtStockDetails.Rows.Count == 0))
{
stockDetailsBatchCount++;
sendStockDetailsResult = serviceClient.SendStockDetails(dtStockDetailsBatch);
dtStockDetailsBatch.Clear();
}
}
Now WCF client some times sends 7 batches of data, some times sends 9 batches of data, some times sends 10 batches of data, .... . In all cases lase message(data batch) xml gets corrupted. This behavior is random.
We are not sure why the message xml is getting corrupted and resulting into end of communication. It never sends all batches of data.
Following are config settings:
WCF Service config settings:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service behaviorConfiguration="InventoryServices.InventoryImportServiceBehavior"
name="InventoryServices.InventoryImportService">
<endpoint address="https://www.domain.com/InventoryServices/InventoryImportService.svc" behaviorConfiguration="wsServiceEndpointBehavior"
binding="wsHttpBinding" bindingConfiguration="b1" contract="InventoryServices.IInventoryImportService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://www.domain.com" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="b1" closeTimeout="00:30:00" openTimeout="00:30:00"
receiveTimeout="00:30:00" sendTimeout="00:30:00" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession inactivityTimeout="00:30:00" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate">
</transport>
<message clientCredentialType="UserName" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="wsServiceEndpointBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="InventoryServices.InventoryImportServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<serviceCertificate findValue="XyzClient" x509FindType="FindBySubjectName" />
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="InventoryServices.Helpers.CustomValidator, InventoryServices" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
WCF Client config settings:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"
maxSizeOfMessageToLog="2147483647" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IInventoryImportService"
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="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:30:00"
enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://www.domain.com/InventoryServices/InventoryImportService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IInventoryImportService"
contract="InventoryImportService.IInventoryImportService"
name="WSHttpBinding_IInventoryImportService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing"
propagateActivity="false">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="sharedListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="sharedListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\Program Files\InventoryExportUtilitySetup\servicetrace.svclog"
type="System.Diagnostics.XmlWriterTraceListener" name="sharedListener">
<filter type="" />
</add>
</sharedListeners>
</system.diagnostics>
Can any one please suggest what should we do to resolve this problem?
Thanks in advance.
Looking at your configuration the Reader Quotas settings on Server and Client are different.
Make sure you have large values mostly same on client and server.
Just wanted to know if you have tried sending in any small payload data to make sure that the service is working fine?
I also noticed that you have your security set to "TransportWithMessageCredential" and you have the mex endpoint with mexHttpBinding. I guess that should have been mexHttpsBinding and also your httpGetEnabled attribute is set to true where as it should have been httpsGetEnabled to true.
I am getting an issue with WCF service I have created. Issue is not coming on all clients - i.e. on some systems it is working others not.
Error 1:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Error 2:
On some system the operation contract is not exposed properly. A red symbol is coming across operation contract. And unable to call it using wcftestclient.
Config File:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="ExternalService.Service.MyDashboardService">
<host>
<baseAddresses>
<add baseAddress = "http://****/ExternalService.Service/MyDashboardService/" />
</baseAddresses>
</host>
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="ExternalService.ServiceInterface.IMyDashboardService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
Now the client config I am getting in wcftestclient for Error 1:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyDashboardService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://****/ExternalService.Service/MyDashboardService/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyDashboardService"
contract="IMyDashboardService" name="BasicHttpBinding_IMyDashboardService" />
</client>
</system.serviceModel>
</configuration>
Client Config when service is working:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyDashboardService" 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://****/ExternalService.Service/MyDashboardService/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyDashboardService"
contract="IMyDashboardService" name="BasicHttpBinding_IMyDashboardService" />
</client>
</system.serviceModel>
</configuration>
Please suggest what could be the reason for different behavior of service on different machines.
you should use same bindingConfiguration on both sides clients and service