Send A String To Keyboard Output

Hello, i've come to a stop in my project as i cannot figure out how to send a whole string to the "Keypress".
The simple code to print single letters is easy but does not support multiple lettering or a string. Is there another method or away round this? Also, the clipboard method cannot be used as it is not supported by my application.
Thank you.

We don't need StringBuffer class. String class makes all things.
You can clear unused methods or fields as you need.
* Copyright (c) 1995 - 2008 Sun Microsystems, Inc.  All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*   - Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*   - Redistributions in binary form must reproduce the above copyright
*     notice, this list of conditions and the following disclaimer in the
*     documentation and/or other materials provided with the distribution.
*   - Neither the name of Sun Microsystems nor the names of its
*     contributors may be used to endorse or promote products derived
*     from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* KeyEventDemo
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.*;
import javax.swing.*;
public class KeyEventDemo extends JFrame
        implements KeyListener,
        ActionListener
    JTextArea displayArea;
    JTextField typingArea;
    static final String newline = System.getProperty("line.separator");
    public static void main(String[] args) {
        /* Use an appropriate Look and Feel */
        try {
            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
            UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
        } catch (UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
        } catch (IllegalAccessException ex) {
            ex.printStackTrace();
        } catch (InstantiationException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        /* Turn off metal's use of bold fonts */
        UIManager.put("swing.boldMetal", Boolean.FALSE);
        //Schedule a job for event dispatch thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
    private static void createAndShowGUI() {
        //Create and set up the window.
        KeyEventDemo frame = new KeyEventDemo("KeyEventDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Set up the content pane.
        frame.addComponentsToPane();
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    private void addComponentsToPane() {
        JButton button = new JButton("Clear");
        button.addActionListener(this);
        typingArea = new JTextField(20);
        typingArea.addKeyListener(this);
        //Uncomment this if you wish to turn off focus
        //traversal.  The focus subsystem consumes
        //focus traversal keys, such as Tab and Shift Tab.
        //If you uncomment the following line of code, this
        //disables focus traversal and the Tab events will
        //become available to the key event listener.
        //typingArea.setFocusTraversalKeysEnabled(false);
        displayArea = new JTextArea();
        displayArea.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(displayArea);
        scrollPane.setPreferredSize(new Dimension(375, 125));
        getContentPane().add(typingArea, BorderLayout.PAGE_START);
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        getContentPane().add(button, BorderLayout.PAGE_END);
    public KeyEventDemo(String name) {
        super(name);
    /** Handle the key typed event from the text field. */
    public void keyTyped(KeyEvent e) {
        displayInfo(e, "KEY TYPED: ");
    /** Handle the key pressed event from the text field. */
    public void keyPressed(KeyEvent e) {
        displayInfo(e, "KEY PRESSED: ");
    /** Handle the key released event from the text field. */
    public void keyReleased(KeyEvent e) {
        displayInfo(e, "KEY RELEASED: ");
    /** Handle the button click. */
    public void actionPerformed(ActionEvent e) {
        //Clear the text components.
        displayArea.setText("");
        typingArea.setText("");
        //Return the focus to the typing area.
        typingArea.requestFocusInWindow();
     * We have to jump through some hoops to avoid
     * trying to print non-printing characters
     * such as Shift.  (Not only do they not print,
     * but if you put them in a String, the characters
     * afterward won't show up in the text area.)
    private void displayInfo(KeyEvent e, String keyStatus){
         String s=null;
        //You should only rely on the key char if the event
        //is a key typed event.
        int id = e.getID();
        if (id == KeyEvent.KEY_PRESSED) {
            char c = e.getKeyChar();
            s=Character.toString(c);
        displayArea.append(s);
}

Similar Messages

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

  • Once I send 1 string, the rest are cut off, any ideas?

    Hello everyone.
    For some reason when I send my first string through the socket, everything works fine. But after that Its cutting off the first 2 or 3 characters of the string and I have no idea why because I'm flushing the output buffer before and after I send the the string to the output buffer.
    note: complete code can be found here:
    http://cpp.sourceforge.net/?show=38132
    Am I not flushing right?
    Here's the code:
    public class MultiThreadServer implements Runnable {
    //csocket is whatever client is connecting to this server, in this case it will
    //be a telnet client sending strings to the server.
         Socket csocket;
      MultiThreadServer(Socket csocket) {
        this.csocket = csocket;
      public void run() {
           //setting up sockets
           Socket outputServ = null;
           //create a message database to store events
              MessageDB testDB = new MessageDB();
           try {
          //setting up channel to recieve events from the omnibus server
             BufferedReader in= new BufferedReader(
                        new InputStreamReader(
                        csocket.getInputStream()));
             PrintWriter out2
              = new PrintWriter(
              new OutputStreamWriter(
              csocket.getOutputStream()));
             //This socket will be used to communicate with the z/OS reciever
             //we will need a new socket each time because this is a multi-threaded
             //server thus, the  z/OS reciever (outputServ) will need to be
             //multi threaded to handle all the output.
             outputServ = new Socket("localhost",1234);
             if(outputServ.getLocalSocketAddress() == null)
                  System.out.println("OutputServer isn't running...");
             //Setting up channel to send data to outputserv
              PrintWriter out
                   = new PrintWriter(
                   new OutputStreamWriter(
                   outputServ.getOutputStream()));
         String input;
         //accepting events from omnibus server and storing them
         //in a string for later processing.
         while ((input = in.readLine()) != null)  
              //looking to see what telnet gets
              out2.println(input);
              out2.flush();
             //accepting and printing out events from omnibus server
             //also printing out connected client information
              System.out.flush();     
              System.out.println("Event from: " + csocket.getInetAddress().getHostName()
                            +"-> "+ input +"\n");
             System.out.flush();
                  //sending events to output server
              out.flush();
                  out.println(input);
                  out.flush();
                  //close the connection if the client drops
                  if(in.read() == -1)
                       System.out.println("Connection closed by client.");
                       break;
        //cleaning up
          in.close();
          out.close();
          outputServ.close();
          csocket.close();
           catch (SocketException e )
                System.err.println ("Socket error: " + e);
           catch(UnknownHostException e)
                System.out.println("Unknown host: " + e);
              catch (IOException e)
               System.out.println("IOException: " + e);
    }Here's some example output I'm getting from the telnet screen which is (out2) stream:
    This is a test
    This is another test
    his is another test
    This is yet another test
    his is yet another test
    This is a test worked fine, as you can see, it outputed This is a test when I typed it in.
    The next string "This is another test" fails, as you can see its echoing out:
    his is another test
    I'm also printing out the contents to the console, and i'm getting out the same thing:
    Enter port to run server on:
    3333
    Listening on : ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=3333]
    Waiting for client connection...
    Socket[addr=/127.0.0.1,port=2184,localport=3333] connected.
    hostname: localhost
    Ip address: 127.0.0.1:3333
    Event from: localhost-> This is a test
    Event from: localhost-> his is another test
    Event from: localhost-> his is yet another test
    Connection closed by client.
    ANy help would be great!
    Message was edited by:
    lokie

    I posted more compact code so its easier to see and understand: The run() function is where the problem is occurring.
    //SAMPLE OUTPUT FROM CONSOLE
    Enter port to run server on:
    3333
    Listening on : ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=3333]
    Waiting for client connection...
    Socket[addr=/127.0.0.1,port=2750,localport=3333] connected.
    hostname: localhost
    Ip address: 127.0.0.1:3333
    Event from: localhost-> This is a test
    Event from: localhost-> his is a test
    Event from: localhost-> his is a test
    Connection closed by client.
    //------END OF SAMPLE OUTPUT-----//
    //---THis class is called everytime a new thread is created,
    //only 1 thread is created because only 1 client is connecting to the
    //server
    package server;
    //parser server
    import java.io.IOException.*;
    import java.io.*;
    import java.net.*;
    import java.util.Scanner;
    public class MultiThreadServer implements Runnable {
         Socket csocket;
    MultiThreadServer(Socket csocket) {
      this.csocket = csocket;
    public void run() {
           try {
        //setting up channel to recieve events from the omnibus server
           BufferedReader in= new BufferedReader(new InputStreamReader(csocket.getInputStream()));
         String input;
         //accepting events from omnibus server and storing them
         //in a string for later processing.
         while ((input = in.readLine()) != null)  
           //accepting and printing out events from omnibus server
           //also printing out connected client information
              System.out.println("Event from: " + csocket.getInetAddress().getHostName()
                          +"-> "+ input +"\n");
              System.out.flush();     
                //close the connection if the client drops
                if(in.read() == -1)
                     System.out.println("Connection closed by client.");
                     break;
      //cleaning up
        in.close();
        csocket.close();
           catch (SocketException e )
                System.err.println ("Socket error: " + e);
           catch(UnknownHostException e)
                System.out.println("Unknown host: " + e);
              catch (IOException e)
               System.out.println("IOException: " + e);
    //This is the main function, the only thing it does is
    //create a new thread on each connection.
    package server;
    //This is the parser Client that will parse messages and send to the
    //z/Os output Server
    import java.io.*;
    import java.net.*;
    public class MainTest
           public static void main(String args[]) throws Exception
                //get console input
                BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));  
                System.out.println("Enter port to run server on: ");
                String input = stdin.readLine();
                int servPort = Integer.parseInt(input);
                //setting up sockets
                ServerSocket ssock = null;
                Socket sock = null;
                try
                //setting up server to run on servPort
               ssock = new ServerSocket(servPort);
                System.out.println("Listening on : " + ssock);
                System.out.println("Waiting for client connection...");
                  while (true) {
                    //waiting for client to connect to server socket
                    sock = ssock.accept();
                    System.out.println(sock + " connected.");
                    //get host information
                    InetAddress clientIa = sock.getInetAddress( );
                    String clientName = clientIa.getHostName();
                    String clientIp = clientIa.getHostAddress();
                    int localPort = sock.getLocalPort();
                    System.out.println("hostname: "+clientName  +
                              '\n' + "Ip address: " + clientIp
                              +":"+ localPort + "\n\n");
                    new Thread(new MultiThreadServer(sock)).start();
                catch (SocketException e )
                     System.out.println ("Socket error: " + e);
                catch(UnknownHostException e)
                     System.out.println("Unknown host: " + e);
                   catch (IOException e)
                    System.out.println("IOException: " + e);
    }

  • HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7

    All -
    I'm new to consuming web services in JDeveloper. I'm using Oracle JDEV 10.1.3.3/OC4J.  I'm using this version since it is compatible with Oracle EBS 12.1.3.  My intent is to pull data from our third party recruitment app (Success Factors) and load that data into Oracle HRIS.  I'm already doing this through a .NET application.  I'm converting it to be a Java Concurrent Program in EBS.  The code listed below is a stub call to verify I'm on the right track. I created a JDeveloper Web Services proxy project.  I'm testing it locally on my windows desktop.  When I'm able to consume the service successfully, then I'll think about moving it to the EBS server.
    I'm getting the following error when I invoke the following service:
    HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    End point is: https://api4.successfactors.com/sfapi/v1/soap?wsdl
    Any help/assistance would be much appreciated. 
    Below is my code and output of my test:
    package emsc.oracle.apps.emscper.sfapi.proxy;
    import HTTPClient.HTTPConnection;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSession;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSessionResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Login;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResult;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Logout;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LogoutResponse;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFCredential;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFParameter;
    import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Error;
    import java.io.File;
    import javax.xml.rpc.ServiceFactory;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Date;
    import javax.xml.ws.BindingProvider;
    import javax.xml.soap.SOAPException;
    import java.util.Map;
    import oracle.security.ssl.OracleSSLCredential;
    public class SFAPITest {
        // Declare members:      
        private String companyId;
        private String userName;
        private String password;
        private String developerKey;
        private Date   effDt;
        private String greaterThanEffDt;
        private String lessThanEffDt;
        // Declare constants:      
        final static private String breakLine = "+---------------------------------------------------------------------------+";
        final static private String format    = "yyyy-mm-dd";      
        private enum ReqId {
            PrimaryReq(25),
            PrimaryReqCEO(26),
            EmCarePrimary(27),
            RTI(28),
            EmCareClinical(29);
            private int reqId; 
            private ReqId() {
            private ReqId(int value) {
                reqId = value;
            public int getReqId() {
                return reqId;
        // Getters and Setters:  
        protected String getCompanyId() {
           return this.companyId;
        protected void setCompanyId(String value) {
           this.companyId = value;                 
        protected String getUserName() {
           return this.userName;
        protected void setUserName(String value) {
           this.userName = value;                 
        protected String getPassword() {
           return this.password;
        protected void setPassword(String value) {
           this.password = value;                 
        protected String getDeveloperKey() {
           return this.developerKey;
        protected void setDeveloperKey(String value) {
           this.developerKey = value;                 
        protected Date getEffDt() {
            return this.effDt;
        protected void setEffDt(Date value) {
            this.effDt = value;                 
        protected String getGreaterThanEffDt() {
           return this.greaterThanEffDt;
        protected void setGreaterThanEffDt(String value) {
           this.greaterThanEffDt = value;                 
        protected String getLessThanEffDt() {
           return this.lessThanEffDt;
        protected void setLessThanEffDt(String value) {
           this.lessThanEffDt = value;                 
        public void runProgram()
            SFAPIService mySFAPIService;
            String CompletionText = "";
            String effDtStr2 = null;
        /* Code your program logic here.
        * Use getJDBCConnection method to get the connection object for any
        * JDBC operations.
        * Use CpContext provided commit,rollback methods to commit/rollback
        * data base transactions.
        * Don't forget to release the connection before returning from this
        * method.
        /* Call setCompletion method to set the request completion status and
        * completion text.
        * Status values are ReqCompletion.NORMAL,ReqCompletion.WARNING,
        * ReqCompletion.ERROR.
        * Use Completion text message of length 240 characters. If it is more
        * than 240 then full string will appear in log file and truncated 240
        * characters will be used as request completion text.
        try
            ServiceFactory factory = ServiceFactory.newInstance();
            mySFAPIService = (emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService)factory.loadService(emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService.class);      
            SFAPI api = mySFAPIService.getSFAPI();
           /// SFAPI api = new SFAPI();
            //Map<String, Object> requestContext = ((BindingProvider) api).getRequestContext();
            //requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
            System.out.println("ServiceName => " + mySFAPIService.getServiceName().toString());
            System.out.println("End Point   => " + mySFAPIService.getServiceName().toString());
            System.out.println(breakLine);
            // Authentication: Login to SFAPI:
            SFCredential credential = new SFCredential();
            // Fake credentials being passed in for this post:   
            credential.setCompanyId("XXX");
            credential.setUsername("XXX");
            credential.setPassword("XXX");
            credential.setDeveloperKey("XXX");
            HTTPConnection httpsConnection = null;       
            OracleSSLCredential _credential = new OracleSSLCredential();      
            _credential.setWallet("\\\\\\C:\\Program Files\\Java\\jdk1.6.0_33\\jre\\lib\\security", "ParkEstes3");
            /*System.setProperty("javax.net.ssl.trustStore","C:\\\\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\keystore");
            System.setProperty("javax.net.ssl.trustStorePassword","changeit");  
            System.out.println(System.getProperty("javax.net.ssl.trustStore"));*/
            // SFParameter: Define a generic SFParameter List.  This is a necessary parameter
            // to invoking calls in SFAPI:      
             /*System.setProperty("javax.net.ssl.keyStore",
             "file:\\\C:\\jdk1.4.1\\jre\\lib\\security\\client.keystore");
             System.setProperty("javax.net.ssl.keyStorePassword","welcome");         */
            /*  System.setProperty("oracle.net.wallet_location",
                          "(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=\\\C:\Users\dparrish\Oracle\WALLETS)))");  // (2)                     */
            File kstore = new File("C:\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\jssecacerts");
            boolean exists = kstore.exists();
            if (!exists) {
                System.out.println("Keystore does not exist");
            else {
                System.out.println("Keystore does exist");
            System.setProperty("javax.net.ssl.trustStore", kstore.getAbsolutePath());
            System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
            //System.setProperty("proxySet", "false");
            //System.setProperty("http.proxyHost", "127.0.0.1");
            //System.setProperty("http.proxyPort", "8080");
            System.out.println(kstore.getAbsolutePath());
            List<SFParameter> lst = new ArrayList<SFParameter>();
            SFParameter param = new SFParameter();
            param.setName("");
            param.setValue("");
            lst.add(param);      
            SFParameter[] sfParam = lst.toArray(new SFParameter[lst.size()]);
            Login login = new Login();
            try {
                login.setCredential(credential);
                System.out.println("1");
                login.setParam(sfParam);
                System.out.println("2");
                LoginResponse loginResponse = new  LoginResponse();
                LoginResult loginResult = new LoginResult();
                try {
                     loginResponse = api.login(login);               
                catch (Exception e ) {
                    System.out.println(e.getMessage());
                System.out.println("3");
                try {               
                     loginResult = loginResponse.getResult();
                catch (Exception e ) {
                    System.out.println(e.getMessage());
                System.out.println("4");
                IsValidSession vs = new IsValidSession();                  
                IsValidSessionResponse isValidSessionResponse = api.isValidSession(vs);
                System.out.println("5");
                if (isValidSessionResponse.isResult()) {
                     System.out.println("Session is valid");
                     System.out.println("Result => " + loginResult.getSessionId());
                     System.out.println(breakLine);              
                    Logout logout = new Logout();
                    LogoutResponse logoutResponse = api.logout(logout);
                    if (logoutResponse.isResult()) {
                         System.out.println("Logout of SFAPI Successful");
                    else {
                        System.out.println("Logout of SFAPI Unsuccessful");
                else {
                     System.out.println("Session is invalid");
                    List<Error> errors = new ArrayList<Error>();
                    for (int i = 0; i < loginResult.getError().length;  i++) {
                        errors.add(loginResult.getError()[i]);
                    for (int i = 0; i < errors.size(); i++) {
                         System.out.println("Error Indice   => " + i);
                         System.out.println("Error Code:    => " + errors.get(i).getErrorCode());
                         System.out.println("Error Message: => " + errors.get(i).getErrorMessage());
                         System.out.println(breakLine);                                                          
                    } // end for loop of SFObject errors
                } // end InvalidSession
            catch (Exception e)
                 System.out.println("Session Credential Exception");
                 System.out.println("Exception => " + e.getMessage());
                 System.out.println(breakLine);                   
        catch (Exception e)
            System.out.println("Parameter List Exception");
            System.out.println("Exception => " + e.getMessage());
            System.out.println(breakLine);
        }   // end runProgram
        // Constructor:
        public SFAPITest()  {
        } // end constructor
        public static void main (String args[]) {
            try
                SFAPITest test = new SFAPITest();        
                test.runProgram();
            catch (Exception e) {
                System.out.println("main exception => " + e.getMessage());
    } // SFAPITest
    Here is the output with trace:
    WARNING: Unable to connect to URL: https://api4.successfactors.com:443/sfapi/v1/soap due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    Session Credential Exception
    Exception => ; nested exception is:
        HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
    +---------------------------------------------------------------------------+
    Process exited with exit code 0.

    The other end is throwing back a programming error.
    That might be because you are sending incorrect data and the other end fails to validate it.
    You might be able to guess based on your C# code.  But, since you are using soap one generic solution is available to you.
    - Get an http proxy interceptor like wireshark.
    - Run it while your C# app runs, collect the http requests from that.
    - Run it while running your java code, collect the http requests from that.
    Compare the two.

  • How can I send my entire mix to Outputs 1-2 AND Outputs 3-4.

    I want to use 3-4 for my headphones, but have the same mix on it then 1-2.
    I do not want to create an Aux-bus-send for every single channel strip. I guess there must be an easy solution for this...

    Hi there,
    I think the best thing to do (and I do so with configuration in-ears) is to create a new audio channel strip called eg "master keyboard" and send all channel strips for that bus. The entry would be one of Buses (ex. 1) and the output Output 1-2.
    Now create a new audio channel strip called eg "headphones" to enter one of the buses (eg 2) and output Output 3-4.
    Now a send from the master keyboard to send the Bus 2 (headphones).
    It seems hard but it is really quite easy. Read several times and follow step by step.
    I think this is a good way because it has control of everything (volumes, placing inserts, etc.) on each output of your card (master keyboard and headphones and other).
    in my case I also have a mic input is one whose output is output 4 (ex) and could be a send to bus 2 (headphones) would be listening, independent levels with a mixture of keyboard and mic.
    try it and post your results.
    Good Luck

  • F5 Big IP 4000 Send /Return String for Exchange 2013

    Hi,
    I need to Implement F5 Big IP 4000 and need to set send / return string for Exchange 2013 server for OWA monitoring... Can anyone help me with Exact output String.
    Amit

    Hi,
    In the Send String box enter in GET /owa/healthcheck.htm.  In the
    Receive String box, enter in 200 OK.
    Here is a related article for your reference.
    http://port25guy.com/2013/07/24/how-to-use-managed-availability-in-exchange-2013-with-your-load-balancer/
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Hope this is helpful to you.
    Best regards,
    Belinda Ma
    TechNet Community Support

  • Send Vendor Balance confirmations report output (F.18) to External email ID

    Dear Friends.
    I have following requirement
    Our Client requirement is to send Vendor Balance confirmations report output (Tcode F.18) to external email ID of vendor.
    So please guide accordingly.
    I have done BASIS Settings for SMTP (Tcode SCOT, RZ10) and Through SAP office using BASIS consultant and i can able to send sample test mail to external email ID through SAP Office (tcode SO00)
    I will be thankful if anyone gives me exact solution.
    Thanks & Regards
    Suyog

    Hi,
    You can craete Background Job and send Mail.
    e.g.
    Goto->SM36->JOBWIZARD ( Create the Job and specify the Spool List Recipients ).
    After Creating the job.
    Again SM36->Start Condition ( You can create here when to send the mail ).
    And Release it.
    Be sure that your BASIS guy has done the required settings for Outgoing Mail.
    Please check in SCOT.
    Affable
    Arbind
    Edited by: Arbind Prasad on Jan 23, 2010 3:07 PM

  • Sending a string over ethernet at 1 Hz.

    I am trying to send a string file at 10 Hz over ethnet to another PC. It is a motion file.  I am enclosing a snippet of the file below.
    START_TIME,24-OCT-2004 16:44:54,0 00:02:21
    00:00:00,INIT_POS,v1_m1,33.7487,-118.035,16.97
    AR
    RU
    00:00:00,mot,v1_m1,-2495192.9594000001,-4685876.5558000002,3523316.4575999998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    00:00:00.100,mot,v1_m1,-2495192.9594000001,-4685876.5558000002,3523316.4575999998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    00:00:00.200,mot,v1_m1,-2495192.9594000001,-4685876.5558000002,3523316.4575999998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    00:00:00.300,mot,v1_m1,-2495192.9594000001,-4685876.5558000002,3523316.4575999998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    00:00:00.400,EN,0,0

    Do you have a question related to this?

  • How to send a String to a Servlet using a HTTP POST

    Well, I have designed a servlet that receives a HTTP POST, I was testing it using an HTML form to send (using POST) information, now, I have coded a Java App to send it a string, I don't know how to make the servlet recognize that info so it can make its work, I am posting both codes (Servlet & API) so anyone can guide me and tell me how and where to modify them
    Servlet:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.getParameter("cadena");
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now, the JAVA API is:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    URL url1 = new URL
    ("http://localhost:8080/XMLSender/xmlwriter");//internal site
    URLConnection UrlConnObj1 = url1.openConnection();
    HttpURLConnection huc1 = (HttpURLConnection)UrlConnObj1;
    huc1.setRequestMethod("POST");
    huc1.setDoOutput(true);
    huc1.setDoInput(true);
    huc1.setUseCaches(false);
    huc1.setDefaultUseCaches(false);
    String cadena = ""
    + "<root>\n"
    + "<tlf>$TLF$</tlf>\n"
    + "<op>$OP$</op>\n"
    + "<sc>$SC$</sc>\n"
    + "<body>$BODY$</body>\n"
    + "</root>";
         PrintWriter out = new PrintWriter(huc1.getOutputStream());
    System.out.println("string="+cadena);
    out.write(cadena);
    out.close();
    I'm a JAVA newbie, so, maybe I'm getting a bad idea of what I need to do, anyway, every (detailed) help is welcome. What my servlet should do (and it doesn't when I send the message through the API) is to write a file with the info received.

    I'm not trying to send a string from a WEB Page, I'm tryring to send it using a JAVA program, I mean, using a HTTPSender, in fact, I already have made the code to do that:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    try {
    String cadena = "Message to be written";
    // Send data
    URL url = new URL("http://localhost:8080/XMLSender/xmlwriter");
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(cadena);
    wr.flush();
    // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    // Process line...
    wr.close();
    rd.close();
    } catch (Exception e) {
    And modified my servlet so it can receive anything:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.toString();
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now the problem is that, the servlet in fact DOES create the file, but....the file is empty, that means that no info is arriving to the servlet, why?, how should I send it then? I repeat FORGET about a Web Page Form, that is in the past and I don't need that.

  • How to send invoice through email with output type RD00?

    What are the configuration settings to send invoices through email with output type RD00?

    Hi,
    Please go through the following links:
    [E-mail|Email Configuration Settings]
    [e-mail|Re: EMAIL BILLING DOCUMENT TO CUSTOMER THROUGH SEND MAIL OPTION IN VF02]
    After triggering the output,goto T.Code SOST and process it.
    So that e-mail will be triggered immediately.
    You can use External send/EDI/simple mail for this.
    Regards,
    Krishna.

  • How to send a string from sender to receiver side using java

    I am doing a project on Digital Signature.I have already done with the GUI using java swing.
    Now i want to send a string from the sender side to the receiver side on the click of a button using socket programming.
    Please can anybody provide me with the code as early as possible.

    http://catb.org/~esr/faqs/smart-questions.html

  • How to send a string thru UDP

    How can I send a string like this thru UDP:
    0x01 0x40 0x43 0x51
    Can I write it like this:
    data= 0x01, 0x40, 0x43, 0x51;
    Any help, please?

         InputStream in = null;
         HttpURLConnection urlConn =  null;
         int returnCode = 0;   
         try {
               URL url = new URL(URLEncoder.encode(urlStr));
               //Where urlStr is in the form "http://localhost/servlet/myServlet?param1=STRING TO BE PASSED"
              //Create the connection to the servlet url
               urlConn = (HttpURLConnection)url.openConnection();
               urlConn.setDoInput(true);
               urlConn.setDoOutput(true);
               urlConn.setUseCaches(false);
               urlConn.setRequestMethod("GET");
               urlConn.setRequestProperty("Accept-Language", "en");
               urlConn.setRequestProperty("content-type", "text/xml");
               in = urlConn.getInputStream();
               //Put code to read return string here
              } catch (Exception e) { System.out.println("Error : " + e); }
              urlConn.disconnect();

  • Send multiple strings over TCP - Like messenger service

    Hello all Java Coders,
    I'm new with TCP programming.
    I'm beggining to learn about TCP and sockets connections in Java. In order to achieve this, I was coding a mini-program so I can learn a little bit about this.
    I'm trying to make a simple TCP program.
    The server sends a string to a client...
    I already searched for a couple of hours in google and so on, about what I'm doing wrong.
    [The server code (Just click)|http://pastebin.com/m39fd1273]
    [The client code (Just click)|http://pastebin.com/m57471803]
    I hope that someone can help me with this and, if you have patience, please tell me the reasons my code doesn't work.
    Many thanks,
    Freiheitpt
    P.S.: I think that the problem is on the server side...

    Sorry jverd.
    I was just trying to put things organized.
    Well, I can't get the String to be sent to the client.
    No error occurs.
    Server:
           try {
                srvr = new ServerSocket(1234);
                System.out.println("Connecting...");
                skt = srvr.accept();
                System.out.println("Connected!\nPreparing data exchange...");
                stream = skt.getOutputStream();
                out = new PrintWriter(stream, true);
                System.out.println("Done!\nReady to Send!");
            } catch (IOException ex) {
                System.out.println("Ups, didn't work!");
                System.exit(1);
            while(!data.equalsIgnoreCase("end")) {
                System.out.print("String to send: ");
                data = input.nextLine();
                System.out.print("Sending string: '" + data + "'\n");
                out.print(data);
            }Client:
            try {
                skt = new Socket("localhost", 1234);
                System.out.println("Connecting...");
                if (skt.isConnected()) {
                    System.out.println("Connected!\nPreparing data exchange...");
                    stream = skt.getInputStream();
                    inputStream = new InputStreamReader(stream);
                    in = new BufferedReader(inputStream);
                    System.out.println("Done!\nReady to Receive!");
                } else {
                    System.out.println("Server not available!\nExiting...");
                    skt.close();
                    System.exit(1);
            } catch (IOException ex) {
                System.out.println("Ups, didn't work!");
                System.exit(1);
            while (!data.equalsIgnoreCase("end")) {
                while(!in.ready()) {}
                data = in.readLine();
                System.out.println("Received String: '" + data + "'");
            }

  • Send large string between servlets in different domain

    Hi,
    I need to send a large string from servlet in an web application to a
    servlet in another web application. Those two application are in
    different domains. I can't send the string as request parameter,
    bacause string is too large. I can't send as request attribute either,
    because attribute will lost during redirect to another domain.
    Any solutions? Thanks for any help.

    do set/getAttribute at the ServletContext level which is unique for a particular webapplication. from 1st application u can access the 2nd one using , getServletConfig().getServletContext().getContext("/uripath") which gives you the ServletContext handle of the other application and you can do getAttribute of this.
    Rgds
    Padmanava

  • Send a string to a server

    Hi,
    I am going to write a java application that sends a string so a server. I don�t know what is on the server side(someone else has written the server part) just that my program is going to use sockets and what port number and IP the server has. I first start using datagrampackets but then I have to use byte array that would not work if the server just want a string ?? What should I use?
    /Thanks in advance

    Hi,
    your question is not clear... you can convert the byte array to a string by calling toString method on the byte array.. since the server port and IP is known, try amking a socket and send a string and see what happens by opening a socket inputstream.. read from the stream to understand what the server does..
    - Bibin.

Maybe you are looking for

  • **How to call a report from a form by passing a specfic value?????

    Hi Expert, I want to call a report from a form.My problem scenario like, a user is login to his account and there is a option called ADMIT CARD(Push Button).Now when he pressed the button a report will generate.I want that when he pressed the button

  • BSAS - BSEG for cleared document

    Hi financial abapers, in table BSAD we have clearing documents for the goods/invoice received account. In field AUGBL is the doument no. cleared. But I do not see the fully specified key BUKRS BELNR GJAHR BUZEI for the cleared item. How to referce it

  • Steps to export various objects created in v10.1.3.5.6 ODI + steps to import back in v11.1.1.7 ODI

    All, As we all do these days and for reasons mostly associated with budget constraints, I have been asked to wear a brand new hat - the "ODI Guru Hat" - at my client's site to facilitate the migration of their v11.1.1.x Hyperion EPM implementation to

  • Closing a service PO

    Hello Experts, I would need your help to understand how do we close a service PO in srm. I understand we can mark as delivery completed on the SES, and then check the final indicators on the PO. For our client, the service PO doesn't have final deliv

  • Samsung SCX-4500 scanning using Image Capture???

    Image Capture detects and scans successfully using the Samsung SCX-4500, BUT doesn't appear to save the file anywhere. I selected desktop, and still no file. Any ideas?