bnathvbdotnet
Oct 15th, 2009, 05:36 PM
Howdy,
I have a simple WCF service (wshttpbinding) developed using VS2008.
I have an asp.net web page that calls this WCF service. I have included the appropriate parts of web.config files for both. I get the following error when asp.net calls a contract which is in the wcf service.
"The message could not be processed. This is most likely because the action 'http://tempuri.org/IQRMDMSService/GetDistinctCompanies' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
WCF web.config file:
<system.serviceModel>
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
</serviceHostingEnvironment>-->
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IQRMDMSService" maxReceivedMessageSize="100000000" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="true">
<security mode="None"/>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="xx.Services.QRMDMSServiceBehavior" name="FHLBSF.QRMDMS.Services.QRMDMSService">
<endpoint address="http://applicationserver1/QrmdmsServices/QRMDMSService.svc" binding="wsHttpBinding" contract="FHLBSF.QRMDMS.Services.IQRMDMSService">
<identity>
<dns value="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="xx.Services.QRMDMSServiceBehavior">
<!-- 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"/>
<serviceThrottling maxConcurrentCalls="30" maxConcurrentSessions="30"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Web.config of the asp.net client:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IQRMDMSService" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:10:00" sendTimeout="00:59:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="6555536" 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="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IQRMDMSService"
contract="QRMDMSServices.IQRMDMSService"
name="WSHttpBinding_IQRMDMSService">
<identity>
<dns value="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"/>
</identity>
</endpoint>
</client>
</system.serviceModel>
I have a simple WCF service (wshttpbinding) developed using VS2008.
I have an asp.net web page that calls this WCF service. I have included the appropriate parts of web.config files for both. I get the following error when asp.net calls a contract which is in the wcf service.
"The message could not be processed. This is most likely because the action 'http://tempuri.org/IQRMDMSService/GetDistinctCompanies' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
WCF web.config file:
<system.serviceModel>
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
</serviceHostingEnvironment>-->
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IQRMDMSService" maxReceivedMessageSize="100000000" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="true">
<security mode="None"/>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="xx.Services.QRMDMSServiceBehavior" name="FHLBSF.QRMDMS.Services.QRMDMSService">
<endpoint address="http://applicationserver1/QrmdmsServices/QRMDMSService.svc" binding="wsHttpBinding" contract="FHLBSF.QRMDMS.Services.IQRMDMSService">
<identity>
<dns value="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="xx.Services.QRMDMSServiceBehavior">
<!-- 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"/>
<serviceThrottling maxConcurrentCalls="30" maxConcurrentSessions="30"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Web.config of the asp.net client:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IQRMDMSService" closeTimeout="00:59:00" openTimeout="00:59:00" receiveTimeout="00:10:00" sendTimeout="00:59:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="6555536" 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="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IQRMDMSService"
contract="QRMDMSServices.IQRMDMSService"
name="WSHttpBinding_IQRMDMSService">
<identity>
<dns value="http://applicationserver1/QrmdmsServices/QRMDMSService.svc"/>
</identity>
</endpoint>
</client>
</system.serviceModel>