I am using a WCF 4 web service with a wshttpbinding and am getting the below error when trying to retrieve records via my hosting service.
Note that I am able to run my service locally fine and when invoking it via the WCF Client test tool, I get valid results back.
I've looked up this msg and there appears to be lots of activity on it (which partially, I have tried, but not worked) but nothing specific to suit my needs to simply just get the service to invoke methods properly.
I would appreciate it very much if someone could provide the exact
syntax I would need updated in my following config files in order for this to get to work. I personally don't care what kind of security is used. It would be fine if "None" was used.
Thanks so much in advance.
The caller was not authenticated by the service.
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at IYeagerTechWcfService.GetCategories() at YeagerTechWcfServiceClient.GetCategories()
Inner Exception: The request for security token could not be satisfied because authentication failed.
at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
Service System.ServiceModel node
<system.serviceModel>
<services>
<service name="YeagerTechWcfService.YeagerTechWcfService">
<endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IYeagerTechWcfService" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
</binding>
</wsHttpBinding>
</bindings>
<diagnostics wmiProviderEnabled="true">
<messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" />
</diagnostics>
<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="True" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Client Service config
<services>
<clear />
<service name="YeagerTechWcfService.YeagerTechWcfService">
<endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
</baseAddresses>
</host>
</service>
</services>
Client endpoint config
<client>
<endpoint address="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IYeagerTechWcfService" contract="YeagerTechWcfService.IYeagerTechWcfService" name="WSHttpBinding_IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
Client web.config
<system.serviceModel> <bindings> <basicHttpBinding> <bindingname="basicHttpBinding_IYeagerTechWcfService"closeTimeout="00:01:00"openTimeout="00:01:00"receiveTimeout="00:10:00"sendTimeout="00:01:00"bypassProxyOnLocal="false"hostNameComparisonMode="StrongWildcard"maxBufferPoolSize="524288"maxReceivedMessageSize="65536"messageEncoding="Text"textEncoding="utf-8"useDefaultWebProxy="true"allowCookies="false"> <readerQuotasmaxDepth="32"maxStringContentLength="8192"maxArrayLength="16384"maxBytesPerRead="4096"maxNameTableCharCount="16384" /> <!--<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />--> <securitymode="None"> <!--<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />--> </security> </binding> </basicHttpBinding> </bindings> <diagnosticswmiProviderEnabled="true"> <messageLogginglogMessagesAtTransportLevel="true"logMessagesAtServiceLevel="true"logMalformedMessages="true"logEntireMessage="true"maxSizeOfMessageToLog="2147483647"maxMessagesToLog="500" /> </diagnostics> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadatahttpGetEnabled="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 --> <serviceDebugincludeExceptionDetailInFaults="True" /> <dataContractSerializermaxItemsInObjectGraph="2147483647" /> </behavior> </serviceBehaviors> </behaviors> <servicesconfigSource="Configs\Prod\system.serviceModel.services.config" /> <clientconfigSource="Configs\Prod\system.serviceModel.client.config" /> </system.serviceModel>
This signifies that the service is working fine. I can also pull up the service in the WCF Test client tool.
When I try and access my [B]production [/B]service (for debugging pruposes) from within Visual Studio, I get the following error:
The message could not be processed. This is most likely because the action 'http://tempuri.org/IYeagerTechWcfService/GetCategories' 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.
Please also see the image wcf test client 1 which is a similiar error in conjunction with the above error.
I have searched the web to try and find out additonal info, but am at a stand still...
I know it's some kind of configuration issue. Can you please let me know what I exactly need to change in the attached config files for it to work successfully? I am just plum old shot of even just getting to this point.....
You can also see in my code (see images), that the call doesn't even make it into my web service and I have valid objects instantiated in the debug window at the bottom of the image.
I've narrowed the error down to the security node in the wshttpbinding node.
I changed it to the following (Message instead of None) which is definitely getting through to the service, but am experiencing another error which should be somewhat easy to fix.
I increased the timeout value on the server config and on the client config, but am still getting the same error (see below).
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +300
System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +26
System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +265
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.HttpWebRequest.GetResponse() +6111651
System.ServiceModel.Channels.HttpChannelRequest.Wa itForReply(TimeSpan timeout) +48
[CommunicationException: An error occurred while receiving the HTTP response to
http://yeagerte.w07.winhost.com/yeag...cfService.svc/. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being
aborted by the server (possibly due to the service shutting down). See server logs for more details.]
YeagerTech.Controllers.CategoryController.Index() in C:\Users\byeager\My Documents\Visual Studio 2010\Projects\YeagerTech\YeagerTech\YeagerTech\Con trollers\CategoryController.cs:41
I have tracing enabled in my service, but I can't view any tracelogs because no tracelogs are being written to my server at E:\web\yeagerte\YeagerTech.svclog or E:\web\yeagerte\YeagerTechMessages.svclog
I need the answers to two questions here:
1) How can I get tracing to work on the hosting service? The tracing works fine on my local machine. I am able to see the trace logs.
2) Getting number one to work may solve this whole issue. I need to find out why the original error (as explained above) is happening.
Here is my tracing configuration in the config file. If anything needs to be changed to enable tracing on your server, please let me know.
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning" propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add initializeData="E:\web\yeagerte\YeagerTech.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener" traceOutputOptions="None">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="E:\web\yeagerte\YeagerTechMessages .svclog"/>
</listeners>
</source>
</sources>
<trace autoflush="true" />
</system.diagnostics>
OK... Looks like it's defintiely an issue with the [B]way the service is being hosted by WinHost [/B] or I need to update the service settings in the config file to resolve the issue.
I'm using Entity Framework 4.1 which obviously uses LINQ to retrieve and update data.
Note that executing these service method on my local machine via my local service works
abosultely fine!!!
The below code is an example of a class in my web service which is serialized back to my local client fine without an issue.
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace YeagerTechModel
{
[Serializable]
[DataContract(IsReference = true)]
public partial class Category
{
public Category()
{
this.Projects = new HashSet<Project>();
}
[DataMember]
public short CategoryID { get; set; }
[DataMember]
public string Description { get; set; }
[DataMember]
public virtual ICollection<Project> Projects { get; set; }
}
}
If you look at the link I provided above and search for the below context, you will see the [B]same thing [/B]that is happening to my situation.
japinthebox02-06-2010, 03:11 PM
I've isolated the problem to a small portion of code tested here: [url]http://www.japinthebox.com/ServiceTest/Default.aspx[/url]
The service is implemented in App_Code/Service.cs. It seems to have nothing at all to do with circular references; it just doesn't want to send any [DataContract] objects generated by Linq to SQL.
02-17-2010, 01:32 AM
Hello,
We checked the application logs and the error is:
"A process serving application pool 'customerPool_2872' suffered a fatal communication error with the Windows Process Activation Service. The process id was '21412'. The data field contains the error number."
This is usually caused by a coding error that creates a stack overflow.
Sincerely,
Lukas
WinHost
There's a known stack overflow issue with returning Linq to SQL objects over WCF; when you have mutual references between two tables in the ORM, it'll crash with this same error message. I thought that may have been the case for me, but the same
code works fine on my machine, and even when the ORM table has no references to other tables (or to itself, just to be sure), it still crashes.
What is the next step that can be taken in order to resolve this issue?
Through my findings, I was able to run the project off of my local IIS server instead of Cassini (the Visual Studio development server) and
was able to get a response back with no problem whatsoever! If I was able to attach or insert images from my local computer, I would include them here...
This proves to me that it's some kind of problem on the hosting company end that is causing the issue of the data not to be serialized back properly.
What's your opinion? Where do I go from here? Seems like it's defintely a problem with them.
<div>A couple of things to point out here... I included the following node in my
system.web node of the configuration file for both the web service and my client as follows:
</div> <div><httpRuntime executionTimeout="3600" maxRequestLength="1048576"/></div> <div> </div> <div>In my web service, I
already have the proxycreation and lazyloading already turned off (see below method of web service)</div> <div></div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div>
</div> <div>Below is the code of my edmx file that shows lazyloading is turned off.</div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div>
</div> <div>Like I mentioned in one of my last couple of posts, in order for me to see more detailed info,
I need to be able to see the tracelogs that the service is supposed to generate.</div> <div> The trace logs get generated just fine when I execute locally, but do not get generated when executing from the host.
I have the same exact system.diagnostics node for both, except for the
file path of where the service is to place the logs. The logs should be on the root of my website, but I do not see them. Maybe it's some kind of permissions issue....</div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div>
</div> <div>How come I can't generate the tracelogs on the hsoting servers?
</div> <div>It still has to be some kind of configuration on your servers and or a config file issue.</div>
I just tried updating the boldfaced in the server config and the client config from "true" to "false", but with no luck.
A lot of things I'm reading point to this node as being the one in question that may seem to be causing the problem and I can't get anyone to inform me what the correct configuration should be.
Can anyone please let me know the exact configuartion I shoud use?
I also increased the sendtimeout (from 00:01:00 to 00:10:00) property, but still didn't work. I am truly at a loss. Again, it works fine on my lcoal machine via Cassisni or IIS, but not from this hosting service.
Is there a setting in the config file that I can change to correct this?
<div>I've defintely narrowed it down to the security node inside the binding node. Depending on what changes I make to this node, there are different errors coming out because it is not configured properly. There are different permutations of the security
node, so I need to know exactly what the specific values for the below properties
should be.</div> <div>
I do not have any specific security in my web service.</div> <div><security mode="Message"></div> <div><transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /></div> <div><message clientCredentialType="Windows"
negotiateServiceCredential="false" algorithmSuite="Default" /></div> <div></security></div>
I tried updating the security node again to two different permutations (see at bottom) and am getting the same following error for both:
"the message contains an invalid or expired security context token or because there is a mismatch between bindings"
My receivetimeout already is at 10:00 minutes and as you can see in this thread, i'm using the same binding "wshttpbinding" in both the web.config on the client and web.config for the service.
As I mentioned before, this entire process works fine on my local machine using the Cassini (VS development ) web server and changing it up to go through my local IIS web server.
Please help me get this service running on this hosting site....
wsyeager36
Member
385 Points
458 Posts
The caller was not authenticated by the service
Feb 02, 2012 03:57 PM|LINK
I am using a WCF 4 web service with a wshttpbinding and am getting the below error when trying to retrieve records via my hosting service.
Note that I am able to run my service locally fine and when invoking it via the WCF Client test tool, I get valid results back.
I've looked up this msg and there appears to be lots of activity on it (which partially, I have tried, but not worked) but nothing specific to suit my needs to simply just get the service to invoke methods properly.
I would appreciate it very much if someone could provide the exact syntax I would need updated in my following config files in order for this to get to work. I personally don't care what kind of security is used. It would be fine if "None" was used.
Thanks so much in advance.
The caller was not authenticated by the service.
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IYeagerTechWcfService.GetCategories()
at YeagerTechWcfServiceClient.GetCategories()
Inner Exception:
The request for security token could not be satisfied because authentication failed.
at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
Service System.ServiceModel node <system.serviceModel> <services> <service name="YeagerTechWcfService.YeagerTechWcfService"> <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" /> </baseAddresses> </host> </service> </services> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IYeagerTechWcfService" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> </binding> </wsHttpBinding> </bindings> <diagnostics wmiProviderEnabled="true"> <messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" /> </diagnostics> <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="True" /> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> Client Service config <services> <clear /> <service name="YeagerTechWcfService.YeagerTechWcfService"> <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" /> </baseAddresses> </host> </service> </services> Client endpoint config <client> <endpoint address="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IYeagerTechWcfService" contract="YeagerTechWcfService.IYeagerTechWcfService" name="WSHttpBinding_IYeagerTechWcfService"> <identity> <dns value="localhost" /> </identity> </endpoint> </client>Client web.config
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 02, 2012 07:24 PM|LINK
I have gotten to the point where my local service runs fine.
I can also access my production service at:
http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc
This signifies that the service is working fine. I can also pull up the service in the WCF Test client tool.
When I try and access my [B]production [/B]service (for debugging pruposes) from within Visual Studio, I get the following error:
The message could not be processed. This is most likely because the action 'http://tempuri.org/IYeagerTechWcfService/GetCategories' 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.
Please also see the image wcf test client 1 which is a similiar error in conjunction with the above error.
I have searched the web to try and find out additonal info, but am at a stand still...
I know it's some kind of configuration issue. Can you please let me know what I exactly need to change in the attached config files for it to work successfully? I am just plum old shot of even just getting to this point.....
You can also see in my code (see images), that the call doesn't even make it into my web service and I have valid objects instantiated in the debug window at the bottom of the image.
web service svc
http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc
svc config file
<system.serviceModel>
<services>
<service name="YeagerTechWcfService.YeagerTechWcfService">
<endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IYeagerTechWcfService" 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="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="None" establishSecurityContext="false" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<diagnostics wmiProviderEnabled="true">
<messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" />
</diagnostics>
<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="True" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
client web config system.web section
<system.web>
<authorization>
<allow roles="Admin" />
</authorization>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" />
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="LocalSqlServer" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="Telerik.Web.Mvc.UI" />
</namespaces>
</pages>
<httpHandlers>
<add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
</httpHandlers>
<trust level="Full"></trust>
</system.web>
client web config system.servicemodel section
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IYeagerTechWcfService" 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="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="None" establishSecurityContext="false" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<diagnostics wmiProviderEnabled="true">
<messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" />
</diagnostics>
<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="True" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
<services configSource="Configs\Prod\system.serviceModel.services.config" />
<client configSource="Configs\Prod\system.serviceModel.client.config" />
</system.serviceModel>
client system.servicemodel services
<?xml version="1.0"?>
<services>
<clear />
<service name="YeagerTechWcfService.YeagerTechWcfService">
<endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
</baseAddresses>
</host>
</service>
</services>
client system.servicemodel client
<?xml version="1.0"?>
<client>
<endpoint address="http://yeagerte.w07.winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IYeagerTechWcfService" contract="YeagerTechWcfService.IYeagerTechWcfService" name="WSHttpBinding_IYeagerTechWcfService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 02, 2012 09:49 PM|LINK
I've narrowed the error down to the security node in the wshttpbinding node.
I changed it to the following (Message instead of None) which is definitely getting through to the service, but am experiencing another error which should be somewhat easy to fix.
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
<!--<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="None" establishSecurityContext="false" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>-->
I increased the timeout value on the server config and on the client config, but am still getting the same error (see below).
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +300
System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +26
System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +265
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.HttpWebRequest.GetResponse() +6111651
System.ServiceModel.Channels.HttpChannelRequest.Wa itForReply(TimeSpan timeout) +48
[CommunicationException: An error occurred while receiving the HTTP response to http://yeagerte.w07.winhost.com/yeag...cfService.svc/. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.]
YeagerTech.Controllers.CategoryController.Index() in C:\Users\byeager\My Documents\Visual Studio 2010\Projects\YeagerTech\YeagerTech\YeagerTech\Con trollers\CategoryController.cs:41
I have tracing enabled in my service, but I can't view any tracelogs because no tracelogs are being written to my server at E:\web\yeagerte\YeagerTech.svclog or E:\web\yeagerte\YeagerTechMessages.svclog
I need the answers to two questions here:
1) How can I get tracing to work on the hosting service? The tracing works fine on my local machine. I am able to see the trace logs.
2) Getting number one to work may solve this whole issue. I need to find out why the original error (as explained above) is happening.
Here is my tracing configuration in the config file. If anything needs to be changed to enable tracing on your server, please let me know.
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning" propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add initializeData="E:\web\yeagerte\YeagerTech.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener" traceOutputOptions="None">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="E:\web\yeagerte\YeagerTechMessages .svclog"/>
</listeners>
</source>
</sources>
<trace autoflush="true" />
</system.diagnostics>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 02, 2012 10:29 PM|LINK
OK... Looks like it's defintiely an issue with the [B]way the service is being hosted by WinHost [/B] or I need to update the service settings in the config file to resolve the issue.
I found this link while searching on the web:
http://forum.winhost.com/archive/index.php/t-2949.html
I'm using Entity Framework 4.1 which obviously uses LINQ to retrieve and update data.
Note that executing these service method on my local machine via my local service works abosultely fine!!!
The below code is an example of a class in my web service which is serialized back to my local client fine without an issue.
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
namespace YeagerTechModel
{
[Serializable]
[DataContract(IsReference = true)]
public partial class Category
{
public Category()
{
this.Projects = new HashSet<Project>();
}
[DataMember]
public short CategoryID { get; set; }
[DataMember]
public string Description { get; set; }
[DataMember]
public virtual ICollection<Project> Projects { get; set; }
}
}
If you look at the link I provided above and search for the below context, you will see the [B]same thing [/B]that is happening to my situation.
japinthebox02-06-2010, 03:11 PM
I've isolated the problem to a small portion of code tested here: [url]http://www.japinthebox.com/ServiceTest/Default.aspx[/url]
The service is implemented in App_Code/Service.cs. It seems to have nothing at all to do with circular references; it just doesn't want to send any [DataContract] objects generated by Linq to SQL.
02-17-2010, 01:32 AM
Hello,
We checked the application logs and the error is:
"A process serving application pool 'customerPool_2872' suffered a fatal communication error with the Windows Process Activation Service. The process id was '21412'. The data field contains the error number."
This is usually caused by a coding error that creates a stack overflow.
Sincerely,
Lukas
WinHost
There's a known stack overflow issue with returning Linq to SQL objects over WCF; when you have mutual references between two tables in the ORM, it'll crash with this same error message. I thought that may have been the case for me, but the same code works fine on my machine, and even when the ORM table has no references to other tables (or to itself, just to be sure), it still crashes.
What is the next step that can be taken in order to resolve this issue?
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 03, 2012 10:12 PM|LINK
Through my findings, I was able to run the project off of my local IIS server instead of Cassini (the Visual Studio development server) and was able to get a response back with no problem whatsoever! If I was able to attach or insert images from my local computer, I would include them here...
This proves to me that it's some kind of problem on the hosting company end that is causing the issue of the data not to be serialized back properly.
What's your opinion? Where do I go from here? Seems like it's defintely a problem with them.
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 04, 2012 04:33 PM|LINK
</div> <div><httpRuntime executionTimeout="3600" maxRequestLength="1048576"/></div> <div> </div> <div>In my web service, I already have the proxycreation and lazyloading already turned off (see below method of web service)</div> <div></div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div>
public IEnumerable<YeagerTechModel.Category> GetCategories() { YeagerTechEntities DbContext = new YeagerTechEntities(); DbContext.Configuration.ProxyCreationEnabled = false; IEnumerable<YeagerTechModel.Category> category = DbContext.Categories.Where(p => p.CategoryID > 0); CloseConnection(DbContext); return category; }</div> <div>Below is the code of my edmx file that shows lazyloading is turned off.</div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div> </div> <div>Like I mentioned in one of my last couple of posts, in order for me to see more detailed info, I need to be able to see the tracelogs that the service is supposed to generate.</div> <div>The trace logs get generated just fine when I execute locally, but do not get generated when executing from the host. I have the same exact system.diagnostics node for both, except for the file path of where the service is to place the logs. The logs should be on the root of my website, but I do not see them. Maybe it's some kind of permissions issue....</div> <div style="margin: 5px 20px 20px;"> <div style="margin-bottom: 2px;" class="smallfont">Code:</div>
<system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Warning" propagateActivity="true"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add initializeData="E:\web\yeagerte\YeagerTech.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener" traceOutputOptions="None"> <filter type="" /> </add> </listeners> </source> <source name="System.ServiceModel.MessageLogging"> <listeners> <add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="E:\web\yeagerte\YeagerTechMessages.svclog"/> </listeners> </source> </sources> <trace autoflush="true" /> </system.diagnostics></div> <div>How come I can't generate the tracelogs on the hsoting servers?</div> <div>It still has to be some kind of configuration on your servers and or a config file issue.</div>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 05, 2012 10:06 PM|LINK
I just tried updating the boldfaced in the server config and the client config from "true" to "false", but with no luck.
A lot of things I'm reading point to this node as being the one in question that may seem to be causing the problem and I can't get anyone to inform me what the correct configuration should be.
Can anyone please let me know the exact configuartion I shoud use?
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding
<security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="false" algorithmSuite="Default" />
</security>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 05, 2012 10:25 PM|LINK
I also increased the sendtimeout (from 00:01:00 to 00:10:00) property, but still didn't work. I am truly at a loss. Again, it works fine on my lcoal machine via Cassisni or IIS, but not from this hosting service.
Is there a setting in the config file that I can change to correct this?
<bindings> <wsHttpBinding> <binding name="WSHttpBinding_IYeagerTechWcfService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" 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="false" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 07, 2012 02:04 AM|LINK
I do not have any specific security in my web service.</div> <div><security mode="Message"></div> <div><transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /></div> <div><message clientCredentialType="Windows" negotiateServiceCredential="false" algorithmSuite="Default" /></div> <div></security></div>
Bill Yeager
MCP.Net, BCIP
wsyeager36
Member
385 Points
458 Posts
Re: The caller was not authenticated by the service
Feb 08, 2012 06:05 PM|LINK
I tried updating the security node again to two different permutations (see at bottom) and am getting the same following error for both:
"the message contains an invalid or expired security context token or because there is a mismatch between bindings"
My receivetimeout already is at 10:00 minutes and as you can see in this thread, i'm using the same binding "wshttpbinding" in both the web.config on the client and web.config for the service.
web.config for service: <wsHttpBinding> <binding name="WSHttpBinding_IYeagerTechWcfService" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"> </binding> </wsHttpBinding>
web.config for client <binding name="WSHttpBinding_IYeagerTechWcfService" 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="None"> <transport clientCredentialType="None" /> <message establishSecurityContext="false" /> </security> </binding> </wsHttpBinding>
As I mentioned before, this entire process works fine on my local machine using the Cassini (VS development ) web server and changing it up to go through my local IIS web server.
Please help me get this service running on this hosting site....
<security mode="None"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" /> </security>
<security mode="None"> <transport clientCredentialType="None" /> <message establishSecurityContext="false" /> </security>
Bill Yeager
MCP.Net, BCIP