Accessing an object from a different server

Hi,
I am making a program that will access an object from a different server.
I have a program that when I run calls a jsp page running on Server A which in turn should request an object A from Server B.
I am relatively new to Java and jsp. What would my best course of action be.
Thanks in advance,
Brian

Or RMI?OK, sounds good, I will look up some RMi on the site.
Thanks, will prob have more questions for you later.

Similar Messages

  • Trying to use FTP to get data from a different server

    Hi Friends,
        I have to use FTP to get data from a different server and upload it on SAP server. Now my problem is when I m trying to do ftp through command line it brings the file but with no data.
       Through ABAP program nothing is happening.
    Here's my code--
      V_PASSWORD = 'test@123'.
      V_PWD_LEN = STRLEN( V_PASSWORD ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = V_PASSWORD
          SOURCELEN   = V_PWD_LEN
          KEY         = CS_KEY_500098
        IMPORTING
          DESTINATION = V_PASSWORD.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = 'test'
          PASSWORD        = V_PASSWORD
          HOST            = '176.0.1.6'
          RFC_DESTINATION = 'SAPFTPA'
        IMPORTING
          HANDLE          = MI_HANDLE
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      CHECK SY-SUBRC = 0.
      cmd = 'lcd d:\ftp'. .
      PERFORM FTP_COMMAND USING CMD.
      CMD = 'asc'.
      PERFORM FTP_COMMAND USING CMD.
      CONCATENATE 'dir' 'ftpt*' INTO CMD SEPARATED BY SPACE.
      PERFORM FTP_COMMAND USING CMD.
      cmd = 'ls'.
    concatenate 'ls' INTO CMD SEPARATED BY SPACE.
      PERFORM FTP_COMMAND USING CMD.
      cmd = 'mget trial.txt'.
    CONCATENATE 'mget' 'trial.txt' INTO CMD SEPARATED BY SPACE.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = MI_HANDLE
          COMMAND       = CMD
        TABLES
          DATA          = MTAB_DATA1
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3
          OTHERS        = 4.
      IF SY-SUBRC = 0.
        LOOP AT MTAB_DATA1.
          WRITE: / MTAB_DATA1.
        ENDLOOP.
      ELSE.
        CONCATENATE 'Error in FTP Command while executing' CMD INTO ERROR SEPARATED BY SPACE.
        WRITE: / ERROR.
      ENDIF.

    Hi
    try this.....in one of my reqt, i done this successfully....
    FORM FTPCON.
    FTP-------------------------------------------------------*
      CLEAR DSTLEN.
      SET EXTENDED CHECK OFF.
      DSTLEN = STRLEN( S_PWD ).     -
    >  (S_PWD (password) is a selection screen field )                  
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = S_PWD
          SOURCELEN   = DSTLEN
          KEY         = KEY
        IMPORTING
          DESTINATION = S_PWD.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = P_USER                   -
    > Username
          PASSWORD        = S_PWD             -
    > password
          HOST            = P_HOST                  -
    > Host
          RFC_DESTINATION = P_DEST         -
    > Destination
        IMPORTING
          HANDLE          = HDL
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = HDL
          COMMAND       = 'set passive on'
        TABLES
          DATA          = RESULT
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = G_FCNAME
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = T_FILE1
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = G_FCNAME1
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = T_FILE2
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = HDL.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
          EXPORTING
            DESTINATION          = P_DEST
          EXCEPTIONS
            DESTINATION_NOT_OPEN = 1
            OTHERS               = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ENDFORM.                    " FTPCON
    Hope it helps.....

  • Sending an object from client to server always on button press

    What I need is to send an object from client to server but I need to make server wait until another object is sent. What I have is the JFrame where you put the wanted name and surname, then you create a User object with these details and on button press you send this object to the server. I just can't hold the connection because when I send the first object, server doesn't wait for another button click and throws EOFexception. Creating the while loop isn't helpfull as well because it keeps sending the same object again and again. The code is here
    public class ClientFrame extends JFrame {
        private JButton btnSend;
        private JTextField txfName;
        private JTextField txfSurname;
        public ClientFrame() {
            this.setTitle(".. ");
            Container con = this.getContentPane();
            con.setLayout(new BorderLayout());
            txfName = new JTextField("name");
            txfSurname = new JTextField("surname");
            btnSend = new JButton(new AbstractAction() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    SSLSocketFactory f =
                            (SSLSocketFactory) SSLSocketFactory.getDefault();
                    try {
                        SSLSocket c =
                                (SSLSocket) f.createSocket("localhost", 8888);
                        c.startHandshake();
                        OutputStream os = c.getOutputStream();
                        ObjectOutputStream oos = new ObjectOutputStream(os);
                        InputStream is = c.getInputStream();
                        ObjectInputStream ois = new ObjectInputStream(is);
                        boolean done = false;
                        while (!done) {
                            String first = txfName.getText();
                            String last = txfSurname.getText();
                            User u = new User();
                            u.setFirstName(first);
                            u.setLastName(last);
                            oos.reset();
                            oos.writeObject(u);
                            String str = (String) ois.readObject();
                            if (str.equals("rcvdOK")) {
                                System.out.println("received on the server side");
                            } else if (str.equals("ERROR")) {
                                System.out.println("ERROR");
                        //oos.writeObject(confirmString);
                        oos.close();
                        os.close();
                        c.close();
                    } catch (ClassNotFoundException ex) {
                        Logger.getLogger(ClientFrame.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (IOException ex) {
                        System.err.println(ex.toString());
            btnSend.setText("send object");
            con.add(btnSend, BorderLayout.PAGE_START);
            con.add(txfName, BorderLayout.CENTER);
            con.add(txfSurname, BorderLayout.PAGE_END);
            this.pack();
            setSize(200, 150);
            setVisible(true);
    public class TestServer {
        public static void main(String[] args) {
            try {
                KeyStore ks = KeyStore.getInstance("JKS");
                ks.load(new FileInputStream(ksName), ksPass);
                KeyManagerFactory kmf =
                        KeyManagerFactory.getInstance("SunX509");
                kmf.init(ks, ctPass);
                SSLContext sc = SSLContext.getInstance("TLS");
                sc.init(kmf.getKeyManagers(), null, null);
                SSLServerSocketFactory ssf = sc.getServerSocketFactory();
                SSLServerSocket s = (SSLServerSocket) ssf.createServerSocket(8888);
                printServerSocketInfo(s);
                SSLSocket c = (SSLSocket) s.accept();
                InputStream is = c.getInputStream();
                ObjectInputStream ois = new ObjectInputStream(is);
                OutputStream os = c.getOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(os);
                boolean done = false;
                User u;
                  while(!done){
                    u = (User) ois.readObject();
                    String confirmString = "rcvdOK";
                    String errorString = "ERROR";
                    if (u != null) {
                        System.out.println(u.getFirstName() + " " + u.getLastName());
                        oos.writeObject(confirmString);
                    } else if (u == null) {
                        oos.writeObject(errorString);
                is.close();
                s.close();
                c.close();
            } catch (Exception e) {
                    System.err.println(e.toString());
    }Thanks for any help, btw this doesnt need to be via ssl, the problem would be the same using only http. Please anyone help me:)
    Edited by: Vencicek on 7.5.2012 2:19
    Edited by: EJP on 7/05/2012 19:53
    Edited by: Vencicek on 7.5.2012 3:36

    Current code fails because it's sending still the same entity again(using while loop)No it's not. You are creating a new User object every time around the loop.
    which makes the system freezeWhich means that you are executing network code in the event thread. Don't do that, use a separate thread. At the moment you're doing all that sending inside the constructor for ClientFrame which is an even worse idea: you can never get out of there to the rest of your client program. This is a program design problem, not a networking problem.
    and doesn't allow me to set new parameters of the new entityI do not understand.
    I need to find a way to keep Server running even when the client doesn't send any data and wait until the client doesnt press the send button again to read a new object.That's exactly what happens. readObject() blocks until data is received.

  • Access file object from flex web app

    Hi all,
    I want to access file object from flex web app. What should i do?
    I have to take array from my XML. In XML there will be only dir path. So for taking file name from dir i have to access it and have to perform for loop on that dir.
    What should I do?
    Any Ideas?
    Thanks,
    -CK

    Hi Michael
    My question is that I dont want to give name of images in XML file.
    In XML file there will be only path of image directory. So I need to find all image name from that image directory.
    Thats why I want to access file object.
    Any ideas?    

  • How to access COM+ Objects From JSP

    Friends,
    We have a requirement to access COM+ objects from JSP. Please guide me on this.
    Thanks in advance.
    Tarani

    Sanyam wrote:
    if there is any .dll extension file, how can we read that file in labview?
    You can use Call Library Function node to call that dll file and use it in LabVIEW. Read the help and you will get more details.

  • Taking rman backup from a different server

    HI Al,
    Is it possible for us run the rman backup from a different server other than the server on which database exist .
    For Ex :
    Our database is on server X
    But , I want to schedulde the archive backup from the server Y .
    How can we do this and is it possible ...
    Regds
    Rahul Gupta

    Yes, as long the RMAN executable is compatible to the target database, on metalink:
    RMAN Compatibility Matrix
    Doc ID: 73431.1
    rman sys/<password>@<connect_string>
    Werner

  • Accessing java objects from within javascript

    Hello,
    Anyone with an idea of a useful toolkit for accessing java objects from within javascript will be much appreciated.
    Thanks in advance,
    Antana.

    What do you mean by accessing Java objects? Do you mean interacting with an applet via JavaScript? Something else?

  • Passing a object from browser to server

    How can i pass a java object from browser to server, can anybody help me in knowing this?
    Rajesh.

    You might need to clarify this. What exactly do you need to do? You can't pass anything from a browser except HTML, other than by attachment. If you have a Java object, then I assume that you are using JSP or something that supports Java, in which case you are already using server-side semantics.
    If however, you mean Javascript, that's a whole other problem, as it is client side only.
    Perhaps if you clarify what you are trying to do someone can give you a good answer.
    Regards,
    Paul

  • So I had a mac with an account on it, I no longer have that laptop. Can I access my library from a different computer? If so, how?

    So I had a mac with an account on it, I no longer have that laptop. Can I access my library from a different computer? If so, how?

    No

  • How to access form objects from different class?

    Hello, I am new to java and i started with netbeans 6 beta,
    when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
    i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
    Question>
    How can i access jTextField1 value from different class that i created in the same project?
    please help. and sorry for such newbie question.
    Thanks Mike

    hmm now it says
    non static variable jTree1 can not be referenced from static context
    My code in ClasWithFormObjects is
    public static void setTreeModel (DefaultMutableTreeNode treemodel){
    jTree1.setModel(new DefaultTreeModel(treemodel));
    and in Class2 it is
    ClasWithFormObjects.setTreeModel(model);

  • Is it possible to access a database on a different  server?

    Hi Folks
    Forgive me if this has been asked already. We are in the
    process of moving one of our sites to a new server. It will reside
    there alone. I have several Access databases that are shared
    between two different websites. Now these sites will reside on two
    different servers. Is there any way to access one Access database
    that resides on one server from another server? The good part is
    the second sever will be using the data for read-only outputs.
    Thanks in advance for any help you can priocdie.
    John

    MS Access is not really intended for networking in this
    manner, and I would imagine that you would have problems with
    locking contention at the very least with two CF servers vying for
    access. Also, another major problem with attempting to set up an
    Access DSN where the ColdFusion server is on a different machine
    from the Access database is file permission. Normally, ColdFusion
    is setup on its server under an administrator account, so if you
    attempt to connect to an Access database on another server over a
    mapped network drive, the admin account on your CF server usually
    does not have the appropriate privileges on the machine hosting the
    Access database. This usually requires you to install CF under a
    user account that has privileges on both machines. (There have been
    tech notes on this subject in the past.)
    Bottom line, not a good idea at all. I would seriously
    consider migrating to anything but Access for these and many other
    reasons, the least of which is that Access is usually not suitable
    for anything but a development or prototype environment.
    Phil

  • Accessing Java objects from C++ client

    I have a number of Java CORBA server objects that I have deployed to an 8.1.7 database.
    I can invoke these objects from a Java client with no problem, but I also need to access them from a C++ client.
    I have used idl2cpp from VisiBroker for C++ (version 4.5) to generate the client stubs, and I've downloaded the interop.tar file from http://technet.oracle.com/products/oracle8i/htdocs/jserver_faq/interop.tar
    The problem that I have is that I have not been able to build a client program because login.lib from interop.tar generates conflicts at link time. I've tried everything that I can think of, but I always end up with either missing references or multiply defined symbols. I've tried building using both MS Visual C++ and Borland C++Builder, but with no success.
    Has anybody succeeded in building a C++ client? Surely it shouldn't be this difficult?
    Thanks,
    Tony

    Thank u for taking care of me
    But the hint given by u is not apt to my query.
    If any new suggestion pls send again

  • Accessing a file on a different server

    hi...can you please give me some idea on how to access a file on a remote server?
    i just need to open that file on that server and append some data to it everytime someone calls my program?
    I just know the ip address of that remote server and the path of that file..
    tia
    Edited by: hari786 on Aug 5, 2008 12:52 PM

    You have to have a program on your computer that connects to the Internet, and sends some data to the other computer. Then you have to place a program on the remote server that will connect to the Internet, listen to it, receive the data from your computer, and then append the data to the remote file. This tutorial shows you how to do that:
    [http://java.sun.com/docs/books/tutorial/networking/index.html]
    You can't do all of this from your computer only - imagine the results if any computer (yours) could connect to any other computer (mine!!) it wanted to, and then wrote any data it wanted into my computer. That would not be nice.

  • Unable to access web setup from 4 different Win7 machines with IE9 / FireFox

    I Hope someone can help, I suspect this may have something to do with a recent update to Windows or IE since this worked at least a couple of months ago.
    I'm unable to access the  web setup screen from 4 different windows machines running IE 9 or Firefox (various combinations of wireless, wired, etc.). When I get to the certificate error and hit the "yes, i understand, continue", it comes back with a 'can't be reached' page and looking into the details says the 'connection was dropped'.  However If I connect from a MacBook / safari, I'm able to reach the page fine (and admin the router).
    Summary:
    Using a wrt610n
    I am connected to the router, the ip address hasn't changed, the password hasn't changed
    I can use the router & connect to the internet
    I have the router set to require HTTPS, but switching it to allow HTTP doesn't help.
    Both Wired & Wireless Win 7 / IE9 machines can't connect.
    Tried setting the router ip address to 'trusted' zone in IE
    Tried setting the router ip address to the 'compatibility' mode in IE
    Tried using latest version of Firefox with the same results.
    Thanks in Advance!
    Stephen

    Before I suggest you any troubleshooting steps, I would like to ask few question. Like did you try opening the “https://192.168.1.1” in Internet Explorer 8. If not, then try to open the Router Management page in the same manner in Internet Explorer 8 and check whether it opens or not. As it should show up.

  • Access abap object  from external system

    In R/3 have a Business Objects how can I access this object, for example Workflow BO, from java (external system) using XI????
    My goal is create workflow´s in r/3 sending as input the workflow characteristics and then create the workflow in R/3 and sending as output the idworkflow was creatde.
    thanks in advanced.

    Dear Murali,
    Try this
    a)Start transaction SXI_CACHE.
    b)From the context menu XI Runtime Cache select Start Complete Cache Refresh.
    If you still face issue try this .
    Many actions require to access System Landscape Directory content from the Integration Builder. To optimize performance, this content is loaded into a cache so that the System Landscape Directory does not have to be accessed directly each time that System Landscape Directory content is required.
    However, this cache is not automatically updated if changes are made to the content of the System Landscape Directory. For this reason that we delete the System Landscape Directory cache if changes have been made to content in the System Landscape Directory. The cache is then filled each time that the System Landscape Directory is accessed. If we log on to the Integration Builder after we have made a change in the SLD, we do not need to delete the SLD cache.
    To clear the SLD cache, from the Integration Builder main menu, choose Environment ® Delete Cache for SLD Data.
    Once we have deleted the cache for SLD data, accessing objects in the SLD may take longer than usual initially.
    Regards
    Agasthuri Doss

Maybe you are looking for

  • Subtotal in alv grid

    hi friends.. how to maintain subtotal (group of fields) in  alv gird display. we have two fields in our report. filed2 is editable mode. see the below the example.. eg: field1    field2    abc      100.00 abc      200.00 abc      300.00 bcd      100.

  • Word 2010 ActiveX control makes combo box malfunction

    Good day. I'm teaching my students how to make electronic forms in Word 2007 / 2010. As there is no radio button option in the content / legacy controls, I've tried using the ActiveX option button for this purpose. However, as soon as I insert this c

  • Optical out then back to analog?

    Is that even possible? My AE has stopped outputting the right channel. I have read that some people have had luck using an optical connection to get a stereo connection back when the analog fails. I can't seem to find any info about "dumbing" an opti

  • ACS / NAC phase 2 / posture validation with symantec AV

    Hi, We encounter problem to implement NAC phase 2 with symantec. ACS is an appliance one, version 4.0 We?ve installed the Symantec AV pair on the ACS : that?OK. The following softwares are installed on the client PC: - Cisco CTA : ctasetup-win-2.0.1.

  • UnsatisfiedLinkError Problem.(Urgent)Pls Help!!

    Hi, I just want to run a swing under win98 OS platform and an error message appeared : Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\jdk1.4\jre\bin\awt.dll: An attempt was made to load a program with an incorrect format I have changed