Creating a Java GUI for a C/C++ program

I'm tasked with creating a GUI for a multi-threaded C++ network server program that has it's main function running with a while loop that checks for keystrokes from the user. The C++ code for the loop is basically:
while(i!='q')
if(kbhit())
i=getch();
processkey(i);
}And the processkey function performs different actions based on the key that was pressed.
I was reading up on ways to interface between Java and C/C++ and heard of JNI, but I also found someone who suggested using the Java Robot class to send the keystrokes from my GUI to the C++ program.
I've been trying to make a small test case application using the Robot class before trying to implement it in my larger project.
I created a program with a JFrame with two buttons, one starts a simple C++ program that loops, waiting for keypresses and which will close when 'q' is pressed, like my main program.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        try {
            Runtime.getRuntime().exec("C:/Users/Administrator1/Desktop/Untitled2.exe");
            // TODO add your handling code here:
        } catch (IOException ex) {
            Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
        // TODO add your handling code here:
    }The other button creates a Robot instance and tells that robot to send a key press of 'q', which should terminate the C++ program.
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
        try {
            Robot robot = new Robot();
            // Creates the delay of 5 sec so that you can open notepad before
            // Robot start writting
            //robot.delay(5000);
            robot.keyPress(KeyEvent.VK_Q);
        } catch (AWTException e) {
            e.printStackTrace();
    }It isn't working though. Could it be because when the program is started from my Java app, it runs in the background rather than opening in a new command prompt window? Or is Robot not the way to go, and if so, are there any examples and/or tutorials online that could help me?

When you clicked the button, what application do you think has the focus at that point? So what do you think consumes the keystroke that you emulated? Hint: It wouldn't be the application you intended it to go to.

Similar Messages

  • Java GUI for a shell script

    I have a file with passwd format.I made a script for this file that is working as I wanted it to work.I have a list of options and each time I give an option,the script is doing something(for example,if I press "b" it makes something and if I press "a" it makes something else).All the results are an output from the file.
    My question is how can I create a GUI in java for this script.For example if I want the script to do what it would do if I pressed the "a" button on my keyboard,but not by pressing "a",but by choosing from a drop down list or some other graphical feature(by ticking a check box,clicking a button etc).Can I do this with java?
    Lazaros

    Hi,
    I understand you can create a Java Swing gui for a bash shell script which takes both complex input and writes output to the stdout & files, to be specific. Is that correct?
    If yes, could you give a simple example. Say for the following shell script.
    #!/bin/sh
    printf "Enter input\n"
    i=0
    while [ $i -ne 1 ]; do
    read $inputVar
    if [  "$inputVar" == "y" ]; then
    printf "You typed yes\n"
    i=1
    elif [  "$inputVar" == "y"  ]; then
    printf "you typed no\n"
    i=1
    else
    printf "Enter a valid character\n"
    i=0
    fi
    done
    Could you also point to some URL's which might help? Googling for "Java Gui for shell script" returns this as the first page, others dont really help. Googling "GUI for shell script" returns all other gui toolkits for xes but thats not what I want. I want a cross platform (nixes, Win*, MacOS* ) gui for a shell script ( which I plan to run using cygwin etc).
    TIA
    Vinod

  • Can I create a java app for my palm zire 71 that uses floating point calc

    I am an eclipse user that is looking at studio creator 2 and was wondering if I could create a java app for my palm zire 71. I have read alot about no floating point support in midp... is that true for java on the palm? If so, how does one calculate with floats and doubles to do sqrt functions etc?
    Thanks in advance for your time
    Dean-O

    I looked at netbeans and it does not support floating points in midlets. Not good for palm app if no floating point ability. J2ME supports floating point but in netbeans... is uses midlets and there are no floating points. Now what does one do? Not that dreaded C++
    THanks in advance
    Dean-O

  • Problem in creating a java proxy for PHP web service

    This is a problem in generating a java proxy for a PHP webservice.
    I have a PHP service running on Wamp Server and also a PHP client which is able to call the service.
    The WSDL for the PHP web service is also generated .
    I am trying to create a java proxy using the jdev (10.1.3.0.3) from the wsdl file.
    The wsdl generated by the php program is
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:hellowsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:hellowsdl">
    <types>
    <xsd:schema targetNamespace="urn:hellowsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="urn:hellowsdl#hello" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>After making following changes to the wsdl program, I tried to generate java proxy.
    <definitions name="hellowsdl"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/mywork/hellowsdl.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/mywork/myphpwsdl.wsdll">
    <types>
    <xsd:schema targetNamespace="http://localhost/mywork/hellowsdl.wsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>This is how the java stub file looks like:
    public class HellowsdlBinding_Stub
        extends oracle.j2ee.ws.client.StubBase
        implements demo.mypackage.HellowsdlPortType {
         *  public constructor
        public HellowsdlBinding_Stub(HandlerChain handlerChain) {
            super(handlerChain);
            _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://localhost/mywork/hellowsdl.php");
            setSoapVersion(SOAPVersion.SOAP_11);
            setServiceName( new QName("http://localhost/mywork/hellowsdl","hellowsdl"));
            setPortName( new QName("http://localhost/mywork/hellowsdl","hellowsdlPort"));
         *  implementation of hello
        public java.lang.String hello(java.lang.String name)
            throws java.rmi.RemoteException {
            StreamingSenderState _state = null;
            try {
                _state = _start(_handlerChain);
                if (_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS) != null) {
                    _state.getMessageContext().getMessage().setProperty("DimeEncode",_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
                InternalSOAPMessage _request = _state.getRequest();
                _request.setOperationCode(hello_OPCODE);
                _state.getMessageContext().setProperty("oracle.j2ee.ws.mgmt.interceptor.operation-qname",new QName("","hello"));
                demo.mypackage.runtime.HellowsdlBinding_hello_ReqS _myHellowsdlBinding_hello_ReqS = new demo.mypackage.runtime.HellowsdlBinding_hello_ReqS();
            _myHellowsdlBinding_hello_ReqS.setName(name);
            SOAPBlockInfo _bodyBlock = new SOAPBlockInfo(ns1_hello_hello_QNAME);
            _bodyBlock.setValue(_myHellowsdlBinding_hello_ReqS);
            _bodyBlock.setSerializer(myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer);
            _request.setBody(_bodyBlock);
            _state.getMessageContext().setProperty("http.soap.action", "http://localhost/mywork/hellowsdl");
            _send((String) _getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
            demo.mypackage.runtime.HellowsdlBinding_hello_RespS _myHellowsdlBinding_hello_RespS = null;
            Object _responseObj = _state.getResponse().getBody().getValue();
            if (_responseObj instanceof SOAPDeserializationState) {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)((SOAPDeserializationState)_responseObj).getInstance();
            } else {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)_responseObj;
            return _myHellowsdlBinding_hello_RespS.get_return();
        } catch (RemoteException e) {
            // let this one through unchanged
            throw e;
        } catch (JAXRPCException e) {
            throw new RemoteException(e.getMessage(), e);
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            } else {
                throw new RemoteException(e.getMessage(), e);
    *  this method deserializes the request/response structure in the body
    protected void _readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case hello_OPCODE:
                _deserialize_hello(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SenderException("sender.response.unrecognizedOperation", Integer.toString(opcode));
    * This method deserializes the body of the hello operation.
    private void _deserialize_hello(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
        try {
            Object myHellowsdlBinding_hello_RespSObj =
                myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer.deserialize(ns1_hello_helloResponse_QNAME,
                    bodyReader, deserializationContext);
            SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_hello_helloResponse_QNAME);
            bodyBlock.setValue(myHellowsdlBinding_hello_RespSObj);
            state.getResponse().setBody(bodyBlock);
        } catch (DeserializationException e) {
            if (e.getSoapFaultSubCodeType() == JAXRPCExceptionBase.FAULT_CODE_NONE && e.getSoapFaultCodeType() != JAXRPCExceptionBase.FAULT_CODE_DATA_ENCODING_UNKNOWN) {
                e.setSoapFaultSubCodeType(JAXRPCExceptionBase.FAULT_CODE_BAD_ARGUMENTS);
            throw e;
    public String _getEncodingStyle() {
        return SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding();
    public void _setEncodingStyle(String encodingStyle) {
        throw new UnsupportedOperationException("cannot set encoding style");
    public ClientTransport getClientTransport() {
        return super._getTransport();
    * This method returns an array containing (prefix, nsURI) pairs.
    protected String[] _getNamespaceDeclarations() {
        return myNamespace_declarations;
    * This method returns an array containing the names of the headers we understand.
    public QName[] _getUnderstoodHeaders() {
        return understoodHeaderNames;
    * This method handles the case of an empty SOAP body.
    protected void _handleEmptyBody(XMLReader reader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
    public void _initialize(InternalTypeMappingRegistry registry) throws Exception {
        super._initialize(registry);
        myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_ReqS.class, ns1_hello_TYPE_QNAME);
        myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_RespS.class, ns1_helloResponse_TYPE_QNAME);
    private static final QName _portName = new QName("http://localhost/mywork/hellowsdl", "hellowsdlPort");
    private static final int hello_OPCODE = 0;
    private static final QName ns1_hello_hello_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private static final QName ns1_hello_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private CombinedSerializer myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer;
    private static final QName ns1_hello_helloResponse_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private static final QName ns1_helloResponse_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private CombinedSerializer myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://localhost/mywork/hellowsdl"
    private static final QName[] understoodHeaderNames = new QName[] {  };
    }The errors that are produced are-
    java.rmi.RemoteException: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found
    Kindly help to resolve this.
    Thanks.

    This is a problem in generating a java proxy for a PHP webservice.
    I have a PHP service running on Wamp Server and also a PHP client which is able to call the service.
    The WSDL for the PHP web service is also generated .
    I am trying to create a java proxy using the jdev (10.1.3.0.3) from the wsdl file.
    The wsdl generated by the php program is
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:hellowsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:hellowsdl">
    <types>
    <xsd:schema targetNamespace="urn:hellowsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="urn:hellowsdl#hello" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>After making following changes to the wsdl program, I tried to generate java proxy.
    <definitions name="hellowsdl"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/mywork/hellowsdl.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/mywork/myphpwsdl.wsdll">
    <types>
    <xsd:schema targetNamespace="http://localhost/mywork/hellowsdl.wsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>This is how the java stub file looks like:
    public class HellowsdlBinding_Stub
        extends oracle.j2ee.ws.client.StubBase
        implements demo.mypackage.HellowsdlPortType {
         *  public constructor
        public HellowsdlBinding_Stub(HandlerChain handlerChain) {
            super(handlerChain);
            _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://localhost/mywork/hellowsdl.php");
            setSoapVersion(SOAPVersion.SOAP_11);
            setServiceName( new QName("http://localhost/mywork/hellowsdl","hellowsdl"));
            setPortName( new QName("http://localhost/mywork/hellowsdl","hellowsdlPort"));
         *  implementation of hello
        public java.lang.String hello(java.lang.String name)
            throws java.rmi.RemoteException {
            StreamingSenderState _state = null;
            try {
                _state = _start(_handlerChain);
                if (_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS) != null) {
                    _state.getMessageContext().getMessage().setProperty("DimeEncode",_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
                InternalSOAPMessage _request = _state.getRequest();
                _request.setOperationCode(hello_OPCODE);
                _state.getMessageContext().setProperty("oracle.j2ee.ws.mgmt.interceptor.operation-qname",new QName("","hello"));
                demo.mypackage.runtime.HellowsdlBinding_hello_ReqS _myHellowsdlBinding_hello_ReqS = new demo.mypackage.runtime.HellowsdlBinding_hello_ReqS();
            _myHellowsdlBinding_hello_ReqS.setName(name);
            SOAPBlockInfo _bodyBlock = new SOAPBlockInfo(ns1_hello_hello_QNAME);
            _bodyBlock.setValue(_myHellowsdlBinding_hello_ReqS);
            _bodyBlock.setSerializer(myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer);
            _request.setBody(_bodyBlock);
            _state.getMessageContext().setProperty("http.soap.action", "http://localhost/mywork/hellowsdl");
            _send((String) _getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
            demo.mypackage.runtime.HellowsdlBinding_hello_RespS _myHellowsdlBinding_hello_RespS = null;
            Object _responseObj = _state.getResponse().getBody().getValue();
            if (_responseObj instanceof SOAPDeserializationState) {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)((SOAPDeserializationState)_responseObj).getInstance();
            } else {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)_responseObj;
            return _myHellowsdlBinding_hello_RespS.get_return();
        } catch (RemoteException e) {
            // let this one through unchanged
            throw e;
        } catch (JAXRPCException e) {
            throw new RemoteException(e.getMessage(), e);
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            } else {
                throw new RemoteException(e.getMessage(), e);
    *  this method deserializes the request/response structure in the body
    protected void _readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case hello_OPCODE:
                _deserialize_hello(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SenderException("sender.response.unrecognizedOperation", Integer.toString(opcode));
    * This method deserializes the body of the hello operation.
    private void _deserialize_hello(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
        try {
            Object myHellowsdlBinding_hello_RespSObj =
                myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer.deserialize(ns1_hello_helloResponse_QNAME,
                    bodyReader, deserializationContext);
            SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_hello_helloResponse_QNAME);
            bodyBlock.setValue(myHellowsdlBinding_hello_RespSObj);
            state.getResponse().setBody(bodyBlock);
        } catch (DeserializationException e) {
            if (e.getSoapFaultSubCodeType() == JAXRPCExceptionBase.FAULT_CODE_NONE && e.getSoapFaultCodeType() != JAXRPCExceptionBase.FAULT_CODE_DATA_ENCODING_UNKNOWN) {
                e.setSoapFaultSubCodeType(JAXRPCExceptionBase.FAULT_CODE_BAD_ARGUMENTS);
            throw e;
    public String _getEncodingStyle() {
        return SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding();
    public void _setEncodingStyle(String encodingStyle) {
        throw new UnsupportedOperationException("cannot set encoding style");
    public ClientTransport getClientTransport() {
        return super._getTransport();
    * This method returns an array containing (prefix, nsURI) pairs.
    protected String[] _getNamespaceDeclarations() {
        return myNamespace_declarations;
    * This method returns an array containing the names of the headers we understand.
    public QName[] _getUnderstoodHeaders() {
        return understoodHeaderNames;
    * This method handles the case of an empty SOAP body.
    protected void _handleEmptyBody(XMLReader reader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
    public void _initialize(InternalTypeMappingRegistry registry) throws Exception {
        super._initialize(registry);
        myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_ReqS.class, ns1_hello_TYPE_QNAME);
        myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_RespS.class, ns1_helloResponse_TYPE_QNAME);
    private static final QName _portName = new QName("http://localhost/mywork/hellowsdl", "hellowsdlPort");
    private static final int hello_OPCODE = 0;
    private static final QName ns1_hello_hello_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private static final QName ns1_hello_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private CombinedSerializer myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer;
    private static final QName ns1_hello_helloResponse_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private static final QName ns1_helloResponse_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private CombinedSerializer myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://localhost/mywork/hellowsdl"
    private static final QName[] understoodHeaderNames = new QName[] {  };
    }The errors that are produced are-
    java.rmi.RemoteException: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found
    Kindly help to resolve this.
    Thanks.

  • Java GUI for Unix not showing . files

    we have discovered a strange behaviour with sapgui 7.10 rev 8 on unix (AIX and Solaris). You can't see and browse to folders starting with a . (e.g. .abc) and also files with a . are not listed in the file open dialog (for attaching files via cv02n). Does anybody experience the same behaviour and probabely has found a setting to change it?
    Thanks for any help
    Axel

    Hi Axel,
    it sounds a bit odd that this CAD integration software is writing files to hidden folders but the user later is forced to navigate inside there.
    SAP GUI for Java inherits the file chooser dialog from the Swing framework part of Java. Sun seems to have decided, that by default, hidden files and folders should not be shown.
    I am hesitating to generally switch on showing hidden files and folders because it will irritate most end users.
    We are looking into a way to add the option to switch on showing hidden files and folders by the user.
    Btw, the user can navigate into a hidden folder by entering its name and hitting return, from there the user can navigate as usual. So it is not required to enter a complete path.
    Best regards
    Rolf-Martin

  • Cannot read list of frontend printers - Printing in SAP JAVA GUI for MAC

    Hello,
    I am trying to print a Spool request in SAP Java GUI 7.10. I am working on Apple with OSX operating system. I get this error message -
    " Cannot read list of frontend printers " - Message no. PO781
    What do i need to do to take a print out from SAP on my Mac.
    Thanks
    Buddy

    Hello,
    which printing access method you are using?
    You might want to have a look at [note 821519|https://service.sap.com/sap/support/notes/821519].
    Best regards
    Rolf-Martin

  • Creating a Java game for Windows

    Does anyone know a website or tutorial that provides information to Java developers, regarding the production of games? I would like to create my own chess game in Java for use on a Windows platform.
    Thanks

    Put a combination of the following key words in your favorite search engine, you should find something :
    Java 2D
    double buffering
    animation
    runnable
    The main idea in most simple games is to check the state of your game and then to draw that state. You do this once every 25th of a second (the runnable interface lets you do so). This is done over and over again until the end of the game.
    If you simply rewrite the paint(Graphics) method of your drawing without implementing double buffering, then you'll get a "flickering" game. How tos on double buffering with Java are all over the net.

  • How to create a java plugin for Internet explorer

    Hi All,
    I have recently started working on java,i need to a create a plugin which can launch any file type(say any file which draws a cube with some extension .abc).Where should i start my work from.What do i need to do first.Please help me out coz it is very important for my project work.
    Any suggestions would be much appreciated.
    Regards,
    Deepti.

    Hi Viravan,
    I signed my applet as u said but for some reason the browser is not recognising the cert.The applet is reading a wrl file from my local C drive.I'm creating a plugin to show this applet in the browser window.this is all i have to do.i guess u will have an idea by looking at this program of mine.
    Curves.wrl is the file which i'm reading from the Cdrive.
    i even changed my policy file but in vain.
    JAVA CODE
    import java.awt.BorderLayout;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import javax.vecmath.Point3d;
    import com.sun.j3d.loaders.Scene;
    import java.awt.GraphicsConfiguration;
    import java.io.*;
    import com.sun.j3d.loaders.vrml97.VrmlLoader;
    import com.sun.j3d.loaders.Scene;
    import com.sun.j3d.utils.behaviors.mouse.*;
    import com.sun.j3d.utils.geometry.ColorCube;
    import java.lang.*;
    import java.applet.*;
    import java.net.URL;
         public class Vrml2 extends Applet {
         private SimpleUniverse u=null;
         public BranchGroup createSceneGraph() {
         BranchGroup objRoot = new BranchGroup();
         //TransformGroup objScale = new TransformGroup();
         //Transform3D t3d = new Transform3D();
         //t3d.setScale(0.3);
         //objScale.setTransform(t3d);
         //objRoot.addChild(objScale);
         BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),      100.0);
         Color3f bgColor = new Color3f(1.0f,1.0f,1.0f);
         Background bg = new Background(bgColor);
         bg.setApplicationBounds(bounds);
         objRoot.addChild(bg);
         Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
         Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
         DirectionalLight light1 = new DirectionalLight(light1Color,      light1Direction);
         light1.setInfluencingBounds(bounds);
         objRoot.addChild(light1);
         TransformGroup objTrans = new TransformGroup();
         objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
         objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
         objTrans.setCapability(ColoringAttributes.ALLOW_COLOR_READ);     objTrans.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);     objTrans.setCapability(Material.ALLOW_COMPONENT_READ);     
         objTrans.setCapability(Material.ALLOW_COMPONENT_WRITE);
         objTrans.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
         //objScale.addChild(objTrans);
         objRoot.addChild(objTrans);
         VrmlLoader loader = new VrmlLoader();
         Scene s = null;
         try {
              s = loader.load("c:/documents and      settings/dk27/morph/curves.wrl");
         catch (SecurityException e) {
              System.out.println(" caught security exception by deepti");
              System.out.println(e);
         catch (Exception e) {
              System.out.println("Exception caught");
              System.err.println(e);
              System.exit(1);
         //objTrans.addChild(new ColorCube(0.2));
         objTrans.addChild(s.getSceneGroup());
         Transform3D yAxis = new Transform3D();
         Transform3D tr3d=new Transform3D();
         tr3d.lookAt(new Point3d(13.00,-2.5,11.83),new Point3d      (20.0,0.0,50.0),new Vector3d(0.0,1.0,0.0));
         tr3d.invert();          
         //to rotate the cone left button
         MouseRotate behavior = new MouseRotate();
         behavior.setTransformGroup(objTrans);
         objTrans.addChild(behavior);
         behavior.setSchedulingBounds(bounds);
         //to zoom the cone middle button
         MouseZoom behavior1=new MouseZoom();
         behavior1.setTransformGroup(objTrans);
         objTrans.addChild(behavior1);
         behavior1.setSchedulingBounds(bounds);
         //to translate the cone right button
         MouseTranslate behavior2=new MouseTranslate();
         behavior2.setTransformGroup(objTrans);
         objTrans.addChild(behavior2);
         behavior2.setSchedulingBounds(bounds);
         objRoot.compile();
         return objRoot;
         public Vrml2() {
         public void init(){
         setLayout(new BorderLayout());
         GraphicsConfiguration config=SimpleUniverse.getPreferredConfiguration     ();
         Canvas3D c = new Canvas3D(config);
         add("Center", c);
         BranchGroup scene = createSceneGraph();
         SimpleUniverse u = new SimpleUniverse(c);
         u.getViewingPlatform().setNominalViewingTransform();
         u.addBranchGraph(scene);
         public void destroy(){
         u.removeAllLocales();
         public static void main(String[] args) {
         new MainFrame(new Vrml2(),600,800);
    APPLET CODE:
    <HTML>
    <HEAD>
    <TITLE>Morphing Applet</TITLE>
    </HEAD>
    <BODY>
    <APPLET CODE = "Vrml2" CODEBASE = "." ARCHIVE = "Vrml2.jar" WIDTH = 202 HEIGHT = 177>
    </APPLET>
    </BODY>
    </HTML>
    the errors that it is displaying are
    java.security.cert.CertificateException: Unable to verify the certificate with root CA
         at sun.plugin.security.TrustDecider.isAllPermissionGranted(Unknown Source)
         at sun.plugin.security.PluginClassLoader.getPermissions(Unknown Source)
         at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:162)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:128)
         at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
         at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:108)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
         at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:373)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:579)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
         at sun.applet.AppletPanel.run(AppletPanel.java:293)
         at java.lang.Thread.run(Thread.java:484)
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
         at java.security.AccessController.checkPermission(AccessController.java:399)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
         at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:139)
         at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:279)
         at java.lang.ThreadGroup.getParent(ThreadGroup.java:140)
         at javax.media.j3d.MasterControl$23.run(MasterControl.java:3077)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.media.j3d.MasterControl.<clinit>(MasterControl.java:3070)
         at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:206)
         at Vrml4.init(Vrml4.java:110)
         at sun.applet.AppletPanel.run(AppletPanel.java:344)
         at java.lang.Thread.run(Thread.java:484)
    Exception:java.io.FileNotFoundException: D:\JDK13~1.1\lib\flavormap.properties (The system cannot find the file specified) while loading default flavormap.properties file URL:file:D:\JDK13~1.1\lib\flavormap.properties

  • Creating signed Java applet for Netscape 4x

    I have created a signed jar with SuperUser privileges under Netscape.
    public void init() {
    try {
    if( Class.forName("netscape.security.PrivilegeManager") != null ) {
    netscape.security.PrivilegeManager.enablePrivilege("SuperUser");
    } catch( ClassNotFoundException cnfe ) {
    cnfe.printStackTrace();
    With this I am getting following error without any dailog prompting to grant permission.
    netscape.security.ForbiddenTargetException: User didn't grant the SuperUser privilege.
    Please help.
    Thanks
    Satish

    Then it's likely Netscape 4.x doesn't recognize the jar as being signed. How did you sign the jar?
    Why didn't you ask this in the more appropriate Signed Applets forum?

  • Re: how to create a temporary index for a table in program

    Hi,
    I execute a report to access table EKBE. The field that is essential is the CPUDT - entry date.
    Now, the EKBE is not index with this field.
    I do not want to create a permanent index which might occupied space. The current read on EKBE is sequential.
    I thought of creating an index in the program and then releases it once the report is out.
    Is there a way to achieve that?

    Hi,
    You can dump the data into one internal table and create index of that internal table like this:
    tables: ekbe.
    data: begin of itab occurs 0,
           cpudt like ekbe-cpudt,
           indx type i,
           end of itab.
    select cpudt up to 10 rows
    from ekbe into table itab.
    loop at itab.
    itab-indx = sy-tabix.
    write:/ itab-cpudt, itab-indx.
    endloop.
    Regards,
    Bhaskar

  • Java api for "diff" unix/linux program

    Hi
    Is there a Java api that provides the same functionality as the "diff" program in linux/unix.....any pointers/help..this program will return the diffrence of 2 text files..
    thanks..

    What solution did you finally use? With iTEXT, it seems that you have to have perfect xhtml...it doesn't look like you can't convert from HTML to pdf directly....

  • Wanna create a gui for an app

    greetz!
    i wanna create a little gui for a commandline app. never done this before. does any1 know about some howto's online? i don't know much about these things at the moment, but i gotta start somewhere, and i'm not afraid to read and spend some time. things that cross my mind when thinking about creating a gui are python, c, gtk,...
    any help, advice, links are very welcome! 
    thanks in advance!

    These should be helpful:
    http://java.sun.com/docs/books/tutorial … index.html
    http://java.sun.com/docs/books/tutorial … index.html
    Basically, you start with a static main method, create a JFrame extension from in it, create the display, add events for buttons and components. To interface with a commandline app, you can use Runtime.getRuntime().exec(); take a look at the java api (under java.lang) for the various versions of the exec method.
    You can e-mail me directly (dusty at buchuki.com) if you have questions, though for professional style advice, the forums at java.sun.com might be more effective (though perhaps not so friendly :-D)
    Dusty

  • Create Java bean for a http session

    how can i create a java bean for an http session. also is it possible to access it from another java class within that session

    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45

  • Searching through a database table from a java GUI

    i've created a java GUI using Netbeans which connects to a derby database. a table from this database is placed in my GUI, containing some text in all its rows. Now, i want to create a search function that will look for a given string of text through this table and output the results somewhere. can anyone please give me some tips on how i might go about doing this?
    thanks,
    Karan

    You may put a radio button or check box next to the column name.
    You can also put a drop down list contains option "start by", "end by", "contains" matched to SQL like statement, '%XX', 'XX%' and '%XX' respectively.
    You may also make the column name as a button which user can selected the ordering preference - ascending, descending, default.

  • In OBIEE 11G, how to get the special parameter created by JAVA?

    Hi Experts,
    In OBIEE 11G, how to get the special parameter created by JAVA?
    For example:
    In JAVA , it has set one parameter named 'test'.
    So how to get the parameter in filter area in OBIEE?

    Hi Kobe,
    No P2 holds the parameter name like PresentationTable.ColumnName, in your form you may go for complete name or just column name and before submitting the form you can define the Action url.
    I would suggest to read section 6.3.2.1.
    ex:
    <SCRIPT LANGUAGE="JavaScript">
    changeAction(url) {
    var TestVar = form.inputbox.value;
    document.this_form.action="saw.dll?Go&Path=/Shared/Test/SB2&Action=Navigate&P0=1&P1=like&P2=Customers.Region&P3="+TestVar;
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR>
    <INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
    <INPUT TYPE="button" NAME="button" Value="Click" onClick="changeAction(this.value)">
    </FORM>
    If helps pls mark.
    Edited by: veeravalli on Oct 24, 2012 10:25 AM

Maybe you are looking for