How to execute vbscript through java

hi i m trying to run vbscript (that accept some command line arguments) through java .
my vbs file is stored in c: drive
purpose of vbs file : to map network drives.
i normally run it from command prompt using following syntax
c:\cscript map.vbs l: \\10.22.122.35\d$ <username> <password>
code in map.vbs
map.vbs
Dim objNetwork
Set objNetwork = WScript.CreateObject("WScript.Network")
strLocalDrive = WScript.Arguments.Item(0)
strRemoteShare = WScript.Arguments.Item(1)
strPer = "FALSE"
strUsr = WScript.Arguments.Item(2)
strPas = WScript.Arguments.Item(3)
objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, strPer, strUsr, strPas
my problem is i can easily accomplish this by using .batch file but i dont want to reveal my username and password
i just want to know is there any way thru which i can somehow link java program with dos command and execute vbs file
from my java program.
the code that i have got is not working properly or has to be modified to work.
          String os = System.getProperty("os.name").toLowerCase();
     if (os.indexOf("windows") != -1)
          String[] command = new String[]{"cmd.exe", "/c","cscript","c:\\map.vbs", '"'+strDrive+'"','"'+strPath+'"',"<username>" ,"<password>"};
          Runtime.getRuntime().exec(command);
Kindly help me as this is very urgent.

prompt for the login, the password, and the new share name, and store them in variables, then, you can do something like:
Runtime.getRuntime().exec("net use " + sharenameVar + " \\\\HOST\\share /user:HOST\\" + userVar + " \"" + passwordVar + "\"");with the following values:
HOST: PC10
user : toto
pass : a password
sharename: I:
it will result in :
net use I: \\PC10\share /user:PC10\toto "a password"
this will map the new share with the given credentials ; there is no need to add some complexity by using a vbscript to do that

Similar Messages

  • Kindly send anybody a ppt on how to execute reports through Browser and Ana

    Hi all,
    I need a PPT on how to execute reports through Browser and Analyzer in version 3.5 or older to 3.5 immediatley from end user point of view. I donot have time to prepare it and has to be sumbmitted before end of the day.
    Kindly help me out by sending it [email protected] .
    Thanks in Advance.
    Anil Kumar Sharma .P

    Thank you Mr. Voodi,
    I will wait for your reply.
    Meanwhile could anybody else ,send me PPT on it.
    Thanks in Advance,
    Anil Kumar
    Message was edited by:
            Anil Kumar Sharma

  • Error while running executable file through java in WinNT

    I would like to run an executable file with Java.
    - If I try with notepad or paint, i.e. Windows Applications,
      I have no problem.
    - I also can run Non-Windows-Own Applications, except one.
      I get an error message, if I want to run this program through Java.
    I have tried following commands to run an executable file.
    Runtime.getRuntime().exec("cmd.exe /c "+command);
    Runtime.getRuntime().exec("cmd.exe /c start "+command);
    Runtime.getRuntime().exec("cmd.exe /c start /wait "+command);
    Runtime.getRuntime().exec("cmd.exe /k start "+command);
    command : the path to the executable file
    I can run the application directly, if I click the icon on desktop,
    but not through Java.
    here is the error message I get
    screenshot : http://www.aykut.de/error_message.jpg
    Text : "Security Check failure"
            The Logon System has been tampered with.
            The Administrator will need to re-install.
    my Idea :
    The application is "old".
    I think it was written for Win 3.1.
    Therefore I don't know if there is any other
    possibilty to run a "DOS Exe File" through Java.

    I have just figured out how it works,
    if somebody else here in forum have this problem,
    here is the solution :
    String path = "F:\...\...\Application.exe";
    String envDir = path.substring(0, path.lastIndexOf("\\"));
    String[] command = {"cmd.exe", "/c", "start", "/wait", "/D"+envDir, path};
    Process process = Runtime.getRuntime().exec(command);
    "start /Dpath" => path: environment directory F:\...\...\
    "start /wait" => wait until Application.exe terminates
    if you use Win95 or Win98 use command.com instead of cmd.exe
    Aykut

  • Executing Cygwin through JAVA

    Hey guys,
    I am having a bit of a problem here trying to figure out how to execute cygwin and run cygwin commands through java. So far I have this code below; I ultimately want to make cygwin run an egrep command, but for now I am trying ls -la as a test. I am pretty sure that I need some way of calling the cygwin.bat or bash.exe files, but I am not sure how or where to do this. Thanks for all your input!
             try
                  String cmd = "ls -la";
                       Runtime rt = Runtime.getRuntime();
                      Process proc = rt.exec(cmd);
                      proc.waitFor();
                      BufferedReader buf = new BufferedReader(new InputStreamReader(proc.getInputStream()));
                      String line = "";
                       while ((line=buf.readLine())!=null) {
                            System.out.println(line);
             catch (Throwable t)
                  t.printStackTrace();

    And what does that code do? Do you have any problems?
    Generally, whenever you use exec(), you must read [_When Runtime.exec() won't_|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] (yes, even f you already read it. Read it again!)
    The mistakes explained in there are so common, that the article (all 4 pages of it) should be part of the documentation.
    Also: implementing this correctly is possibly more work than re-implementing the feature of egrep that you want. Java has regular expression support and reading text files is not too hard, so it should be quite easy to implement that.

  • Callin VBScript through Java

    Hi
    I have one Vb Script method. I want to call it through j*ava Method or i wanna run it through Java Code.*
    VBScript has the code to create user in Email Server.
    Could anyone please suggest some way to fulfill this requirement?

    JUST_YOU wrote:
    Hi
    Thanks for the reply but it is throwing IOException at this line.Do you know how to program in Java at all? If not, how about you start with the tutorials? At the very least brush up on exception handling.
    Additionally, [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] is a good article if you need to work with Runtime.exec.

  • How to send sms through java program?

    hi,
    i am trying to send sms through java program.i am usining ubuntu 6.04.i am using modem MC35i.i use the jSMSEnjine.jar and rxtxcomm.jar.
    these are the following program.
    import org.jsmsengine.*;
    import java.util.*;
    class SendMessage
         public static void main(String[] args)
              int status;
              // Create jSMSEngine service.
         CService srv = new CService("Com2",9600);
              //CService srv = new CService("COM2",9600);
              System.out.println();
              System.out.println("SendMessage(): sample application.");
              System.out.println(" Using " + srv._name + " " + srv._version);
              System.out.println();
              try
                   //     Initialize service.     
                   srv.initialize();
                   Thread thread =Thread.currentThread();
                   thread.sleep(1000);
                   System.out.println(srv);
                   //     Set the cache directory.
                   srv.setCacheDir(".\\");
                   //     Set the phonebook.
                   //     srv.setPhoneBook("../misc/phonebook.xml");
                   //     Connect to GSM device.
                   status = srv.connect();
                   //     Did we connect ok?
                   int st=CService.ERR_OK;
                   System.out.println(st);
                   System.out.println(status);
                   if (status == CService.ERR_OK)
                        //     Set the operation mode to PDU - default is ASCII.
                        srv.setOperationMode(CService.MODE_PDU);
                        // Set the SMSC number (set to default).
                        srv.setSmscNumber("");
                        //     Print out GSM device info...
                        System.out.println("Mobile Device Information: ");
                        System.out.println("     Manufacturer : " + srv.getDeviceInfo().getManufacturer());
                        System.out.println("     Model : " + srv.getDeviceInfo().getModel());
                        System.out.println("     Serial No : " + srv.getDeviceInfo().getSerialNo());
                        System.out.println("     IMSI : " + srv.getDeviceInfo().getImsi());
                        System.out.println("     S/W Version : " + srv.getDeviceInfo().getSwVersion());
                        System.out.println("     Battery Level : " + srv.getDeviceInfo().getBatteryLevel() + "%");
                        System.out.println("     Signal Level : " + srv.getDeviceInfo().getSignalLevel() + "%");
                        //     Create a COutgoingMessage object and dispatch it.
                        //     *** Please update the phone number with one of your choice ***
    // String smsLengthTest="Hi"+"\nTesting is going on.Test for sending unlimited number of charecter.So you will get N number of SMS.Initially I trancate the whole string by 70 charecter.Later I will put it upto 90 charecter.Some chararecter should kept for header portion.I don't know the total number.It is just test.If you got the sms u should appreciate me...This is Ripon...I have written sms program";
    String smsLengthTest="Hi\n"+"This is Govindo";
    int mao=smsLengthTest.length();
    System.out.println("Length of sms :"+mao);
    String smsNo="9433314095";
    smsNo="+91"+smsNo;
    if(mao<70)
    COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    else
    // COutgoingMessage msg = new COutgoingMessage(smsNo,smsLengthTest);
    // LinkedList messageList;
    // messageList = new LinkedList();
    // messageList.add(msg);
    // LinkedList maooo=new LinkedList();
    // maooo=srv.splitLargeMessages(messageList);
    int sizelength=0;
    int counter=0;
    sizelength=smsLengthTest.length();
    System.out.println("SMS length :"+sizelength);
    int smsCntr=sizelength/70;
    System.out.println("smsCntr :"+smsCntr);
    counter=smsCntr+1;
    int j=70;
    int k=0;
    try
    for(int i=0;i<smsCntr;i++)
    String test="";
    test=test+i;
    test=smsLengthTest.substring(k,j);
    System.out.println(test);
    System.out.println(test.length());
    COutgoingMessage msg = new COutgoingMessage(smsNo, test);
    System.out.println("hi this is suman" + smsNo);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
    k=k+70;
    j=j+70;
    catch(Exception e)
    System.out.println("Error...1");
    e.printStackTrace();
    e.getMessage();
    String lastPortion=smsLengthTest.substring(k);
    System.out.println(lastPortion);
    COutgoingMessage msg = new COutgoingMessage(smsNo, lastPortion);
    //     Character set is 7bit by default - lets make it UNICODE :)
    //     We can do this, because we are in PDU mode (look at line 63). When in ASCII mode,
    //          this does not make ANY difference...
    msg.setMessageEncoding(CMessage.MESSAGE_ENCODING_UNICODE);
    if (srv.sendMessage(msg) == CService.ERR_OK) System.out.println("Message Sent!");
    else System.out.println("Message Failed!");
                        // Disconnect from GSM device.
                        srv.disconnect();
                   else System.out.println("Connection to mobile failed, error: " + status);
              catch (Exception e)
                   e.printStackTrace();
              System.exit(0);
    the error is:
    SendMessage(): sample application.
    Using jSMSEngine API 1.2.6 (B1)
    org.jsmsengine.CService@addbf1
    0
    -101
    Connection to mobile failed, error: -101
    please help me,its very urgent.

    come back in about 5 years, we may have time for you by then.
    In the meantime, how about contacting the people who wrote that library and asking them nicely for help (rather than trying to order people to drop whatever they're doing and jump through hoops to accommodate your every wish as you're doing here)?

  • Problem while executing BAPI_PRODORD_GET_DETAIL through JAVA using JCo

    Hi All,
    I am trying to get Production Order details in JAVA program using JCo. Following is the code I have written.
    JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);
    JCoFunction function = destination.getRepository().getFunction("BAPI_PRODORD_GET_DETAIL");
    if(function == null)
    throw new RuntimeException("BAPI_PRODORD_GET_DETAIL not found in SAP.");
    function.getImportParameterList().setValue("NUMBER", 1067831);
    JCoStructure struct = com.sap.conn.jco.JCo.createStructure(destination.getRepository().getStructureDefinition("BAPI_PP_ORDER_OBJECTS"));
    struct.setValue("HEADER", 'Y');
    struct.setValue("POSITIONS", 'Y');
    struct.setValue("SEQUENCES", 'Y');
    struct.setValue("OPERATIONS", 'Y');
    struct.setValue("COMPONENTS", 'Y');
    struct.setValue("PROD_REL_TOOLS", 'Y');
    struct.setValue("TRIGGER_POINTS", 'Y');
    function.getImportParameterList().setValue("ORDER_OBJECTS", struct);
    function.getImportParameterList().setValue("COLLECTIVE_ORDER",'Y');
    try
    function.execute(destination);
    catch(AbapException e)
    System.out.println(e.toString());
    return;
    JCoStructure returnStructure = function.getExportParameterList().getStructure("RETURN");
    if (! (returnStructure.getString("TYPE").equals("") ||
       returnStructure.getString("TYPE").equals("S") ||
       returnStructure.getString("TYPE").equals("W")) )
    System.out.println(returnStructure.getString("MESSAGE"));
    JCoTable codes = function.getTableParameterList().getTable("HEADER");
    int iCnt = codes.getNumRows();
    System.out.println("No Of Rows " + iCnt);
    int iFldCnt = codes.getNumColumns();
    JCoMetaData codesMD = codes.getMetaData();
    for (int i = 0; i < codes.getNumRows(); i++)
    codes.setRow(i);
    // Display the data
    The number which I am passing is a valid production order. When I test this BAPI in SAP gui with same input, it gives back the data but when I try to run this through java I always get the return message as this production order does not exist. Is there anything wrong I am doing?
    I am using JCo 3.0
    I have tried passing various values to ORDER_HEADER structure. I have tried getting the structure from import parameter list and then setting the values on that itself. Nothing has worked for me.
    Thanks,
    Dayanand

    The problem is solved. I just set the order number as string and added 0s before the order number to complete the required length. Also I changed the setting import structure for order header. Each field in the structure should have value as 'X' or ' '
    JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);
    JCoFunction function = destination.getRepository().getFunction("BAPI_PRODORD_GET_DETAIL");
    if(function == null)
    throw new RuntimeException("BAPI_PRODORD_GET_DETAIL not found in SAP.");
    function.getImportParameterList().setValue("NUMBER", "000001067831");
    JCoStructure struct = com.sap.conn.jco.JCo.createStructure(destination.getRepository().getStructureDefinition("BAPI_PP_ORDER_OBJECTS"));
    struct.setValue("HEADER", 'X');
    struct.setValue("POSITIONS", 'X');
    struct.setValue("SEQUENCES", 'X');
    struct.setValue("OPERATIONS", 'X');
    struct.setValue("COMPONENTS", 'X');
    struct.setValue("PROD_REL_TOOLS", 'X');
    struct.setValue("TRIGGER_POINTS", 'X');
    function.getImportParameterList().setValue("ORDER_OBJECTS", struct);
    function.getImportParameterList().setValue("COLLECTIVE_ORDER",'X');
    try
    function.execute(destination);
    catch(AbapException e)
    System.out.println(e.toString());
    return;
    JCoStructure returnStructure = function.getExportParameterList().getStructure("RETURN");
    if (! (returnStructure.getString("TYPE").equals("") ||
       returnStructure.getString("TYPE").equals("S") ||
       returnStructure.getString("TYPE").equals("W")) )
    System.out.println(returnStructure.getString("MESSAGE"));
    JCoTable codes = function.getTableParameterList().getTable("HEADER");
    int iCnt = codes.getNumRows();
    System.out.println("No Of Rows " + iCnt);
    int iFldCnt = codes.getNumColumns();
    JCoMetaData codesMD = codes.getMetaData();
    for (int i = 0; i < codes.getNumRows(); i++)
    codes.setRow(i);
    // Display the data
    Regards,
    Dayanand

  • How to execute workflow through javascript in CRM 2013

    Hi,
    I have created a business process and I want to execute workflow on custom button through javascript. I tried this script but this script does not run after message box show. Please tell me how to execute my workflow through javascript
    function RunWorkflow() {
        var _return = window.confirm('Are you want to execute workflow.');
        if (_return) {
            var url = Xrm.Page.context.getServerUrl();
            var entityId = Xrm.Page.data.entity.getId();
            var workflowId = '541B45C9-3F88-4448-9690-2D4A365C3172';
            var OrgServicePath = "/XRMServices/2011/Organization.svc/web";
            url = url + OrgServicePath;
            var request;
            request = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                          "<s:Body>" +
                            "<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"
    +
                              "<request i:type=\"b:ExecuteWorkflowRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\"
    xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">" +
                                "<a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">"
    +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>EntityId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + entityId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>WorkflowId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + workflowId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                "</a:Parameters>" +
                                "<a:RequestId i:nil=\"true\" />" +
                                "<a:RequestName>ExecuteWorkflow</a:RequestName>" +
                              "</request>" +
                            "</Execute>" +
                          "</s:Body>" +
                        "</s:Envelope>";
            var req = new XMLHttpRequest();
            req.open("POST", url, true)
            // Responses will return XML. It isn't possible to return JSON.
            req.setRequestHeader("Accept", "application/xml, text/xml, */*");
            req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
            req.onreadystatechange = function () { assignResponse(req); };
            req.send(request);
    function assignResponse(req) {
        if (req.readyState == 4) {
            if (req.status == 200) {
                alert('successfully executed the workflow');

    Hi,
    I used this script for execute the workflow but its not working. When I used alert(req.status); then 500 show. Please tell me what did I mistake in my script.
    function RunWorkflow() {
        var _return = window.confirm('Are you want to execute workflow.');
        if (_return) {
            var url = Xrm.Page.context.getClientUrl();
            var entityId = Xrm.Page.data.entity.getId();
            var workflowId = '541B45C9-3F88-4448-9690-2D4A365C3172';
            var OrgServicePath = "/XRMServices/2011/Organization.svc/web";
            url = url + OrgServicePath;
            var request;
            request = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
                          "<s:Body>" +
                            "<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"
    +
                              "<request i:type=\"b:ExecuteWorkflowRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\"
    xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">" +
                                "<a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">"
    +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>EntityId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + entityId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                  "<a:KeyValuePairOfstringanyType>" +
                                    "<c:key>WorkflowId</c:key>" +
                                    "<c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">"
    + workflowId + "</c:value>" +
                                  "</a:KeyValuePairOfstringanyType>" +
                                "</a:Parameters>" +
                                "<a:RequestId i:nil=\"true\" />" +
                                "<a:RequestName>ExecuteWorkflow</a:RequestName>" +
                              "</request>" +
                            "</Execute>" +
                          "</s:Body>" +
                        "</s:Envelope>";
            var req = new XMLHttpRequest();
            req.open("POST", url, true)
            // Responses will return XML. It isn't possible to return JSON.
            req.setRequestHeader("Accept", "application/xml, text/xml, */*");
            req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
            req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
            req.onreadystatechange = function () { assignResponse(req); };
            req.send(request);
    function assignResponse(req) {
        if (req.readyState == 4) {
    alert(req.status);
            if (req.status == 200) {
                alert('successfully executed the workflow');

  • How to execute a custom java code from the process

    Hi All,
    I'm writing a process to generate the PDF and it works fine. Now, at the end or in the middle of the process, i would like to execute/write a java code then it will be invoked when the process running. Assume not using web service, is there another way? samples how to write custom code?
    Thanks,

    The Execute Script service allows you to execute java code on a particular step.
    A more robust solution would be to create a custom component for your custom code.
    Jasmin

  • How to execute programs by java (shell excecute)

    i need to know how to execute a prog or a system call by java and pass tp it an argument

    Hi, look at the java.lang.Runtime class.
    eg Runtime.getRuntime().exec(<command>, <arguments>);
    ;) Patrick

  • How to Invoke BPEL through JAVA

    I am struggling since last 4-5 days to invoke BPEL process through java.
    So can any one provide me with full code.
    I want any java code like jsp,core java,servlets etc.
    Here is my jsp code with which I am trying to invoke my BPEL process named 'invoke'.which has just one input parameter 'InvokeProcessRequest'.
    The error is 500 internal server error.
    also,
    I want to know,
    what parameter to write in Locator class.
    whether we have to make in changes in any xml file or so.
    <%@page import="com.oracle.bpel.client.Locator" %>
    <%@page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@page import="com.oracle.bpel.client.dispatch.IDeliveryService" %>
    <html>
      <head>
       <title>InvokeBPEL</title>
      </head>
    <body>
    <%
      String Payload = request.getParameter("Payload");
    %>
        <!-- Construct HTML form here -->
         <h3>Invoke</h3>
    <h4>Application Form</h4>
    <form>
       <table>
       <tr>
         <td>Payload</td>
         <td><input type="text" name="Payload" value="123456789"></td>
       </tr>
       <tr>
         <td>InvokeProcessRequest</td>
         <td><input type="text" name="InvokeProcessRequest" value="invoke"></td>
       </tr>
       </table>
       <input type="submit" value="Send Application">
    </form>
    <%
        // 1. Get form fields
         String InvokeProcessRequest = request.getParameter("InvokeProcessRequest"); 
        // 2. Create loan application XML document
          String xml = "<invoke xmlns=\"http://www.w3.org/2001/XMLSchema\">"      
             + "<Payload>" + Payload + "</Payload>"     
          + "<InvokeProcessRequest>" + InvokeProcessRequest + "</InvokeProcessRequest>"     
            + "</invoke>";
        // 3. Initiate the BPEL process here
          // Connect to Oracle BPEL server
             Locator locator = new Locator("default","bpel");
            IDeliveryService deliveryService = (IDeliveryService)
            locator.lookupService(IDeliveryService.SERVICE_NAME );
             // Construct a normalized message and send to Oracle BPEL Process Manager  
         NormalizedMessage nm = new NormalizedMessage();  
         nm.addPart("payload", xml);
           // Initiate the BPEL process  
         deliveryService.post("invoke", "initiate", nm);
         %>    <p>BPEL Process <code>MyLoanFlow</code> initiated    
                 with a loan application containing Payload=<%= Payload %></p>
               <p>Please refer to the   
               <a href="/BPELConsole/displayInstance.jsp">BPEL Console</a>
                to see the status of the initiated MyLoanFlow BPEL Process.</p>
         <%
    %>
    </body>
    </html>

    Krishna, Not sure what you mean by 'normal' web service....I mean, is BPEL service not normal, is it not as per WS standards. It would be interesting if you could shed some light on that.
    On the question of calling BPEL, I thought there were two methods - one is using the BPEL PM API, which uses the locator class to get hold of BPEL PM instance and then call a deployed bpel service
    The other way is to develop a web service proxy using JDeveloper. Its a very simple process. Once you do that, you can call the proxy from Java.

  • How to execute commands from Java

    hi,
    i m trying to execute a CVS command from a java environment. i m writing this code to create a user. for this i m executing this cvs command "cmd /c cvs passwd -r <username> -a <new-username>"
    after executing this cmd the command prompt will prompt for a pasword and then after entring the password i have to retype the password for confirmation. the existing code execcutes the command but i don t know how to read the prompt for password.
    <code>
    import java.io.*;
    import java.lang.*;
    public class first {
    public static void main(String[] args) {
    try {
    Process p = Runtime.getRuntime().exec("cmd /c cvs passwd -r gopalakrishnan_k -a ram");
    InputStreamReader reader=new InputStreamReader(System.in);
    BufferedReader OptFromCmd = new BufferedReader(new InputStreamReader(
    p.getInputStream()));
    BufferedReader fromKeyboard = new BufferedReader(reader);
    BufferedReader stdError = new BufferedReader(new InputStreamReader(
    p.getErrorStream()));
    OutputStream stdOut = p.getOutputStream();
    String s;
    String pswd = "mahesh";
    System.out.println("Success");
    int i = 0;
    while ((s = OptFromCmd.readLine()) != null) {
    //s = OptFromCmd.readLine();
    i++;
    System.out.println(s);
    System.out.println(i);
    if (i > 1) {
    stdOut.write(pswd.getBytes());
    stdOut.flush();
    System.out.println(
    "Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
         /* Your Password Here */
         String password="Password Please";
         stdOut.write(password.getBytes());
    stdOut.flush();
         stdOut.write(password.getBytes());
    stdOut.flush();
         /* Your Password here */
    OptFromCmd.close();
    stdError.close();
    stdOut.close();
    } catch (Exception e) {
    e.printStackTrace();
    </code>
    [o/p]
    this program gives the output as
    adding the user <username>
    password:
    now i need to enter the password from java envronment and provide it in the command prompt .
    then it prompts for the password again for confirmation so i have to retype the password again
    how to acheive this.

    String abc[]={"sh","-c","/dir1/dir2/dir3/scanVirus/uvscan --clean -- delete --exit-on-error ../*.*>abcde.txt"};
    Runtime runtime = Runtime.getRuntime();
    Process p = runtime.exec(abc);
    when it founds any infected file the process is not terminated correctly and it gives the following error :
    "java.lang.Exception: Process failed to terminate correctly"
    but it deletes the infected file.
    and running the program second time (after deletion of infected file), it executed fine.
    Wating for help.
    Regards,
    Sundeep.

  • Error while executing SQL through Java snippet in ADF

    Hi,
    I am taking inputs taken from user using ADF UI and storing this input data in XML File.With this Input.xml, I build a sql Query and execute using java program within the same ADF application.
    I am getting following error:
    java.sql.SQLException: SQL string is not Query
    If I run the Java program with the same Input.xml separately, it doesnot error out.
    Any help would be great
    Thanks
    Sushama

    Hi Sushama,
    We require more information to provide you with a more accurate solution:
    1- Do you have a business method (on your Application Module or Session Bean) where you create the query? Can you try to test this method on a TestClient java class or AM Tester if applicable and validate the method works without a problem.
    2-On your viewController project set the following argument to your run setting -Djbo.debugoutput=console. This in order to check what kind of SQL statement is being generated.
    For more information on debugging please go to: http://www.oracle.com/technology/products/jdev/tips/muench/debugger/index.html
    -Juan Camilo

  • How to stop rmiregistry through java coding?

    Hi,
    I don't know how to write java program to stop rmiregistry running on port 1099 ?
    Could anyone please help me?
    If possible please tell me the logic behind server shutdown program, like what we have in tomcat server, jboss etc.,
    Thanks and Regards
    Ram

    hi,
    Consider I'm working in the same JVM, I started rmiregistry using the command "LocateRegistry.createRegistry()". With respect to this scenario, please tell me how to stop the rmiregistry (say running on the port 1099)?
    Thanks and Regards,
    Ram

  • How to create trigger through Java programm?

    I write a Java programm to create a trigger(through JDBC connection). After I run the programm, a trigger was created in Oracle 10g.But the trigger is invalid. After Compiling the trigger , a error "PLS-00103 " occured .But if I excute the SQL in SQL developer,the trigger was created successfully.
    If there is some special considerations should be taken when using programm to create trigger?
    My Java programm fragment as follows:
         public void createTrigger() throws SQLException{
              Statement stmt = conn.createStatement();
              stmt.executeUpdate(getCreateTriggerSql());
    Edited by: jerry on 2010-6-29 下午6:42

    Yes the special consideration is you shouldn't perform DDL on the fly, as it has all kinds of unwanted side effects like implicit commits.
    If I would start a company, and I discover one of my developers is writing this kind of program, I would fire him, on the spot.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Another "iTunes won't open!" thread. Incl. detailed description and depair!

    Hello guys! First of all I want to apologize for any bad/incorrect language. Not only am I frustrated, but I'm Swedish aswell. THE PROBLEM My problem is the same one many others seem to have. iTunes has gone from working fine, to not working at all o

  • Problem with VLAN Trunking within RHEL6.6 VM on Hyper-V 2012 R2?

    Hello, I'm wondering if there is a known issue with using a "trunk" mode interface within a RHEL6.6 VM?  I found the following article: https://technet.microsoft.com/en-us/library/dn531026.aspx Where note 1 reads: "For this specific RHEL/CentOS relea

  • Role created in ERM is not appearing in CUP request for assignment-GRC 10.0

    Hi, We are on GRC 10.0 - SP5 We have created a role in ERM and it was succesfully created in backend system. However when we tried to assign the same role using CUP request - the role is not appearing. 1) Do we need to upload roles for CUP  in GRC 10

  • Qosmio G30 buzzes when connected to a Pa System

    I am using my Qosmio G30-201 laptop with my djing system. When I connect this to my mixer I get a loud buzzing sound coming through the speakers. If I disconnect the charger it stops buzzing. Is there anything I can do to stop this sound as I do need

  • Exception in switch condition

    When I compile the following fragment of BPEL: <switch name="switch-6">      <case condition="bpws:getVariableData('precio') < bpws:getVariableData('OfertaAlsa','','/tns:OfertaViaje/tns:precio')"> it raises the following exception: [bpelc] [Error de