Servlet to push unsolicited data to clients
Hi,
I have a servlet in which messages are XML documents in the body of HTTP requests/responses. A client sends in the HTTP/XML request, the servlet delegates processing to some service provider, gets the result, and sends it back to the client as XML in the body of the response. That all works fine.
I now want to extend the servlet to handle the situation where unsolicited data (in XML) is pushed to the client. It is not a broadcast system, the unsolicited data would be targeted at a specific client (or maybe a small number of clients).
Any suggestions of the best way to approach this kind of facility?
Thanks,
Paul
The servlet does have some knowledge of clients through session information. All clients are required to log in so the servlet can store any information it wants about each client with a session. Of course, that doesnt give the servlet the ability to open a connection to a client.
I was hoping there might be some way for the client to open a persistent connection to the servlet which would be recorded in the session data. The servlet could then use this connection to push XML data to the client at arbitrary times.
In this system when I say client I don't mean a browser. The primary purpose of this interface is to allow other systems to access services.
Similar Messages
-
Applet-Servlet - Creating a new file on client's mashine
Hi all!
I need to write a program, that will get a data from client through Applet text fields and save it to a new(or rewrite existing) file on client mashine. To save it, I want to use Servlet, because Applet can't do this because of security restrictions. So I think of sending data from Applet to Servlet, which will save it in a new file (will download this file back to the client's mashine).
I found the following code in forums to download a file from server to client:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class OutputFileOnBrowser extends HttpServlet {
public void service(HttpServletRequest req,HttpServletResponse res)
throws ServletException, IOException
res.setContentType("application/x-filler");
res.setHeader("Content-Disposition", "attachment; filename=out.fif;");
ServletOutputStream stream = res.getOutputStream();
BufferedInputStream fif = new BufferedInputStream(new FileInputStream("in.fif"));
int data;
while((data = fif.read()) != -1)
stream.write(data);
fif.close();
stream.close();
but I don't understand, does it automatically downloads the file out.fif to client's disc and in what path? I tried it, and it did nothing. Anyway, this code doesn't fit exactly my purpose, because I have first to create the file.
Could anybody help me please?
Thank you in advanse!
P.S. I've already wrote the Applet code, what I need now is o n l y the help with a Servlet part!
Best regards.Thanks, but I want not client but servlet save the file automatically in a given path on client's mashine. Is there any way to do that?
Thanks. -
Best way to push change data from sql server to windows/web application
i apologized that i do not know should i ask this question in this forum or not.
i have win apps which will load all data initially from db and display through grid but from the next time when any data will change in db or any data will be inserted newly in db then only change or newly inserted data need to be pushed from db side to
my win apps. now only sql dependency class is coming to my mind but there is a problem regarding sql dependency class that it notify client but do not say which data is updated or inserted.
so i am looking for best guidance and easy way to achieve my task. what will be the best way to push data from sql server to win or web client.
there is two issue
1) how to determine data change or data insert. i guess that can be handle by trigger
2) next tough part is how very easily push those data from sql server end to win apps end.
so looking for expert guide. thanksHello,
Yes, you can create DML trigger on INSERT and UPDATE to get the changed data into a temp table. And then query the temp table from application.
If you are use SQL Server 2008 or later version, you can also try to use
Change data capture, which
can track insert, update, and delete activity that is applied to a SQL Server table and store the changed values on the Change Table.
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
View data in client B from client A in the same SID without a valid logon?
Hi Folks
We are planning on upgrading our 4.6C system to ERP 6.0, and are initialy considering having two clients in the same sandbox SID. One would be for the developers to perform code remediation checks (client A), and one would contain a copy of production data for performing testing of functionality over live data (client B).
Would it be possible to view data in client B from client A in the same system without a valid logon to client B or RFC connection to client B from client A? For example via the use on an ABAP program to SQL the database?
I know one can use transactions like SM30/SM31 to view, compare, and adjust data between clients, but this requires an RFC connection and valid logon to the target client.
Regards
Kevin.Hi Kevin.
>
Kevin McLatchie wrote:
> Would it be possible to view data in client B from client A in the same system without a valid logon to client B or RFC connection to client B from client A? For example via the use on an ABAP program to
Short answer: yes.
If someone has the right to write and execute ABAP reports on the system he is able to access the data of all clients. So I don't think that this setup is advisable. Don't mix development and production data in one system.
Best regards,
Jan -
How to push System-Data to the SLD ? NWA 7.11
How can i push the data from a J2EE-system to the SLD that is connected/configured in the NWA (Destinations) ?
In older versions of NWA there's being a 'collect and send'-button...
best regards
Christoph
Edited by: Christoph Bastian on Aug 17, 2011 3:46 PMHi,
Perhaps this link could help:
http://help.sap.com/saphelp_nwce711/helpdata/en/48/b6847d96655295e10000000a42189b/frameset.htm
The SLD_DataSupplier and SLD_Client destinations should be set in NWA -> Configuration Management -> Security Management -> Destinations
Next under Configuration Management -> Infrastructure Management -> SLD Data Supplier Configuration. Collect and Send exists to send the data to SLD.
Regards,
Srikishan -
Hi
I am trying to import data in Oracle 11g Release2(11.2.0.1) using impdp utitlity and getting below errror
UDI-00018: Data Pump client is incompatible with database version 11.2.0.1.0
Export dump has taken in database with oracle 11g Release 1(11.1.0.7.0) and I am trying to import in higher version of the database. Is there any parameter I have to set to avoid this error?AUTHSTATE=compat
A__z=! LOGNAME
CLASSPATH=/app/oracle/11.2.0/jlib:.
HOME=/home/oracle
LANG=C
LC__FASTMSG=true
LD_LIBRARY_PATH=/app/oracle/11.2.0/lib:/app/oracle/11.2.0/network/lib:.
LIBPATH=/app/oracle/11.2.0/JDK/JRE/BIN:/app/oracle/11.2.0/jdk/jre/bin/classic:/app/oracle/11.2.0/lib32
LOCPATH=/usr/lib/nls/loc
LOGIN=oracle
LOGNAME=oracle
MAIL=/usr/spool/mail/oracle
MAILMSG=[YOU HAVE NEW MAIL]
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
NLS_DATE_FORMAT=DD-MON-RRRR HH24:MI:SS
ODMDIR=/etc/objrepos
ORACLE_BASE=/app/oracle
ORACLE_HOME=/app/oracle/11.2.0
ORACLE_SID=AMT6
ORACLE_TERM=xterm
ORA_NLS33=/app/oracle/11.2.0/nls/data
PATH=/app/oracle/11.2.0/bin:.:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.:/usr/local/bin:/usr/ccs/bin
PS1=nbsud01[$PWD]:($ORACLE_SID)>
PWD=/nbsiar/nbimp
SHELL=/usr/bin/ksh
SHLIB_PATH=/app/oracle/11.2.0/lib:/usr/lib
TERM=xterm
TZ=Europe/London
USER=oracle
_=/usr/bin/env -
Error, while pushing the data from Oracle to MSSQL.
Hi,
I am facing the below error, while pushing the data from Oracle to MSSQL.
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Transparent gateway for MSSQL][Microsoft][ODBC SQL Server Driver][SQL Server]Update or insert of view or function 'View_Name' failed because it contains a derived or constant field.[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (SQL State: 00000; SQL Code: 8180)
Please suggest me, how to overcome from this.
Thanks.[email protected] wrote:
Hi,
I am facing the below error, while pushing the data from Oracle to MSSQL.
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Transparent gateway for MSSQL][Microsoft][ODBC SQL Server Driver][SQL Server]Update or insert of view or function 'View_Name' failed because it contains a derived or constant field.[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (SQL State: 00000; SQL Code: 8180)
Please suggest me, how to overcome from this.
Thanks.This is an error from SQL Server being passed back to Oracle so you can see the problem.
What it is saying is that you are trying to insert (or update) data to a database view and that view contains a column that is either a constant (literal) value or is derived (a calculation, formula or string concatenation etc.).
As such, you can't insert or update data on that column because it has nowhere to go on the database table(s) that underly the view. -
How to push the data from PSA to Data Target in 3.5 version
Hi Experts,
I'm currently working on BI 7. I have some master data load being maintained in 3.5 version.
The infopackage has an option to load the data to psa and data target when extracted.
I want to stage the data at PSA only.
Later I want to trigger it to the target.
In 7 version we use DTP but I'm not very sure what should I do here.
Can anyone please help me to push the data to the target please using 3.5 version.
ThanksHi pathak,
Thanks for your reply. I'm able to do it.
Can you please tell me how do I filter the load to target.
We have filter in DTP where i can restrict the load.
Do we have any option in 3.5.
Please advice.
Thanks -
Regarding Batch Jobs for migration of data from client DB to our local DB
Hi Folks,
GoodDay, Previously I worked as a Oracle Developer and recently shifted into a BIG organisation as PL?SQL developer. Here my base work is with INTERFACES(Stored Procedure). That is retrieving data from client DB and need to put the data in our staging tables. For that i created 2 INTERFACES(stored procedures). One is for one time migration. No need to run on regular basis. The second one is to run regularly why because if any updations are done in client DB that should be replicate to our DB. For that we need to run a BATCH JOB regulary 24X7 basis.
But i dont have any working knowledge on BATCH JOB creation and running. Please let me guide on this issue ASAP.
Regards,
Ramesh.You can try
dbms_job(9i)
or
dbms_scheduler(10g)
just out of curiosity.. tell me if you are interested...
what you were doing as a "oracle developer" ( is it like writing only "sql" )... -
To add new record into the table Data Service client
When I am trying to add new record into the table Employeedetails using Data Service client it is giving a sql exception: "java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1."
Code:
DataService ds=DataServiceFactory.newDataService(getInitialContext(),"EmplDetApp","ld:EmplDetAppDataServices/EmployeeDetails");
EmployeeDetailsDocument edoc=EmployeeDetailsDocument.Factory.newInstance();
edoc.addNewEmployeeDetails();
//here I set the primary key value empid
edet.setEmpid("1212");
edet.setEmpname("manu");
ds.submit(edoc);
Error
EmpName 5 java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
com.bea.ld.dsmediator.DataServiceException: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:247)
at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:528)
at com.bea.ld.dsmediator.update.DataServiceMediator.submit(DataServiceMediator.java:245)
at com.bea.ld.ServerBean.submit(ServerBean.java:529)
at com.bea.ld.Server_ydm4ie_EOImpl.submit(Server_ydm4ie_EOImpl.java:910)
at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:492)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:435)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:430)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Unknown Source)
Caused by: java.sql.SQLException: Violation of PRIMARY KEY constraint 'PK__EmployeeDetails__6383C8BA'. Cannot insert duplicate key in object 'EmployeeDetails'. Severity 14, State 1, Procedure 'PC-P41403 null', Line 1
at weblogic.jdbc.mssqlserver4.TdsStatement.processWarning(TdsStatement.java:1178)
at weblogic.jdbc.mssqlserver4.TdsStatement.parseMsWarning(TdsStatement.java:1089)
at weblogic.jdbc.mssqlserver4.TdsStatement.getMoreResults(TdsStatement.java:756)
at weblogic.jdbc.mssqlserver4.TdsStatement.execute(TdsStatement.java:210)
at weblogic.jdbc.mssqlserver4.TdsStatement.executeUpdate(TdsStatement.java:97)
at weblogic.jdbc.mssqlserver4.TdsStatement.executeUpdate(TdsStatement.java:1455)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
at com.bea.ld.dsmediator.update.JDBCAdaptor.save(JDBCAdaptor.java:151)
... 15 more
But I am not sure why it is giving an exception as Violation of PRIMARY KEY.
The update method works fine for the same client.
The exception only happens when I am trying to insert a new record.
Please help me to figure out this problem.If you are absolutely sure that you do not have such a row already in your table, open a case with customer support and reference CR321312. I believe the work-around is to put ld-server-core.jar in your client classpath.
Correction: put ld-server-app.jar in the client classpath
Edited by mreiche at 09/17/2007 3:28 PM -
Error 61 when sending data from client and back from server.vi
Trying to generate and send a data from client.vi and adding the numbers generated and sending it back to the client .In client the data is received only once and an error 61 occurs .How do I get rid of this error?I have attached the two files for reference
Attachments:
Sguruserver.vi 63 KB
client1.vi 100 KBYou can certainly use and application started by WebStart to send data to a server.
However, the Sandbox restrictions allow you to contact the server the application was loaded from without asking for permission first (i.e. signing your application and requesting the proper permissions in your JNLP file).
The JNLP BasicService can be used to retrieve the URL (and therefore the server) the application was loaded from. -
Directions on how to setup printers and push them out to clients using WGM
Hello, I am looking for directions on how to manage printers in WGM. How do you set them up and how do you push them out to clients.
You'll probably get a more succinct answer posting to the server forums.
-
Getting SQL*Net more data from client waits when running a query through web based interface
Hi, you all,
We are having this weird behavior when running query through web based interface, we get a lot of "SQL*Net more data from client" waits, the OEM indicates that the current wait event is SQL*Net more data from client
It's just a very simple query wich invokes a db link.
When I execute the same query on any PL/SQL tool like toad or sql developer it works fine, but that query inside an application executed through a web based interface, it hangs for ever.
Where can I start looking for the problem.
We are working on a 3 Node RAC 11gr2, both databases are on the same RAC.
Thanks.Hi ,
we managed to reproduce the case in test environment, below are the steps:
1)have 2 databases on different machines, will call the first one local, the other one remote.
2)in the local database create:
a - DBLink to remote database.
b - read data from remote database(we simply used select count(*) from dummy_table )
c - insert data into a table on the local database
d - terminate the connection between the 2 databases (disconnect either machine from the network)
e - commit on local database.
what we noticed was the following:
1)when the local database is disconnected from the network(the machine is not connected to any network at the moment): almost immediately throws an error, and issuing the following:
select * from dba_2pc_pending;we found some data .
2) when the remote database was disconnected(the local database is still connected to the network):
after 7-8 seconds an error is thrown, and issuing the following:
select * from dba_2pc_pending;did not return any data.
since this is pretty similar to our case ,we concluded that it's a network issue.
is this the correct behavior ?
as a temporary solution till the network issue is fixed ,we did the following:
1) changed the call of the remote procedure to calling a local procedure that calls the remote procedure.
2) added pragma autonomous_transaction to the local procedure.
3) at the end of the local procedure rollback the autonomous transaction.
it seems that since the global transaction does not use the DBLink database does not issue a 2PC commit.
this works in my cases since the DBLink is only issed to read data. -
Error writing data to client-side row cache. URGENT!!!
Hi everyone
I had had this error for 3 weeks and I don't know what am I doing wrong?
I have an Oracle Database. and when I Run my project from JSC I get this error:.
Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
Exception Details: javax.faces.FacesException
java.sql.SQLException: [sunm][Oracle JDBC Driver]Error writing data to client-side row cache.
Possible Source of Error:
Class Name: com.sun.jsfcl.data.RowSetDataModel
File Name: RowSetDataModel.java
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
I uninstalled and installed the JSC and the first time that I run my project worked fine, but just that time, because then the error appeared again.
What can I do????
Thanks!!!
Wendy,
Costa RicaDuplicate thread of
http://swforum.sun.com/jive/thread.jspa?threadID=53424&tstart=0 -
Pushing the data through proxy to ECC Developement as well as to quality
Hi all,
I need to push the data throug proxy from XI to ECC(developement system) at the same time to ECC(quality system)
What do we need to do from XI?
Thank youIn most setups you would have a DEV ECC box which points to DEV PI box and a QUAL ECC which points to a QUAL PI box . So in SPROXY of ECC you would be able to see the interfaces from either DEV or QUAL .
So, my assumtion is that you will not be able to do this unless both ECC boxes point to the same PI box. If tht is the case, you need to just add both ECC Bus Sys in the receiver determination and create 2 interface determinations.
Maybe you are looking for
-
There was a problem connecting to the server "owner-pc"
For some reason the message "how to stop the pop up for "There was a problem connecting to the server "owner-pc", keeps popping up on screen. This sometimes happens when I am trying to change my desktop background, but at this moment, I am using Micr
-
Some songs that I've bought on iTunes won't play on my iPhone 3GS even though they used to and they will still play on iTunes. Anyone know what I can do to get these songs to play on my iPhone again? Please help!
-
I've found that turning off "snapping" at certain times is just as useful as turning it on are at others. Sure would be useful if there was a key command for toggling this feature on and off. Anyone know if there is such a command? If not, perhaps Ap
-
Splitting 3D model into layers
Hi, I have a 3D model of a boat, created in a program called DelftShip and exported as a .obj file, that i would like to render using Photoshop CS6. However, the .obj file does not include layers, so i get the whole model as one layer in PS. So the w
-
IIII IIII what is causing this?
This is what happens every now and then to my G4 can anyone help? IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII it takes up the entire window. I am not using the key board when it happens.