Ste Lamb

Greenhorn
+ Follow
since Feb 05, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ste Lamb

Brian,
Thanks for your response and sorry for losing you!
The situation is as follows:
I have an HTML page which may be displayed in a HTML application (hta) or displayed on its own as a flat page. Within this page is embedded a java applet.
I want to run this page from a CD, within a HTML application. When I run it from within a normal browser (Internet Explorer), the page displays fine and the applet starts up ok. However, when I run the page within its own HTML application the applet refuses to start and basically crashes the application.
What makes it more confusing is this behaviour is intermittant depending on the machine.
Could this be a problem with the JVM?
Thanks for any help...
20 years ago
I have an HTML page with an embedded Java applet. I want to be able to package this up into an HTML application, place it on a CD and send out to users. Is it possible to run an applet from an HTA on a CD?
Currently, the applet just sits there gray and does nothing (the rest of the page loads up fine). However, when I run the html page from the CD in a browser, the applet works just fine.
Any ideas are much appreciated - even if its just to say this isn't possible at all.
Cheers
20 years ago
Bear thanks for your response.
I had finally worked it out using the method you suggest - although I'm requesting the info from another JSP. How would I reference a servlet directly?
Thanks for your response though, it doesn't seem to be documented anywhere that this is the way to do it.. altohugh more likely I was searching in the wrong place!
20 years ago
JSP
This is probably very easy to do but I can't find a way to do it.
I have some information displayed on a JSP which I want to save to a simple text file.
On selecting a button I want it bring up the "save as" dialog where the user can decide where to save the file to on their local machine. I can create the file and put data into it in Java, but I can't work out how to bring up the save as dialog from the JSP.
Any help much appreciated! Also any good resources for this sort of thing would also be appreciated.
20 years ago
JSP
Using the stateful web-service wasn't my method of choice but I couldn't find a way around the problem. Basically I have to talk to a stateful bean thorugh a SOAP connection. I am using the Oracle SOAP methods and this does not allow you to talk to a stateful bean directly using SOAP. Hence I have had to put a simple class in between the client and bean.
My experience isn't such that I could find a better way to do this.... given time restrictions etc..(isn't that always the way???). Suggestions on a better way would be much appreciated for future reference.
Also, why is a stateful web-service such a bad idea? Surely if its correctly managed its not a problem...
Thanks for your advice I'll look into the JAX-RPC specification...
Ste
21 years ago
Hello again...
I'm currently using JDeveloper and Oracle9iAS. I have an applet which calls a stateful EJB via a web-service (stateful class).
When creating the SOAP calls a session ID is sent as part of the calls - does anyone know of a way to access this session ID? I've found getters and setters for the session ID in the Oracle documentation but there doesn't seem to be a way to use this given the only link I have with the session is the HTTP connection.
No doubt I'm missing something obvious as usual but any help much appreciated.
Thanks
Ste
21 years ago
hi Kyle/William
I tried a different method using HTTP Post to get the file across and was coming up with a similar problem. This time I converted the file to a byte array before sending it. Unfotunately the same error was happening.
I resolved this problem by taking on board what you suggested Kyle which was to encode the byte array to base64 before sending it. And it worked!
I suspect but haven't tried yet that this is the same problem that is happening with the JAXM SOAP connection. When I've tried it I'll let you know.
Its strange that this isn't documented anywhere. I would have thought it encodes it automatically for you?
I guess though that most of this sort of thing is done direct from a JSP which encodes it automatically???
Thanks for your help...
21 years ago
Hi Kyle
not exactly certain of what you mean, but below is the actual dump stack I get. If it isn't encoding it like you say, how do I go about encoding it? Alternatively how about I write the file to a byte array and attach that? Would that work.. although how to write a whole file to an an array I'm not sure...
Any advice appreciated...
Thanks Kyle

java.net.SocketException: Unexpected end of file from server
boolean sun.net.www.http.HttpClient.parseHTTPHeader(sun.net.www.MessageHeader, sun.net.ProgressEntry)
HttpClient.java:708
boolean sun.net.www.http.HttpClient.parseHTTP(sun.net.www.MessageHeader, sun.net.ProgressEntry)
HttpClient.java:613
boolean sun.net.www.http.HttpClient.parseHTTPHeader(sun.net.www.MessageHeader, sun.net.ProgressEntry)
HttpClient.java:706
boolean sun.net.www.http.HttpClient.parseHTTP(sun.net.www.MessageHeader, sun.net.ProgressEntry)
HttpClient.java:613
java.io.InputStream sun.net.www.protocol.http.HttpURLConnection.getInputStream()
HttpURLConnection.java:506
int java.net.HttpURLConnection.getResponseCode()
HttpURLConnection.java:230
javax.xml.soap.SOAPMessage com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(javax.xml.soap.SOAPMessage, java.net.URL)
HttpSOAPConnection.java:274
java.lang.Object com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run()
HttpSOAPConnection.java:142
java.lang.Object java.security.AccessController.doPrivileged(java.security.PrivilegedExceptionAction)
native code
javax.xml.soap.SOAPMessage com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(javax.xml.soap.SOAPMessage, java.lang.Object)
HttpSOAPConnection.java:115
boolean uk.gov.pro.arc.ClientInterfaces.LoadProcess.loadFiles()
LoadProcess.java:509
void uk.gov.pro.arc.ClientInterfaces.TestclientInterfaces.main(java.lang.String[])
TestclientInterfaces.java:81
java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed
javax.xml.soap.SOAPMessage com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(javax.xml.soap.SOAPMessage, java.net.URL)
HttpSOAPConnection.java:289
java.lang.Object com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run()
HttpSOAPConnection.java:142
java.lang.Object java.security.AccessController.doPrivileged(java.security.PrivilegedExceptionAction)
native code
javax.xml.soap.SOAPMessage com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(javax.xml.soap.SOAPMessage, java.lang.Object)
HttpSOAPConnection.java:115
boolean uk.gov.pro.arc.ClientInterfaces.LoadProcess.loadFiles()
LoadProcess.java:509
void uk.gov.pro.arc.ClientInterfaces.TestclientInterfaces.main(java.lang.String[])
TestclientInterfaces.java:81
javax.xml.soap.SOAPException: java.security.PrivilegedActionException <<javax.xml.soap.SOAPException: Message send failed>>
javax.xml.soap.SOAPMessage com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(javax.xml.soap.SOAPMessage, java.lang.Object)
HttpSOAPConnection.java:121
boolean uk.gov.pro.arc.ClientInterfaces.LoadProcess.loadFiles()
LoadProcess.java:509
void uk.gov.pro.arc.ClientInterfaces.TestclientInterfaces.main(java.lang.String[])
TestclientInterfaces.java:81
21 years ago
I am trying to pass different files using a SOAP with attachments (JAXM). It works fine for an xml file as the attchment (for example) but any other type of file is causing the following error:
"java.net.SocketException: Unexpected end of file from server"
The code I am using to pass create the attachment is:
File outputFile = new File("C:/myfile.bmp");
//Build the call:-
//Get a connection
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection connSOAP = scf.createConnection();
//Create a message
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
//Access the elements of the message
SOAPPart part = msg.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
SOAPHeader header = envelope.getHeader();
SOAPBody body = envelope.getBody();
//Add a new SOAP element
Name name = envelope.createName("loadFile");
SOAPElement child = body.addBodyElement(name);
//Add content
name = envelope.createName("filename");
SOAPElement filename = child.addChildElement(name);
filename.addTextNode(outputFile.getAbsolutePath());
//Add attachment
URL fileurl = outputFile.toURL();
DataHandler dh = new DataHandler(fileurl);

AttachmentPart attachment = msg.createAttachmentPart(dh);
attachment.setContentId("test_file");

msg.addAttachmentPart(attachment);

Any ideas as to where I'm going wrong? Or is this a known bug?
Any help, very much appreciated.
Cheers
Ste
21 years ago
Hello...
I want to invoke a servlet from a java class which will allow me to upload files onto the server. Firstly is this possible? If so, can anyone ponit me in the direction of where to start looking as currently I seem to be going around in circles... Any help much appreciated.
Steve
21 years ago
Hi
A useful site I found for web services was:
http://otn.oracle.com/tech/webservices/htdocs/series/statefuljava/content.html
There are a whole series of publishing diffrent types of web services (stateful/stateless/class/EJB). They are for using JDeveloper in particualr but if you're not using that they may give you a start..
Hope this helps
Ste
21 years ago
Cheers folks...
Am now busily trying to deploy on the embedded OC4J server on JDeveloper to test it. I think this will enable to test my client/server application.
The fact you can do that you can do this doesn't seem to be documented anywhere... or am I missing something.
But anyway thanks for your help.
Many thanks...
I guess I was hoping for too much to assume it would automatically be handled for me... cheers for your help.
Also, Yes it is a stateful bean. I've been looking for a good example on how to implement/test the EJB I've written. I'm using JDeveloper, is there an easy way to test or do I have to deploy in order to test the functionality?
Hi all,
I have a client-server app. where I copy a number of files from the client onto the server and then do some checks on the files. The server side is written as an EJB.
Whilst these checks are ongoing on the server, if for whatever reason the connection is lost between client and server, how do I ensure that I don't get a load of files left on the server?
Will using a session bean take care of deleting the files if the system goes down? If not can anyone point me in the direction of how to handle this situation. (I would have thought that this is a common situation...)
Any help much appreciated.
Cheers
Ste