File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Sending bytecodes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Sending bytecodes" Watch "Sending bytecodes" New topic

Sending bytecodes

Sandeep Advani
Ranch Hand

Joined: Mar 11, 2004
Posts: 78

I tried sending byte codes to server application (deployed as a Web Service) as a method argument which returned SAXParserException. I believe wrapping up the class file into a String object would require Base64 encoding which I am looking into. My question is whether encoding will the right way or I must try sending byte codes as an attachment? Or something else?

My goal is to load the bytecode on a server which is deployed as a Web Service. This dynamically loaded bytecode will be then invoked from another client.

Any suggestions.

Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Yes, Base64 encoding should be fine -- as long as you remember to decode it in the other end

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sandeep Advani
Ranch Hand

Joined: Mar 11, 2004
Posts: 78
Thanks. Base64 worked fine and .class file is now able to download on the server site. Infact, I am using AXIS where encoding and decoding part is taken care by the underlying system. I just had to specify the argument as XSD_BASE64 and everything was taken care of.

My new problem is I cannot load this .class file and invoke it. I have posted a question at Java in General (Intermediate)

Any suggestions will be highly appreciated !

I agree. Here's the link:
subject: Sending bytecodes
jQuery in Action, 3rd edition