I have a wcf service that randomly begins to fail, when requesting the autogenerated javascript that wcf supports in making. But I have no luck tracking down why,the js thing is part of the wcf featureset.So I dont know how it can suddenly begin to fail and be unable to work until IIS is recycled.
The http log gives me:
2010-06-10 09:11:49 W3SVC2095255988 myip GET /path/myservice.svc/js _=1276161113900 80 - ip browser 500 0 0
So its an error 500, and that is about the only thing I can figure out. The event log contains no information.
Requests to /path/myservice.svc works just fine. After recycling IIS it works again, and some days later it begins to fail until I recycle IIS.
<service
name="path.myservice"
behaviorConfiguration="b">
<endpoint
address=""
behaviorConfiguration="eb"
binding="webHttpBinding"
contract="path.Imyservice" />
</service>
...
<endpointBehaviors>
<behavior name="eb">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="b">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" />
<serv开发者_如何学GoiceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
I dont see any problems in the web.config settings either.
Any clues how I can track down what the problem is?
Edit:
Just to make it clear - It is the generation of javascript that fails, my code is never invoked. Calls to the service works just fine.
I would recommend you to enable tracing in your service and look at the generated logs with Service Trace Viewer Tool. Trace only errors to keep your logs small.
It seems your WCF Service throws an Exception. You can catch this unhandled Exception in the Application_Error method in Global.asax, than write it to a log file.
protected void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError().GetBaseException();
//TODO: write to log
}
精彩评论