Communication between servlet(client behavior) and stand alone java program

Hello all:
I need to send a message (ascii characters sequence) from a servlet to a java program, but I'm not sure what is the best way to get it: socket, JMS or other mechanism that I don't know.
Is the servlet who is operating how client behavior.
Please, any comment will be appreciated, regards,
Ulises.

You can always start a ServerSocket on the client (kinda sounds funny, doesn't it) which will accept connections. You then open a plain old Socket on the server to connect to the client's listener. (Note, this is the reverse of a normal set-up). Once you have the connection established, you will call getOutputStream() to get a stream to write to. Likewise, you will call getInputStream() to read the data sent. You will want to investigate the java.net.* and java.io.* libraries.
- Saish

Similar Messages

  • Diff was java add in and stand alone java instance

    Hi Guys ,
    What is the diff between  was java add in and stand alone java instance ?
    Thanks
    Sonam

    Hai,
    SCS is nothing but the SAP Central Services, it is AS Java instance of an SAP system containing the enqueue server and the message server.
    JAVA Addin is inserted in exsisting ABAP only instance to have JAVA functionality. JAVA instance is assigned to an ABAP instance. The Internet Communication Manager (ICM) of the ABAP instance starts and stops the associated Java instance as required.
    Netweaver JAVA (Stand alone) vs JAVA Addin:
    Netweaver JAVA Addin installation is a dual installation that consists of Java and ABAP stack. Addin is required when you are implementing SAP XI (Exchange Infrastructure). Stand alone JAVA is required when you implement SAP EP (Enterprise Portal). It is generally not recommended to use dual installation for EP because this will expose the ABAP layer to the public Internet. So the ABAP stack is often used to host SAP ERP ECC (Enterprise Central Component), SAP CRM, SAP SCM, etc.,
    Since the information hosted on ABAP stack is more sensitive in nature you are recommended to install Portal on the Netweaver AS Java server (Stand alone JAVA server).
    By doing this you will be able to fully utilize the system resources for the portal and ensure good performance.
    Regards,
    Yoganand.V

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Unable to connect to ECC system through stand alone JAVA program using JCO.

    Hi All,
    I want to connect to ECC system through standalone JAVA program using jco.while executing my java program it is saying that connection refused.
    I am getting the error as shown below.
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CMALLC : rc=20 > Co
    nnect from SAP gateway to RFC server failed
    Connect_PM  GWHOST=192.168.10.99, GWSERV=sapgw01, SYSNR=01
    LOCATION    SAP-Gateway on host igm501 / sapgw01
    ERROR       partner '192.168.10.99:sapgw01' not reached
    TIME        Mon Sep  1 15:00:37 2008
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -10
    MODULE      nixxi.cpp
    LINE        2821
    DETAIL      NiPConnect2
    SYSTEM CALL connect
    ERRNO       239
    ERRNO TEXT  Connection refused
    COUNTER     2
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:11
    25)
            at com.sap.mw.jco.JCO$Client.connect(JCO.java:3138)
            at JConnector_frmDesk.<init>(JConnector_frmDesk.java:91)
            at JConnector_frmDesk.main(JConnector_frmDesk.java:141)
    I have already configured SAPDP01,SAPGW01 in my services file in windows\system32\drivers\etc\services.
    What else i need to do to connect to ECC system through my JAVA program.Please help me in this regard.
    Regards,
    Ramana.

    Hi !
    Check this to verify that you are correctly using JCO:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Try to give in ashost="/H/saprouter/H/sap".
    Regards,
    Matias.

  • Error 2032 in communication between Flex Client and WCF

    Hi All,
    I'm trying to establish communication between Flex Client
    and WCF service.
    WCF service accepts gZip compressed data and returns gZip
    compressed results.
    So I used Flex ByteArray.compress() and
    ByteArray.uncompress() for this purpose. However, it throws error
    2032.
    The gZip compression/decompression uses MemoryStream class in
    C#. Based on my previous experience, memory stream communication
    between Flex and C# gives erro 2032.
    Is there a work around for this?
    Thanks,
    Vishal

    I read some thread in the forum, and found somebody had the similar problem with me. Just want to know how to settle this problem.
    In the client/server program. Client is a JAVA program and Server a
    VC++ program. The connection works, and the problem appears after some time. The Client sends a lots of requests to Serverm, the server seems receive nothing. But at the same time, the server is able to send messages to Client. The Client also can get the messages and handle them. Don't understand why there this problem and why it appears when it wants.
    The client is a Win2k platorm with JDK1.3.1 and the server is also a Win2K platform with VC++ 6.0.
    In the Client, using:
    inputFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    outputToServer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);
    Hope can get your help.

  • Can I backup between a testversion and stand-alone version?

    Can I backup between a testversion and stand-alone version?

    You are correct, the CC version is activated with your Adobe ID and password after you have signed up for the creative cloud plan. You can uninstall that CC version and install the standalone. It is the same program, and will open the same catalog. You don't need to back up anything. Just change over to the standalone program and start Lightroom. Everything will function just the same6.

  • Communication between two clients

    In Java Networking, communication between server-client or bwtween server-multiple clients is general. But How will be the communication between two cients, means two clients can send & receive messages to & from each other(being guided by server).

    Sorry,
    I didn't get your reply clearly.
    I want, if Server is running, and two clients(two instance of a same program) are opened, whatever message(string)client1 send to Server,then the Server needs to send those to client2.Again, the some response should come from client2 to client1 thru Server.
    How can I implement this?
    If you have idea, or some sample code about this, please let me know.
    Regards.

  • Consuming dataservice as a stand alone java client, givng an exception com

    when i am trying to access data service from a stand alone java application ,it giving an exception .
    The dataservice is in remote machine.
    Exception:
    com.bea.dsp.dsmediator.client.exception.SDOMediatorException: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:322)
         at empldetappdataservices.EmployeeDetails.getEmployeesByid(EmployeeDetails.java:84)
         at com.patni.tsg.poc.DataServiceClient.DataServiceClient.main(DataServiceClient.java:42)
    Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
         at com.bea.ld.Server_ydm4ie_EOImpl_815_WLStub.executeFunction(Unknown Source)
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:312)
         ... 2 more
    Caused by: java.io.EOFException
         at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897)
         at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:586)
         at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:536)
         at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:694)
         at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:641)
         at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    my class path i added all neccessary jars:
    weblogic.jar,xbean.jar,DataServices.jar,ld-server-core.jar,ld-client.jar,wlsdo.jar
    code sample:
    public static InitialContext getInitialContext() throws NamingException {
    Environment env = new Environment();
    env.setProviderUrl("t3://pc-p40892:7001");
    env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
    env.setSecurityPrincipal("weblogic");
    env.setSecurityCredentials("weblogic");
    return new InitialContext(env.getInitialContext().getEnvironment());
    public static void main (String args[]) {
    try {
    EmployeeDetailsDocument.EmployeeDetails edet=null;
    EmployeeDetails ds=EmployeeDetails.getInstance(getInitialContext(),"EmplDetApp");
    //The below statement generating the exception.
    EmployeeDetailsDocument[]doc =ds.getEmployeesByid("1001");
    } catch (Exception e) {
    e.printStackTrace();
    pls help me to solve this problem
    Edited by sandeepc221 at 09/19/2007 2:50 AM

    You didn't post the stack trace from the server, but I'm guessing it's complaining about the QName class. Sun changed the QName class in JDK 1.5 wreaking havoc on JDK 1.5 clients that use JDK 1.4 servers and attempt to pass a QName object from one to the other. If your client uses JDK 1.5, your sever will need to use a QName class which is compatible. The file liquiddata/lib/wls90interop.jar contains a QName class that is compatible with the one in JDK1.5. You can put it first in the classpath of your server.
    If you already have wls90interop.jar first in the classpath of your server, then, for your client, you need to either (1) use the Sun JDK 1.5; or (2) put wls90interop.jar first in the classpath of your client (if you are running JDK 1.4).
    http://e-docs.bea.com/aldsp/docs25/appdev/ejbclt.html#wp1090900
    btw - BEA Customer Support is available 24/7 - they should be able to provide you quick answers to questions like this.

  • Communication between PC/RM Backend and ERP System

    Hi,
    Is it possible to have communication between PC/RM Backend and ERP System by cresting RFCUSER with user type communications data instead of Dialog user.
    Because of audit policy , none of DIALOG user should have SAP_ALL profile.
    Is there a option to set up communications  between PC/RM Backend and ERP System without a Dialog user setting.
    Pravin

    Hi Pravin,
       You are right and the user should be always communication or system. GRC AC allows for the user to be communication or system. Can you try with PC/RM RFC user and see if it works? It should work
    Alpesh

  • How do I set my firewall settings in Avasti to allow communications between my HP 8600 and my comput

    How do I set my firewall settings in Avasti to allow communications between my HP 8600 and my computer

    Something to Consider:
    If you are talking about "Avast!" Security Software, either the free or the paid version, the following may apply to you:
    There are three main levels of Security in the Avast! software:  Home, Work, and Public
    Home is the setting many people use when "at home", that is, connected to the home network.  The home network is sometimes defined as the "192.168" network:  these are the computers and printers that you have and use in your home environment.  The network is (most usually) private and (should be) secured with with a passphrase at your router.  The Avast! Software sees the "Home" network as a "safe" environment:  devices connected within the "Home" network are allowed to "talk" (communicate) with one another without undue restrictions.
    Work is the next setting.  The software places some restrictions on this level of communication.  Home users can certainly use this setting -- in many (most) cases, the "Work" setting is a solution that provides for communication and a bit more security for the home network and its devices.
    Public is the strictest setting and is meant to keep your computer safe in a public place:  the library, coffee shop, on a street corner.  Outside "prying eyes" are prevented from peeping and outside communications are restricted.
    If you have set (or left) your Avast! software set to Public, or even Work (and you do not know how to handle the restrictions), then you may have simply locked out the communication between the printer and the computer(s) on your home network.
    Open your Avast! Software and set the security level to either "Home" or "Work".
    You can find out more about how to use the software settings at the Avast! website.
    Advanced Users Only - You will  know if you changed the Rules... this is not something one does by accident.
    If you have changed the rules within the settings, you may have locked yourself out.  Make sure you have both "in" and "out" traffic settings adjusted correctly for each rule you change / adapt / add.
    Kind Regards,
    Dragon-Fur

  • Email links out of Practice Fusion are not active (as they are in IE), which they say is a problem with "something lost in the communication between the Flash engine and the browser". Does anyone have experience with this?

    This is a medical records system, cloud based. I use Firefox to get into the system, but any browser would work. Other than this problem, Firefox works fine (better than IE, in my opinion).
    Patient demographics include their email, which is hyperlinked and should go right to Outlook (my default email program). This works in IE, but nothing happens on the click when using Firefox as the browser.
    I queried Practice Fusion, which replied: In regards to your previous question about the email hyperlink in the patient information, it looks this is not something that can be fixed on our end right now. It is the web browsers' responsibility to handle these types of links, and there seems to be something lost in the communication between the Flash engine and the browser. I apologize for any inconvenience.
    Thanks for any help anyone can provide.

    See if this helps you:
    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

  • Encrypt communication between SharePoint Web App and SSRS

    Hi
    I have SharePoint 2010 in multi server farm. The SharePoint web app has SSL enabled. The Reporting Server (SSRS) is http URL.
    So when the Report Viewer web part is used, the communication between SharePoint web server and SharePoint Reporting Server is unsecured. The existing SSL has hard coded hostnames and for business reasons we prefer not to modify it.
    Does anyone know how can I make that communication secured? Do I need to apply new SSL for SP Reporting Services? Is there any other option?

    This should get you off and running on SSL
    http://technet.microsoft.com/en-us/library/ms345223(SQL.100).aspx
    and if you haven't go SQL on SSL - ->
    http://technet.microsoft.com/en-us/library/ms189067(v=sql.100).aspx
    Stacy Anothersharepointblog.blogspot.com

  • Differences between Remote Client copy and Client export and Import

    Dear All, I am new to SAP. Please let me know the Differences between Remote Client copy and Client export and Import. Any response is greatly appreciated. Thanks a Million

    Hello Mallikarjuna,
    Follow the below note,
    https://service.sap.com/sap/support/notes/552711
    which describes the answer to question - Which is better or faster, a client transport or a remote copy?
    Basically client transport would be preferred if the network connection between the source and target system is slow.
    For more help,
    http://help.sap.com/saphelp_nw70/helpdata/EN/69/c24c0f4ba111d189750000e8322d00/frameset.htm
    Regards,
    Debasis.

  • HT204387 which profile allows communication between iOS 4/later and Bluetooth Health Monitor(such as Fetal Heart Rate/Motion/respiration etc. )

    which profile allows communication between iOS 4/later and Bluetooth Health Monitor(such as Fetal Heart Rate/Motion/respiration etc. )

    Thank you!
    We are developing a monitor with Bluetooth 4.0 moudle, also programing an iOS App for this wireless monitor. We want to transfer the monitor data to iphone/ipad(which installed the App) through bluetooth.
    As you know, many bluetooth device are not allowed to connect to iphone/ipad through bluetooth. So I'd like to know that which of the iOS supported bluetooth profies should I use when programing, to ensure the monitor can connect to the Apple device and upload data. Of course, if they can connect successfully, both of the monitor and Apple device would be acknowledged "connected".

Maybe you are looking for

  • Serialization Exception

    Hi All, I am developing webservice application using Dynamic Proxy client. I am using Weblogic8.1 as my application server. All my services are generated using servicegen and clientgen task of Ant. While using Dynamic Proxy client to invoke webservic

  • Help! My calendar doesn't have preferences!

    So... I have a friend with iPhone and I noticed his calendar was multicolored... different appointments in different colors. But mine just makes everything purple. So I asked him how to change that, as I had looked through the Calendar program and co

  • Cannot create stack

    Hi, I'm a first time Mac user. I'm trying to create a Stack in my Dock by opening up Finder,then opening either Mac HD,my computer name or Places and then dragging Applications into my Dock but it does not take. Nothing happens. If I drag it from Pla

  • Sql 11g -1z0-051

    Hi, I am planning to the 1z0-051 exam. Can anyone suggest the single row functions that I should focus on. If posible send the list of functions. Thanks. Regards, Manoj.

  • How to analyse the following file generated by a JDK crash???

    Hi Guys, I am a newbie and needs some pointers in analysing the following file. This file is generated after JDK crashed. Kindly have a look and please suggest which tool can be used to analyse it. I am pasting a snippet of the content. Kindly have a