Strange problem with proxy / ObjectDisposeException

C

C. Vollmer

Hi,

I got a new iPAQ with WM 2003. I installed SP2 and my application and
tried to run my app. It didn't work. I call a Webservice in my app and
every time I got a timeout. It finally worked when I disabled my proxy
in the settings of WM 2003 and then enabled it again. Strange enough.
But most strange was what happened when the proxy was disabled and I
told my app to use a proxy. I call my webservice and that doesn't work,
OK. I get a WebException with status "ConnectFailure". In that part I
threw a new exception with the WebException as InnerException. In the
calling class I catch that exception and show a messagebox. And in that
moment I get a ObjectDisposeException from System.Net.Sockets.Socket! Why??
Here is some source:

....
//Call webservice
....
} catch (System.Net.WebException we) {
throw new Exception("Webservice not available!", we);
}

Calling class:
....
} catch (Exception ex) {
MessageBox.Show("Couldn't login!", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Hand,
MessageBoxDefaultButton.Button1);
//While showing this messagebox I get the exception

SP2 on HP 5550 with WM 2003.
Any ideas??
Thanks,
Christoph
 
M

Mike

I connect through a proxy server in my Compact Framework code and the proxy
settings don't need to be set in Windows Mobile. I use the WebProxy object
to specify the name of the proxy server.

Also, you only posted your "Catch" code - this isn't very useful. Can you
post the code that is throwing the exception?
 
C

C. Vollmer

Mike,

maybe I wasn't very clear. I also use the WebProxy object, that's what I
meant with "...I told my app to use a proxy." My code:
if (UseProxy) {
validatePropertyKey(PROXY_URL);
System.Net.GlobalProxySelection.Select = new
System.Net.WebProxy(ProxyUrl);
}
I do use this property always. I read it from my AppProperties and if
the property UseProxy is set then I use the proxy with the WebProxy
object. I too, always thought that this object is the only important for
my webconnection, but ... however ... in my case this strange thing happen.
I post my code which is throwing the exception, but it is only the
function of a webservice, so I think it is not very useful.
try {
instance.dataSourceWeb = service.Tourenplan(userName, passWord,
OpenNETCF.WinAPI.Core.GetDeviceID());
} catch (System.Net.WebException we) {
throw new Exception("Webservice not available!", we);
}
And this new Exception is catched in the calling class, see below.
I still have no idea.
Thanks,
Christoph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top