.net cf & webservices

J

Josh

Hi,

Can anybody tell me does .net cf support sessions when using a soap web
service? If not, can you tell me where it says so in the documentation or
point me to some other info or work around??

Thanks
Josh
 
J

Jimmy

Josh said:
Hi,

Can anybody tell me does .net cf support sessions when using a soap web
service? If not, can you tell me where it says so in the documentation or
point me to some other info or work around??

It does and it doesnt! Confused, yeah, hehe...

As i recall there is a session object in the .net framework wich you can use
in your webservices. But as soon as the webservice returns to the PDA, the
session is not there any more. In the cf framework you cant use sessions as
i recall since sessions is generated on the webserver. You dont need a
webserver to run a PDA client application.

I dont know what you wanna do, but i used to use the sessionID in my web
pages, so that i knew where different rows in my tables in a database would
belong to. As i converted to PDA/WebServices i now use GUIDs instead.

Im not sure of where to find all this on the net. Try google for "session
webservice pda". Maybe that would give some hits.

Hope this helps.


Jimmy
 
J

Josh

Well every time I call a webservice function from the PDA the session for
the server changes even though I'm using the same stub repeatedly on the
pda. And I cant figure out why? anyone?
 
J

Jimmy

Josh said:
Well every time I call a webservice function from the PDA the session for
the server changes even though I'm using the same stub repeatedly on the
pda. And I cant figure out why? anyone?

Everytime you call your webservice from the PDA, its like opening a new
instance of Internet explorer from your start menu ie. Internet explorer
will not get the same session as the other window. Each Webservice you call
is a new Windows Explorer window that you open from your start menu.

Internet explorer is just used as an example in the above. Im trying to make
an analogy between the way it works with sessions and IE (or whatever
browser) and calling a webservice from your PDA.

Cheers
Jimmy
 
J

Josh

Yeah I follow what your saying. But everytime you use the same instance of
a webservice on the PDA it should have the same session id?
ie. The process is the same, the webservice instance is the same all thats
different is the function I call.
Which in my mind at the moment its behaving like a new process or instance
is started?

If thats the way it is, its pretty crap? any work arounds?
 
J

Jimmy

Josh said:
Yeah I follow what your saying. But everytime you use the same instance of
a webservice on the PDA it should have the same session id?

Depends on wheter it returns ie. quits, or if it runs in some kind of loop?
If you call the function several times its a new instance each time, even
though its a button in your PDA program that you just press 10 times in a
row to call the web service 10 times ie. 10 instances.
If you keep it in a loop, and its not ending. Well, then i guess it should
be the same session.
ie. The process is the same, the webservice instance is the same all thats
different is the function I call.
Which in my mind at the moment its behaving like a new process or instance
is started?
Exactly.

If thats the way it is, its pretty crap? any work arounds?

Well actually i do agree. It would be much easier for it to stay alive over
multiple webservice call from the same caller. But even though i can see
that it might be difficult to maintain.

The workarounds depends on what you wanna do. I dont use sessions for
anything anymore. For storing data for the same session i use a database,
for unique ids i use guids. I guess for anything else you have to send some
kind of id forth and back between the PDA and the webservice as a parameter
or something like that.

I used to store the active users on my website in a session variable, but
now its active as long as the program runs. I keep all the maintenance of
logging in, in my PDA app. Encryption might be a good thing here.

Its more work, but to be honest the app. runs much faster than my website
did. So i win in the end ;)


Jimmy
 

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