Alternative to Remoting?

  • Thread starter Thread starter Diego F.
  • Start date Start date
D

Diego F.

Hello. I hope someone can help me.

I'm developing an application with Pocket PC that must send objects to a
server and retreive them later. The server has to mantain the objects in a
table, ready for serve them back to the clients.

I thought about using web services, but they doesn't mantain the table to
various clients, as an object is created in each call to a web method. Also,
the proxy created by the web service changes the type of my objects and I
can't convert the original ones into them.

In Windows Applications the solution is using .NET Remoting but I found now
that CF does not support it :-(

It has to be a solution to that. Can you please help me???

Regards,

Diego F.
 
Diego F. said:
Hello. I hope someone can help me.

I'm developing an application with Pocket PC that must send objects to a
server and retreive them later. The server has to mantain the objects in a
table, ready for serve them back to the clients.

I thought about using web services, but they doesn't mantain the table to
various clients, as an object is created in each call to a web method.
They certainly can if you want them to. You could for instance permanently
persist the info in a SqlServer/Oracle table and recreate the object from
that.
Also,
the proxy created by the web service changes the type of my objects and I
can't convert the original ones into them.

Can you show me the code that's doing this? all that the ws is doing is
taking and dishing out XML. From that XML you can make an object of
whatever type you want. For instance, you could get all of the properties
of a datareader, send it to the ws, and have the ws store it in a table. On
a future request, it coudl grab that record. You could create a new reader,
and set the properties so its state matched the old ones and use it
accordingly. THis is probably the lamest example I can think of b/c a
reader doesn't have a lot of properties, but you could do the same with
your custom objects.
In Windows Applications the solution is using .NET Remoting but I found now
that CF does not support it :-(
FYI, I've heard quite a bit of scuttlebutt that Remoting is pretty much
dead, well, about to die is probably a better way of phrasing it. Having
played with both, WS provide a much more pleasant framework to work with by
and large.
 
By your answer I understand that you prefer using WS in all cases, is it? Do
you use WS with your custom objects without any problem? I've read about
people that had to modify the Reference.cs file to make it work. I'll write
some code and post it to show you my problems with WS.

Also the issue about keeping a table into memory. I don't want to use data
bases with that. Just want to have a hash table to store temporary objects
that are available to different clients (Pocket PC devices)

Regards,

Diego F.
 
I'm developing an application with Pocket PC that must send objects to a
server and retreive them later.

I'm using RemObject SDK from www.remobjects.com to feed data into my PPC
application - works very, very well!

Cheers,
Lars
 
Diego F. said:
By your answer I understand that you prefer using WS in all cases, is it?
At first, no, but since I've had a fair amount of exposure with both,
absolutely.
Do
you use WS with your custom objects without any problem?
Yes, but I can represent the overwhelming majority of my objects with a
datatable so I use datasets for simplicity much of the time.
I've read about
people that had to modify the Reference.cs file to make it work. I'll write
some code and post it to show you my problems with WS. Cool

Also the issue about keeping a table into memory. I don't want to use data
bases with that. Just want to have a hash table to store temporary objects
that are available to different clients (Pocket PC devices)
Haven't done that, I like db's for persistence. Let me think about it.

BTW, you may want to check out Casey Chesnut's sight www.brains-n-brawn.com
, he's the man in many areas, but PPC + WS is his specialty.
 
This is a post about sockets. Can I pass objects directy using sockets? This
time I don't want to spend the time if I'm not going to get what I need ;-)

Regards,

Diego F.
 
I'm trying this:

- A common DLL with two classes: one of them is the main class (class User)
and the other is just a container with a hash table that stores User
objects.
- A console application that uses remoting to work with container objects.
- A web service that exposes web methods to get a User object and send it to
the table in the remote application via remoting.
- The clients that calls the web service methods.

First I have to solve is what I told you about the casting. The web service
creates its own User class and I can't convert my User objects to the WS
ones. The web methods expect the web service User objects.

How to solve that?

Supposing I solve that, is my idea possible?

Regards,

Diego F.
 
you can certainly pass data directly using sockets.
the problem is that CF does not have binary or xml serializers exposed,
so you would have to come up with your own format over the wire.

casey
http://www.brains-N-brawn.com

Diego F. said:
This is a post about sockets. Can I pass objects directy using sockets?
This
time I don't want to spend the time if I'm not going to get what I need
;-)

Regards,

Diego F.
 
to get around the casting problem:
[you created your fat-object with all the fields, properties, and methods
server side.
then client side, all you have is a lightweight version of that object:
public fields and properties, but no methods.]

1st create your fat-object in a CE class lib.
Give your objects an explicit XML namespace like this:
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public class MyClass
{
...
}

Add a reference to that class lib from your web service.
Your WebMethods will then use those objects as parameters, return values:
[WebMethod]
public SmartDeviceLibrary1.MyClass GetMyClass()
{
...
}

2nd, for the client, add a reference to the WS and to the class lib.
Now modify the auto gen'd web service proxy to use the class lib object,
and not the light weight class that was generated.
So the WS response will be deserialized into the object which has methods
and such.

Now in your app code, you will be working with the fat-object.

Thanks,
casey
http://www.brains-N-brawn.com
 
Back
Top