Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Everybody,

I have a print method it's working locally but this web service(web method) host in IIS6.0.


C#
//this is my code
const string acrobatPath = @"C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe";

            string parameters = String.Format("/t /o {0} \"{1}\"", pdfFilepath, printerName);
            System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo(acrobatPath, parameters);

            System.Diagnostics.Process process = System.Diagnostics.Process.Start(processStartInfo);
            System.Threading.Thread.Sleep(10000);
            process.WaitForInputIdle(15 * 1000);
            process.Kill();


In my web application add web service reference call this method not working.
consuming web services in web application
Error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: Cannot process request because the process has exited.

Can I know were i wrong.
any one help out this.

Thank U.
Posted
Updated 9-Nov-11 19:27pm
v6

How can it work, in principle? First, you are using a hard-coded file path name. No matter what your application is, even if it was not a Web application, there is no situations when using any hard-coded path can be used. This is a way to make it working only on your computer.

More importantly, you're doing it on the server side. What, a Web user clicks on some control, and the server computer will print something? And the server is connected to a printer? :-) And you are ready to print everything the users might start to print? Do be serious.

—SA
 
Share this answer
 
Using Java Script I have done this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900