Strange webservice problem

  • Thread starter Thread starter chris-s
  • Start date Start date
C

chris-s

Hi folks,

Whilst working on a 'background comms' option for our application which
runs in a separate thread, I am having a small problem with a
webservice that it uses. The actual data is transferred using RDA, but
part of the process uses a simple web service, the instance of which is
created, used and then set to null which is meant to destroy it.

When the comms process has completed it drops the connection, however,
a few moments later the GPRS connection is re-established by something.
After a process of elimination I have traced this down to the web
service, removing its inclusion resolves the issue. After some more
experimenting, if the web service object is created and then set to
null without making the actual call to the method, the problem also
never occurs.

I have checked and double-checked that no other obvious references are
being maintained which might prevent the object being disposed off,
even then, why would it re-make the connection without the method being
called?

So, what causes a webservice to re-establish a connection? Is there a
better way to 'kill-off' or dispose of a web service instance other
than setting it's instance to null? Bear in mind that the webservice is
being created and used within a separate thread, which other than this
issue appears to work 100% with no other problems.....yet!

Any tips welcome!

Chris
 
You should call the Dispose() method of the web service proxy (which I am
assuming you are using a proxy) which has been generated from the contract.
Calling Dispose will free up anything that is used behind the scenses for
that object, I always call Dispose if one is available for all objects. The
GC is great, but I like to help it a bit.

I take it you are using something like the Connection Manager on a phone
edition device to initiate a connection using GPRS? All I can think of it
check your worker thread to ensure that nothing is being called by the
worker thread.

It could be another application trying the connection. Are you loading
another process, or trying to navigate using PIE?

Regards
Simon.



I also take it in your separate thr
 
Thanks for the reply Simon.

There is nothing else runninging that is try to initiate a connection,
it's PPC Phone Edition. It ONLY happens once I drop the connection
AFTER calling the web service method.

I'm creating/dropping the connection using the connection manager.

I was looking for a dispose method but the web service class doesn't
appear to have one, hence I'm just setting it to null. So far as using
a proxy, umm, not using one that I know of, never have done perhaps I
this is something I should research then!

Thanks again,

Chris
 
I guess it must be something in your web service calling code. If you are
not using a proxy, I take it you are calling using HTTPPOST and HTTPGET? no
WSDL proxy generated class?

Simon.
 
Back
Top