none
WCF service to be called from Windows CE

    Question

  • Hi

    My goal is to have a windows mobile ask a server about a list of products. The server could be behind a firewall, NAT, citrix and who knows what else.

    So, to achieve this my current solution is to self host in a windows service as local system. This works in my development environment but probably not in real world scenarios.

    I don't want any support calls regarding connection problems, so my current thought is to host the web service on the internet. In that way, I have a windows mobile device and a server that only needs outgoing connections on port 80, which I believe is what a browser does. Now this is fine, but complicates my solution. This means that instead of a simple GetProducts() call, I need some kind of command/polling architecture. This is the point where I am confused as to what is possible with WCF.

    What I currently think is like this:

    For my device to get its products, it calls the webservice with a getProducts() call. The web service "blocks" the call and holds a state (memory or file?) about object device id and a command id. The server polls every 10 seconds or so and now detects a command id telling him to deliver its products, which it does. The web service receives the products and continues the execution path and returns them.

    This surely has to be done in an easier way? All comments are welcome.

     

    Kind Regards

    Saturday, November 27, 2010 11:54 PM

Answers

  • You are trying to build a relay service. .Net Service Bus (as part of Azure) already has this:

    http://vasters.com/clemensv/PermaLink,guid,92d78bee-2cfd-4a29-95ab-c5abb9b905e7.aspx

    Even if you decide to build it by yourself I recommend that the relay service will not block the client call. It should save all information it gets from the products service and the CE client should periodically poll it, possibly using WCF polling duplex binding.


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    • Marked as answer by Yi-Lun Luo Friday, December 3, 2010 9:47 AM
    Sunday, November 28, 2010 2:35 AM
  • Hello, if you host the service on the internet, in most cases you don't need Service Bus. I will be shocked if a web hosting ISV dosn't open port 80 for inbound connections. If the ISV supports IIS, you can simply host the WCF service in IIS, and the usual GetProducts call will work fine.

    But if what you mean is you want to host the service inintranet behind NAT and firewall, Service Bus is your friend.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Yi-Lun Luo Friday, December 3, 2010 9:47 AM
    Monday, November 29, 2010 2:44 AM

All replies

  • You are trying to build a relay service. .Net Service Bus (as part of Azure) already has this:

    http://vasters.com/clemensv/PermaLink,guid,92d78bee-2cfd-4a29-95ab-c5abb9b905e7.aspx

    Even if you decide to build it by yourself I recommend that the relay service will not block the client call. It should save all information it gets from the products service and the CE client should periodically poll it, possibly using WCF polling duplex binding.


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    • Marked as answer by Yi-Lun Luo Friday, December 3, 2010 9:47 AM
    Sunday, November 28, 2010 2:35 AM
  • Hello, if you host the service on the internet, in most cases you don't need Service Bus. I will be shocked if a web hosting ISV dosn't open port 80 for inbound connections. If the ISV supports IIS, you can simply host the WCF service in IIS, and the usual GetProducts call will work fine.

    But if what you mean is you want to host the service inintranet behind NAT and firewall, Service Bus is your friend.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Yi-Lun Luo Friday, December 3, 2010 9:47 AM
    Monday, November 29, 2010 2:44 AM