1

I have a problem that needs some StackOverflow help.

I am trying to print to a printer from a web page using C#.Net and WCF. The WCF Service is on the web server. I have a local application which has a method:

void print(string content);

I need to call this function from the server, is there any way to call this function on the client without setting up a service on the client/printing machine.

One solution I thought of, was the have the client machine constantly call a shouldPrint() function (say every 2-3 seconds) that returns a string with the content to print (if there is any). But this would have scalability issues, since 5 machines calling the function every 2 seconds is a bit much.

Is there a better solution than anybody knows of? Some kind of server-to-server event listener?

Thanks in advance.

gunwin
  • 4,578
  • 5
  • 37
  • 59
  • 1
    I don't see how you could do this, without either setting up a callback contract (so that the server can call back to the client; basically establishing a "service" on the client side) or having a separate, explicit service on the client that the server can call. You need some defined way of communicating back - there's no "black magic" to get this going... – marc_s Jan 04 '12 at 20:05
  • Wouldn't WCF + XML-RPC work in this scenario? http://stackoverflow.com/questions/2878447/tutorial-simple-wcf-xml-rpc-client – Kori Jan 04 '12 at 20:23

1 Answers1

0

Take a look at WCF Callbacks: http://idunno.org/archive/2008/05/29/wcf-callbacks-a-beginners-guide.aspx

Matthew
  • 24,703
  • 9
  • 76
  • 110