views:

176

answers:

1

Hi, I'm using hessian protocol for communication betwee server (java) and various client applications. Now I started to develop Windows Phone 7 client. I downloaded hessian C# implementation but it does not compile for windows phone 7/silverlight.

Does anyone managed to make it work on WP7/Silverlight? It's looks like there is many thing to be done/changed to make it work, which I'd like to avoid if it has been done by someone already.

Thanks.

+1  A: 

What is it that does not compile? I'm guessing that the implementation is probably using sockets. Please keep in mind that Silverlight (and thus, wp7) limits the kinds of network connections you can open ... preferring asynchronous web requests (via the WebRequest class) or WCF services.

Chances are the code you downloaded is having problems with the compact framework version of the network classes available on the phone/silverlight. See this msdn article for more information about the socket support:
http://msdn.microsoft.com/en-us/library/cc296248%28VS.95%29.aspx

If you want to communicate directly between the phone and a server running the hessian protocol the easiest way will probably be to proxy communication via a wcf service running on an asp.net server.

Joel Martinez
setting up another windows server with wcf is exactly what we want to avoid... many many errors there.. but I have it solved by now...
Michal
I understand that you'd want to avoid that :-) just out of curiosity, how did you solve it?
Joel Martinez
I had to fix the code.So I took compact framework project included in download which contains only necessary classes for client. Then I had to change CHessianProxy factory, implement own CHessianProxy, rewrite CHessianMethodCaller to work with silverlight's asynchronous requests, replace all ArrayLists with List<Object>, replace all Hashtables with Dictionary<Object,Object> and remove support for xml types since there is no XMLDocument and XMLNode class in silverlight. And new CHEssian proxy is not real proxy since there is no remoting and/or reflection.emit so calling methods is quite verbose
Michal
Also dynamically loading types from assemblies was not working on windows phone so, one has to map c# class to hessian class before using it. For that I had to change also CSerializerFactory...
Michal