How to generate Proxy for WCF Service - c#

I have some legacy code here, which has a WCF Service.
The service is called by a client through a generatedProxy.cs
I thought it should be simple and wanted to generate my own
proxy by using svcutil.exe, but I get lots of different errors,
depending on what I try (using running exe for download, using
assembly, using webconfig). For example the svcutil tells me
that the service may not publish metadata (seems to me that
this is not true).
the webconfig has:
<serviceMetadata httpGetEnabled="true"/>
And it has a multisite binding
How can I generate such a proxy? Want to change some things in the contracts
and then have a current version of the proxy generated.
At the moment I have no service reference, as it has the some errors
when adding one as the svcutil does.
Any ideas?
-edit-
The services are published through a selfhosted service, quite similar to
the one in the WCF examples in the msdn. There are the endpoints for
multiple services, which are implemented in dlls.
-edit 2-
Here is the app.config of the self hosting service
I have replaced some names, just to make it less special.
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="PersonDataModelContainer" connectionString="metadata=res://*/PersonDataModel.csdl|res://*/PersonDataModel.ssdl|res://*/PersonDataModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|DataDirectory|\PersonDatabase.sdf"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<system.serviceModel>
<bindings>
<netMsmqBinding>
<binding name="TransactionalNoSecurity" durable="true" exactlyOnce="true" maxReceivedMessageSize="2147483647" maxRetryCycles="1" receiveRetryCount="20" retryCycleDelay="00:05:00">
<security mode="None"></security>
</binding>
</netMsmqBinding>
<basicHttpBinding>
<binding name="TransportSecurity" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</basicHttpBinding>
<ws2007HttpBinding>
<binding name="NoSecurity" transactionFlow="true" maxReceivedMessageSize="200000" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="None"></security>
</binding>
<binding name="UNMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="UserName" establishSecurityContext="true"/>
</security>
</binding>
<binding name="CertMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Certificate" establishSecurityContext="true"/>
</security>
</binding>
<binding name="DomainMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Windows" establishSecurityContext="true"/>
</security>
</binding>
<binding name="RM_NoSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<reliableSession enabled="true" ordered="false"/>
<security mode="None"></security>
</binding>
</ws2007HttpBinding>
<netTcpBinding>
<binding name="NoSecurity" transactionFlow="true">
<security mode="None"></security>
</binding>
<binding name="DomainMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
<binding name="CertMessageSecurity" transactionFlow="true" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
<security mode="Message">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="True" policyVersion="Policy15"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MessagePlatform.LoggingService.GeneralLoggingService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/"/>
</baseAddresses>
</host>
<endpoint address="Logging" binding="basicHttpBinding" name="LoggingService" contract="MessagePlatform.LoggingService.Contracts.ILoggingService"/>
</service>
<service name="MessagePlatform.GatewayService.GeneralGatewayService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/"/>
</baseAddresses>
</host>
<endpoint address="gateway" binding="basicHttpBinding" name="GatewayService" contract="MessagePlatform.GatewayService.Contracts.IGatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db2GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb2GatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db1GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb1GatewayService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<client>
<endpoint name="LoggingServiceEP" address="http://localhost/Logging" binding="basicHttpBinding" contract="MessagePlatform.LoggingService.ILoggingService">
</endpoint>
<endpoint name="GatewayServiceEP" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IGatewayService">
</endpoint>
<endpoint name="GatewayServiceDb2" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IDb2GatewayService">
</endpoint>
<endpoint name="GatewayServiceDb1" address="http://localhost/gateway" binding="basicHttpBinding" contract="MessagePlatform.GatewayService.IDb1GatewayService">
</endpoint>
</client>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
</startup>
</configuration>

You also need to enable the Metadata Exchange Endpoint so you can create a new proxy:
<service name="MessagePlatform.GatewayService.GeneralGatewayService" behaviorConfiguration="SimpleServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/"/>
</baseAddresses>
</host>
<endpoint address="gateway" binding="basicHttpBinding" name="GatewayService" contract="MessagePlatform.GatewayService.Contracts.IGatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db2GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb2GatewayService"/>
<endpoint address="gateway" binding="basicHttpBinding" name="Db1GatewayService" contract="MessagePlatform.GatewayService.Contracts.IDb1GatewayService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
and run
svcutil http://localhost:8000/mex

Related

Windows Service (413) Request Entity Too Large

Please do not delete this as a duplicate
I have a windows service that I am passing an array of objects to. When the array contains less than 150 objects it works successfully. When I pass more than 150 objects I get the (413) Request Entity Too Large Error.
I have tried the feedback from other articles regarding readerQuotas node values and maxReceivedMessageSize, but I am still receiving the error and I am stuck as to what I am still doing wrong.
Here is the app.config of the windows service:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="wsHttpBindingNoSecurity" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport clientCredentialType="None"/>
<message establishSecurityContext="false" negotiateServiceCredential="false"/>
</security>
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</wsHttpBinding>
<mexHttpBinding>
<binding name="mexHttpBinding"/>
</mexHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="SE.Responder.Integration.AmiOutboundService.AmiObService" behaviorConfiguration="Service1Behavior">
<endpoint address="wsHttp" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingNoSecurity" contract="SE.Responder.Integration.AmiOutboundService.IAmiObService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="basicHttp" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" name="basicHttp" contract="SE.Responder.Integration.AmiOutboundService.IAmiObService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/SE.Responder.Integration.AmiOutboundService/AmiObService/"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
And here is the app.config of the executable that passes the data to the windows service:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IAmiObService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" >
<readerQuotas maxDepth="2000000000"
maxStringContentLength="2000000000"
maxArrayLength="2000000000"
maxBytesPerRead="2000000000"
maxNameTableCharCount="2000000000" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8732/SE.Responder.Integration.AmiOutboundService/AmiObService/AmiOBService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAmiObService" contract="AmiObService.IAmiObService" name="WSHttpBinding_IAmiObService" />
</client>
After reviewing the source code for the application that was having this issue, I found that the wcf service was being hosted in the C# code. I then applied the fix in code as described in the following stack overflow issue,
MaxReceivedMessageSize in WCF Hosted Service in console application,
specifically the following lines,
var wsHttpBinding = new WSHttpBinding();
wsHttpBinding.MaxReceivedMessageSize = int.MaxValue;
Service.AddServiceEndpoint(typeof(TInterfaceContract), wsHttpBinding, EndpointAddress);
which corrected the issue.

Web Service Endpoint identity error

I have a problem with our web service. We didn't make the web service so we don't know what's really happening. At first, it works in our server but sometimes it doesn't which causes us to restart it. Then now, it shows error message:
Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint.
But our web service is not even secured! Our web config is:
<configuration>
<connectionStrings>
<add name="DefaultConnection" connectionString="Server=;Database=;User ID=;Password=;Trusted_Connection=False;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime executionTimeout="3600000" maxRequestLength="102400" />
</system.web>
<appSettings>
<add key="baseAddress" value="http://localhost:20088" />
<add key="timeout" value="120"/>
<add key="provider" value="System.Data.SqlClient" />
</appSettings>
<system.serviceModel>
<services>
<service name="H2WcfService.DataAccess" behaviorConfiguration="H2WcfServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:20088"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="H2WcfService.IDataAccess" bindingConfiguration="DataAccess">
<identity>
<dns value="localhost:20088"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<service name="H2WcfService.LoginService" behaviorConfiguration="H2WcfServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:20088"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="H2WcfService.ILoginService" bindingConfiguration="Authentic">
<identity>
<dns value="localhost:20088"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<service name="H2WcfService.LMSService" behaviorConfiguration="H2WcfServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:20088"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="H2WcfService.ILMSService" bindingConfiguration="LMSService">
<identity>
<dns value="localhost:20088"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="H2WcfServiceBehavior" >
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<wsHttpBinding>
<binding name="DataAccess" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
<binding name="Authentic">
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
<binding name="LMSService">
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Finally found the answer! Basically, under Binding in System.Servicemodel of my asp.net application web.config, I should have added:
<security mode="None"/>
It was deleted because I was playing with the code for the web service authentication. Thank God I have multiple backups! Thanks guys! I'll update this as answered after two days.
We have fixed
Old Code
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
New Code
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false" />
</security>
Under Security tag, try this
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
</security>

WCF Error - 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'

I have facing above error after adding the maxItemsInObjectGraph="2147483647" parameter both server and client.
However in my project large number of data can transferred using "datatable" objects without any issue.
This error occurred large number of data transferred with using "List<>" objects.
My dotnetframework is 4.0, but I found this error NOT found in dotnetframework 4.5 and large number of data can transferring using "List<>" object without error. Also this is Windows base project.
Please anyone can solved this problem. Here are the my server and client app.cofig configurations.
Thanks!!!
My Service;
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling
maxConcurrentSessions="1200"
maxConcurrentCalls="192"
maxConcurrentInstances="1392"
/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding maxReceivedMessageSize="2147483647" name="netTcpBinding" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="CommonBehavior" name="MyBLL">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBinding" name="MyEndPoint" contract="IMy">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/MySVC"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
My Client;
<system.serviceModel>
<client>
<endpoint name="MyEndPoint" address="net.tcp://localhost:8000/MySVC" binding="netTcpBinding" bindingConfiguration="netTcpBinding" contract="IMy" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding" maxReceivedMessageSize="2147483647" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="CommonBehavior" name="MyEndPoint">
<endpoint address="" behaviorConfiguration="CommonBehavior" binding="netTcpBinding" bindingConfiguration="netTcpBinding" name="MyEndPoint" contract="Imy">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/MySVC" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
Finally I found my mistake in client config and I was solved my problem.
My mistake was behaviorConfiguration="CommonBehavior" tag not in the client, endpoint section. After added this part the problem was successfully solved and large number of records exist generic list I can transferred from server to client.
This is my corrected client config -
<system.serviceModel>
<client>
<endpoint name="MyEndPoint" behaviorConfiguration="CommonBehavior" address="net.tcp://localhost:8000/MySVC" binding="netTcpBinding" bindingConfiguration="netTcpBinding" contract="IMy" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="CommonBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding" maxReceivedMessageSize="2147483647" transferMode="Streamed" listenBacklog="2000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000"
closeTimeout="08:00:00" openTimeout="08:00:00" receiveTimeout="08:00:00" sendTimeout="08:00:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="08:00:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType ="None"/>
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>

https not working for virtual diractory

I configure the SSL for my website https://www.test.com. i had one virtual diractory in it testwcf. when i access it with https://www.test.com/testwcf/Common.svc. Message shown You have created a service. but when i access any method in service, for example
https://www.test.com/testwcf/Common.svc/select?id=1 i get the error The resource cannot be found.. but it works fine with http i.e.http://www.test.com/testwcf/Common.svc/select?id=1. Can anybody help me to solve this problem. I search on net alot but nothing work for me
Below is my websconfg
<services>
<service name="testwcf.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="testwcf.IService1"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
You'll need to update the binding for your service to use transport security. Add a secure binding like:
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
And then change your service config to use that binding.
<services>
<service name="MySecureWCFService.Service1">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="MySecureWCFService.IService1"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
More info at http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx

WCF call taking 20 seconds

I'm somewhat new to WCF and a call to get a record is taking almost 20 seconds, even a local call during debug takes that time. It completes correctly but is so slow.
Client call:
var docImgSvc = new DocImagingService.DocImagingStatusServiceClient("WSHttpBinding_IDocImagingStatusService");
CurrentManifest = docImgSvc.GetManifest(manifestLookup); //<<---This takes 20 secs
if (CurrentManifest == null || CurrentManifest.ManifestId == 0)
Server routine:
public Manifest GetManifest(int manifestNumber)
{
var de = new DocumentImagingEntities(); //<<---Takes 20 secs before it gets here.
var manifest = de.Manifests.FirstOrDefault(m => m.ManifestId == manifestNumber);
return manifest;
}
Server config:
<system.serviceModel>
<services>
<service name="DocImagingServices.DocImagingStatusService">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/DocImagingServices/DocImagingStatusService/"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="DocImagingServices.IDocImagingStatusService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
Client Config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IDocImagingStatusService" 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://localhost:8732/Design_Time_Addresses/DocImagingServices/DocImagingStatusService/"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDocImagingStatusService"
contract="DocImagingService.IDocImagingStatusService" name="WSHttpBinding_IDocImagingStatusService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
Previously when I have seen that type of response time it has been due to the application pool settings.
There is a setting that allows you to load the user profile when running the application pool, this load time could match your 20 seconds.
See http://blogs.msdn.com/b/vijaysk/archive/2009/03/08/iis-7-tip-3-you-can-now-load-the-user-profile-of-the-application-pool-identity.aspx for a screen dump of how to set this value.

Categories