filii_neo

Hi,

I'm wirting an application that will consume webservices. Generally, that's no problem. But sometimes, the following exception occures:

System.Net.WebException: Unable to read data from the transport connection. ---> System.Net.Sockets.SocketException: Unknown error (0x0).
at System.Net.HttpWebRequest.fillBuffer()
at System.Net.HttpWebRequest.getLine()
at System.Net.HttpWebRequest.parseResponse()
at System.Net.HttpWebRequest.startReceiving()
at System.Net.Connection.startReceiving()
at WorkItem.doWork()
at System.Threading.Timer.ring()

at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()

The webmethod will be called synchronously. The webservice service is JBoss.

Windows CE 5.0

.Net Compact Framework 2.0

DataLogic device using WLAN

Can anybody tell me please, how to debug this problem. It's really strange and very nerved.

Thanks for your help

filii



Re: .NET Compact Framework Webservice: unknown SocketException

Biju S Melayil

Hi,

Are you trying to send a large Amount data through the web service if so then the server is closing out... When you try to push / pull large amount of data like images it occurs.

try to put the proxy for the web service:

myService proxyService = new myService();


//WebProxy for the Server
WebProxy webProxy = new WebProxy(http://127.0.0.1/Service/myService.asmx);

proxyService.Proxy = webProxy;

proxyService.Timeout = 100000;

proxyService.Url = "http://127.0.0.1/Service/myService.asmx";


Increase the Timeout as required by the web service to retrieve the data from the server.
Can you let me know what is the Connection used and what is the data send across the webservice

Regards
Biju S Melayil





Re: .NET Compact Framework Webservice: unknown SocketException

filii_neo

thanks for your reply. I updated the code the following way.

using (MyProxy proxy = new MyProxy ())

{

proxy .Url = serviceUrl;

proxy .Timeout = 10000;

proxy .UsernameToken = serviceUsernameToken;

...

}

You are right, I did not set the Timeout property. The data that is read is very variable. That can be 2 item or 100 items. It depends on the current data. My observation is that the exception occures for both scenario. I think it does not depend on the amount of the data. But I will try with the timeout. After the next deployment I will report my experiences.

Is it possible that this "unknown error" occures because of the wireless lan network connection

thx filii




Re: .NET Compact Framework Webservice: unknown SocketException

Anthony Wong - MSFT

Hi,

Yes, it is possible the issue occurs because of a wireless lan connection; we pass the error value from the OS. Can you reproduce the issue consistently

Cheers,

Anthony Wong [MSFT]





Re: .NET Compact Framework Webservice: unknown SocketException

filii_neo

No,

I can not reproduce the problem. There are 15 smart devices in action. So, I logged the exception to file and tried to analyse the exceptions. But I can not find any dependencies. The single devices do not throw the exception at the same time. And sometimes, the exception occures two times in a row. Somethimes, the timespan between the exceptions is four hours or even longer. That's the thing that confuses me so much.

Have you any detailed idea why the exception is thrown





Re: .NET Compact Framework Webservice: unknown SocketException

filii_neo

Hello,

we have enabled logging for the access point. But in the syslog there is nothing that looks like an error. So, is that "unknown error" really a network issue

filii_neo





Re: .NET Compact Framework Webservice: unknown SocketException

ckreuzbe

I have the same problem! The exceptions occur almost randomly.

After I catch the Exception I can call the webservice again and it works.

I am using a GPRS-Connection to call a Webservice (Network provider is One in Austria).

The Webservice is written in ASP.NET 2 and we are transferring DataSets.

The Compact-Framework Client (a QTek Smartphone with Windows Mobile 5) sends a DataSet with some data.

I discovered that it does not depend on the size of the DataSet... I managed to send a DataSet with 500 rows (takes some time... about 2 minutes), while sending a DataSet with 1-3 rows takes 4-7 seconds.

The Webservice is called asynchronously, but the error also occurs when calling it synchronously. The Webservice is deployed to an IIS on a Windows 2003 Server - but the error also occured with Windows 2000.

I switched to CF.NET 2 today to get some more debugging info (and wrote them to a logfile), here is what I have got:

WebException (after 1 seconds):

Message=Von der Ubertragungsverbindung konnen keine Daten gelesen werden (* translation: Unable to read data from the transport connection). || Response= || Status=ReceiveFailure

WebException.stacktrace:

at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doAsyncInvoke()
at WorkItem.doWork()
at System.Threading.Timer.ring()

WebException.InnerException: System.Net.Sockets.SocketException: Unbekannter Fehler (* translation: Unknown Error) (0x0).

--->

SocketException: ErrorCode=0,Message=Unbekannter Fehler (* translation: Unknown Error)(0x0).,NativeErrorCode=0

WebException.InnerException.stacktrace:

at System.Net.HttpWebRequest.fillBuffer()
at System.Net.HttpWebRequest.getLine()
at System.Net.HttpWebRequest.parseResponse()
at System.Net.HttpWebRequest.startReceiving()
at System.Net.Connection.startReceiving()
at WorkItem.doWork()
at System.Threading.Timer.ring()

I am using the GPS.NET Library (Geoframework) to connect to a Bluetooth GPS Device and I actually have the feeling that it has something to do with the Bluetooth Connection (or the GPS.NET Library itself).

I also took a look at the webservice: the log files did not report any error. Furthermore, I took a look at the IIS Log Files - no error, no request from the mobile applicaiton.

I installed a network-sniffer on the server to see if there is any kind of request from the mobile phone.

If you need more information, please let me know asap!

edit: I also found this topic:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1571396&SiteID=1

Seems to be the same problem!

edit2: The exception also occurs with CF2 SP2





Re: .NET Compact Framework Webservice: unknown SocketException

ckreuzbe

Does nobody know this problem