le taylom

Ranch Hand
+ Follow
since Dec 01, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by le taylom

Hi guys,
Its been a while since i've used these pages, I hope its as good as when I last used them.....
Here's the problem: I am using the following class org.apache.soap.encoding.soapenc.Base64 provided by Apache to do my encoding and decoding. I need to Base64 encode some data as i am then passing it to a SOAP server wrapped in XML. All seems cool, right? Wrong. The code below shows the following steps
1) create Base64 class;
2) read a file on the filesystem into a Byte[] (using a FileInputStream)
3) call the encode method in the Base64 class, passing the byte[];
4) the SOAP function then decodes the data, encrypts it, re-encodes it and then sends it back wrapped in XML
The problem is this, when the SOAP function receives the encoded data it cannot decode for some reason, fails and creates a zero byte file!! I have used a n other 3rd party (online: http://david.carter-tod.com/base64/ ) base64 encoder, encoded some text, put that into file, then repeated the steps above (obviously missing out the encode step) and all worked fine!!!
So, my conclusion is that the base64 encoder I am using is encoding incorrectly. Incorrectly for the SOAP side of things anyway.
My code is below, any thoughts?
I have used 4 different Base64 Encoder classes and all have the same result!
18 years ago
The way I get over the infernal "classpath" issue is to compile and run anything Java related within its own shell. I do not set up system-wide environment parameters for any path or classpath variables. That way I know I exactly which classes I am using and from which jars.
To do this I have a .bat file that I use to set up each and every classpath for each 'project' I am running.
19 years ago
Why don't you try using a child interface of Map, i.e. SortedMap, and use the controls that it gives you on ordering?
19 years ago
Did you download the documentation that comes with the SDK? If so you can view the javadcos that come with the classes. The javadoc is superb with the java sdk and should give you what you are looking for!
go to <br>
19 years ago
A basic example:

The parent and child CAN be in seperate packages ( package is a synonym for directory ) as long as they reference each other correctly and the variables/methods within the parent have the right access privileges.
Try this example out, and post more questions back if needed as i'm not sure if this completely answers your question!
When you compile the above example you will get 2 directories, matt and notmatt. In matt you will get the child and main classes and in notmatt the parent class.
[ November 28, 2002: Message edited by: le taylom ]
19 years ago
Serialization is how you can convert an object into a byte stream, and later deserialze it back into the original object.
Can be useful if you want to write an object to a file, or pass it across the network; or to any type of stream available!
If a class implements the serializable interface then it can be serialized.
19 years ago
Errrmmm, that's a pretty confusing question?!?! If you try and add a little more detail, maybe with some code we can all make a decent attempt at answering it.
19 years ago
Can you do some sort of 'ping' to the server to see if it is still 'up'?
i.e. use an snmp api and do an snmp post on the server. a reply means ok, no reply means down?
Y don't you take a look at the ant site, download ant from there and then read the docs to see some examples of how the build.xml is set up?
It is very intuitive once you have done your first few. Start off with some simple builds first.
You can use javac to compile your ejb source files. Then use something like the ejb compiler (the ant docs show you how to do this) to get your ejb's ready for deployment.

I have to implement some Java codes, which works as a listener, if it gets some information, then it will start/call other java application to handle with the input, and sent to the output, it should be automatically run.

How about JMS?
[Changed [code] tags to

- Jim]
[ January 30, 2002: Message edited by: Jim Yingst ]

20 years ago
I haven't tested this, but I think your message object is null. I think doing a getText on the message previous to sending it may null it.
Many thanks, good answer, it works.
Application servers, i.e. Weblogic, tailor the J2EE spec to their specific implementation. Then they get their App server certified by Sun (which by the way is hugely expensive and is where Sun make money for Java being free
So, you cannot just download J2EE from Sun and run a servlet. You download J2EE and use it to write and compile your servlet, then deploy it to your servlet container (Tomcat) or App server (Weblogic).
Start with J2EE.