Client receives "java.net.SocketException: Connection reset" when doing
concurrent calls to WCF service
I have a WCF service (IIS 7, .NET 4, Windows Server 2008 R2 Enterprise)
which is being queried by a web client (written in Java). However, when
more than one requests are sent concurrently to the WCF service, the
client receives a "java.net.SocketException: Connection reset". I have
browsed a lot of the threads and tried to adjust the configuration of my
WCF service but the issue is still not fixed. Below are some more details:
web.config (of WCF service):
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00"
sendTimeout="00:10:00" />
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Alpha.BetaBehavior">
<!-- 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"/>
<!-- below is for huge files-->
<!-- dataContractSerializer maxItemsInObjectGraph="2147483647" /
-->
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="BetaEndpointBehavior">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="Alpha.Beta" behaviorConfiguration="Alpha.BetaBehavior">
<endpoint address="" kind="webHttpEndpoint"
behaviorConfiguration="BetaEndpointBehavior"
binding="webHttpBinding" contract="Alpha.IBeta">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<diagnostics wmiProviderEnabled="true">
<messageLogging
logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
maxMessagesToLog="3000"
/>
</diagnostics>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<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">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\inetpub\wwwroot\bin\RequestLogs\Traces.svclog"
/>
</sharedListeners>
</system.diagnostics>
</configuration>
WCF Service Behavior:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
I have also noticed that when, for example, I send two concurrent requests
from the web client (e.g. querying the WCF service concurrently from 2
different tabs of Firefox), one of them will return correct results but
the other will yield the SocketException error. If I then rerun the query
which returned the SocketException error by itself, it will work
correctly.
I have also enabled WCF Tracing (new to this), and I see the following
Exception Message:
The communication object,
System.ServiceModel.Channels.TransportReplyChannelAcceptor+TransportReplyChannel,
cannot be used for communication because it has been Aborted.
..with the following stack trace:
System.ServiceModel.Channels.CommunicationObject.ThrowIfAborted()
System.ServiceModel.Channels.InputQueueChannel`1.EndDequeue(IAsyncResult
result, TDisposable& item)
System.ServiceModel.Channels.ReplyChannel.EndTryReceiveRequest(IAsyncResult
result, RequestContext& context)
System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult
result, RequestContext& requestContext)
System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult
result, RequestContext& requestContext)
System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult
result)
System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult
result)
System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)
System.Runtime.InputQueue`1.Shutdown(Func`1 pendingExceptionGenerator)
System.ServiceModel.Channels.InputQueueChannel`1.OnClosing()
System.ServiceModel.Channels.CommunicationObject.Abort()
System.ServiceModel.Dispatcher.ListenerHandler.AbortChannels()
System.ServiceModel.Dispatcher.ListenerHandler.OnAbort()
System.ServiceModel.Channels.CommunicationObject.Abort()
System.ServiceModel.Dispatcher.ChannelDispatcher.OnAbort()
System.ServiceModel.Channels.CommunicationObject.Abort()
System.ServiceModel.ServiceHostBase.OnAbort()
System.ServiceModel.Channels.CommunicationObject.Abort()
System.ServiceModel.ServiceHostingEnvironment.HostingManager.Abort()
System.ServiceModel.ServiceHostingEnvironment.HostingManager.Stop(Boolean
immediate)
System.Web.Hosting.HostingEnvironment.StopRegisteredObjects(Boolean
immediate)
System.Web.Hosting.HostingEnvironment.InitiateShutdownWorkItemCallback(Object
state)
System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean ignoreSyncCtx)
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Finally, on the server side, it appears that each time this occurs a
Visual Studio popup appears saying that "An unhandled .NET Microsoft
framework exception occurred in w3wp.exe [1248]" (I have Visual studio
open testing my code)
Can anyone help me shed some light into this? Could it be that the WCF
service is properly configured but some fine-tuning needs to happen from
the Java web-client?
Thanks in advance.
Thursday, 8 August 2013
What site would be best to post useful code examples?
What site would be best to post useful code examples?
I realize this may be a little out of form, but I was wondering what
people would say would be the best places to post code examples and
general code concepts and such. CodeProject? Is there something better? In
which I can post a small but useful chunk of code? Thanks.
I realize this may be a little out of form, but I was wondering what
people would say would be the best places to post code examples and
general code concepts and such. CodeProject? Is there something better? In
which I can post a small but useful chunk of code? Thanks.
Various types of code signing certificates
Various types of code signing certificates
What is a code signing certificate? What is the difference between
standard and extended validation? I looked at this website for a
comparison. Thawte has altogether different types of code signing
certificates. Can anyone make the differences between these certificates a
bit clearer?
What is a code signing certificate? What is the difference between
standard and extended validation? I looked at this website for a
comparison. Thawte has altogether different types of code signing
certificates. Can anyone make the differences between these certificates a
bit clearer?
play / stop buttons mediaElement not working on Ipad
play / stop buttons mediaElement not working on Ipad
I am using mediaElement.js to include html-video.
I'd like to use external controls but they don't work on Ipad. they do
work on PC.
Any Ideas?
See hyperlinks below player in this example:
http://quiz.siteflex.nl/custom/melements/demo/mediaelementplayer-youtube.html#
Thanks in advance
Mark
I am using mediaElement.js to include html-video.
I'd like to use external controls but they don't work on Ipad. they do
work on PC.
Any Ideas?
See hyperlinks below player in this example:
http://quiz.siteflex.nl/custom/melements/demo/mediaelementplayer-youtube.html#
Thanks in advance
Mark
tag is created only the first item
tag is created only the first item
I do not know what I'm doing wrong but all the items should be within the
tag <li> item </li> but only the first item is, what can be?
javascript:
$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Frss.cnn.com%2Fservices%2Fpodcasting%2Fac360%2Frss.xml'%20AND%20itemPath%3D%22%2F%2Fchannel%22&format=json&diagnostics=true&callback=?",
function (data) {
var titles = data.query.results.channel.item.map(function(item) {
return item.title;
});
$(".container-list-podcast ul").append('<li>' + titles.join('</li>'));
});
jsfiddle
I do not know what I'm doing wrong but all the items should be within the
tag <li> item </li> but only the first item is, what can be?
javascript:
$.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D'http%3A%2F%2Frss.cnn.com%2Fservices%2Fpodcasting%2Fac360%2Frss.xml'%20AND%20itemPath%3D%22%2F%2Fchannel%22&format=json&diagnostics=true&callback=?",
function (data) {
var titles = data.query.results.channel.item.map(function(item) {
return item.title;
});
$(".container-list-podcast ul").append('<li>' + titles.join('</li>'));
});
jsfiddle
Yii Property "CListView.X" is not defined
Yii Property "CListView.X" is not defined
I am new at Yii and trying to show the list of user on the home page and
while doing so I am getting error: Property "CListView.userlist" is not
defined. Code: SiteController.php
class SiteController extends Controller {
// This is the function which I changed reset is file remains same
public function actionIndex() {
$userlist = User::model()->findAllBySql($sql);
$this->render('index',array('userlist'=>$userlist,));
}
}
The code for view of the site, index.php:
$this->widget('zii.widgets.CListView', array(
'userlist'=>$userlist,
'itemView'=>'_view',
));
In last _view.php:
echo CHtml::encode($data->getAttributeLabel('id'));
Currently in with code I am getting error: Property "CListView.userlist"
is not defined. But if I replace $userlist with $dataProvider, the error
changes to "Fatal error: Call to a member function getData() on a
non-object in C:\devCenter\yii\framework\zii\widgets\CBaseListView.php on
line 107"
I have two questions:
It seems there special meaning of $dataProvider, please me tell why is that.
I am passing $userlist from SiteController to index.php then to
$this->widget(), but in _view.php the variable changes to $data, what am I
missing? I have read through the documentation in Yii site yet I couldn't
follow this.
I am new at Yii and trying to show the list of user on the home page and
while doing so I am getting error: Property "CListView.userlist" is not
defined. Code: SiteController.php
class SiteController extends Controller {
// This is the function which I changed reset is file remains same
public function actionIndex() {
$userlist = User::model()->findAllBySql($sql);
$this->render('index',array('userlist'=>$userlist,));
}
}
The code for view of the site, index.php:
$this->widget('zii.widgets.CListView', array(
'userlist'=>$userlist,
'itemView'=>'_view',
));
In last _view.php:
echo CHtml::encode($data->getAttributeLabel('id'));
Currently in with code I am getting error: Property "CListView.userlist"
is not defined. But if I replace $userlist with $dataProvider, the error
changes to "Fatal error: Call to a member function getData() on a
non-object in C:\devCenter\yii\framework\zii\widgets\CBaseListView.php on
line 107"
I have two questions:
It seems there special meaning of $dataProvider, please me tell why is that.
I am passing $userlist from SiteController to index.php then to
$this->widget(), but in _view.php the variable changes to $data, what am I
missing? I have read through the documentation in Yii site yet I couldn't
follow this.
Facebook API - Check user account creation date
Facebook API - Check user account creation date
Is it possible to check when an account was created with Facebook API?
I would like to allow account creation with Facebook Login only for
Facebook users who have a Facebook account for more than one year.
Thank you.
Is it possible to check when an account was created with Facebook API?
I would like to allow account creation with Facebook Login only for
Facebook users who have a Facebook account for more than one year.
Thank you.
Subscribe to:
Posts (Atom)