views:

438

answers:

4

We need to implement a WCF service on a machine that can only run .Net 2.0.

The machine is a Windows XPe POS terminal, and we have not found a way to install .Net 3.0. We can't really format it with a new XPe image because there is a proprietary POS application and drivers installed.

Is there any way to do implement a WCF service on .Net 2.0? We can use standard XmlSerializer for the messages as .Net CF does, but .Net CF doesn't support being a server...

An alternate solution is to somehow install .Net 3.0, the setup complains about XP SP2 not being installed, and windows update doesn't work on XPe.

Any ideas?

UPDATE: We would also like the option to use SOAP web services, but our target platform does not have IIS installed. Does anyone know a good (production quality) way to host a .Net 2.0 web service without IIS?

SOLUTION: We are using Cassini with .Net 2.0 web services as the marked answer suggested. This seems to be working well thus far. Thanks for the help.

+2  A: 

I can think of two possibilities:

  1. Try one of the systems that will link the many dlls used by your app into a single exe. One of these tools is described here: http://www.remotesoft.com/linker/linker_faq.html
  2. .NET 3.0 was mostly a few new dlls (WPF, WCF, and WF) added into .NET 2.0. You can probably get away with merely copying the appropriate dlls along with your app. (Several people think this is a dangerous idea, but you won't really know until you try it.)
John Fisher
But the OP also wants to run a (Activation) service on CF, that might be a little more involved.
Henk Holterman
We will look into this, I suspect there a whole lot of dlls we'd have to include.
Jonathan.Peppers
This seems like a dangerous approach to me.
JP Alioto
Which part is dangerous? I proposed two solutions.
John Fisher
+3  A: 

It sounds like you've exhausted most of the possibilities. Is there any reason you have to use WCF instead of the plain SOAP web services that .NET 2.0 supports out of the box? While I understand it's frustrating to use the older technology, I suspect you'll have fewer problems by going down the relatively mainstream path than somehow cobbling together a WCF implementation on .NET 2.0.

(I would strongly recommend against trying to use the .NET 3.0 assemblies on .NET 2.0. It may well violate the licence - you'd have to check - but it could also break in subtle ways that would be very hard to debug. After all, who knows exactly what the .NET 3.0 installer is doing? Do you want to chase down every registry key it writes? You may get away with it, but I think it's a bad idea.)

Jon Skeet
We have already implemented the service on WCF and it is in use elsewhere, our implementation is pretty layered and on the end of the service is an interface that does all the work for each WCF call. When we have to integrate with another POS application, we merely implement the interface in a new class--so we were trying to keep this infrastructure in place. I think your recommendation of using web services might be our best bet, we are just going to have to implement a new layer to swap between using WCF and SOAP web services, any further ideas?
Jonathan.Peppers
We just discovered that our image of XPe does not have IIS installed so it looks like we can't use SOAP web services unless we can host them in process instead of from IIS. Is there a good way to do this?
Jonathan.Peppers
@Jonathan: Hmm. You could look at UltiDev Cassini: http://ultidev.com/products/Cassini/
Jon Skeet
I think this is our solution, seems to work well so far.
Jonathan.Peppers
A: 

The answer is no. You cannot install or somehow use WCF on a 2.0 system

Your options are:

  • WCF is built to work with all WS-* standards. You may use Web Services Enhancements (WSE) 3.0 or hand code your own class using remoting .net classes.
  • You may look at Mono Olive. It is supposed to be open source replication of WCF.
Emre Aydinceren
-1: WSE is obsolete. It should never be used if there is any other choice. Like if someone will die if WSE is not used. Lose an arm - don't use it.
John Saunders
I think Olive is a little too experimental for what we want to use it for. It even says so on their site, good comment nonetheless.
Jonathan.Peppers
Saunders: Using outdated technology is a viable option if you are stuck with outdated technology. Questions states that they cannot upgrade to 3.0.. What else suggestion you have?
Emre Aydinceren
WSE is not outdated. It's obsolete, and nearly unsupported.
John Saunders
+1  A: 

Can't you put a "Proxy" in between? So your POS talks to the Proxy using SOAP/ASMX and the Proxy then talks to the WCF Service.

I agree, trying to "hack" .net 3.0 DLLs into a .net 2.0 system sounds like a world of pain.

Michael Stum