Sie sind auf Seite 1von 3

| SOA Lab

22 December 2015 |4:32:16 PM

3. OPENING NOTEPAD USING JAVA WEB SERVICE


1. SOURCE CODE
package ext;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService(serviceName = "StartingNotepad")
public class StartingNotepad
{
// code to start a notepad application
@WebMethod(operationName = "StartNotePad")
public String StartNotePad()throws Exception
{
// get the runtime object using getRuntime() method
Runtime rt=Runtime.getRuntime();
// start the notepad
Process ps=rt.exec("notepad.exe");
return "Started Notepad successfully...";
}
}

| SOA Lab

22 December 2015 |4:32:16 PM

2. OUTPUT

| SOA Lab

22 December 2015 |4:32:16 PM

2.1. STARTING A NOTEPAD

Das könnte Ihnen auch gefallen