on 12-13-2006 4:57 AM
Hi,
I have a web dynpro application that uses a webservice to upload any Pdf file. The webservice takes the url of the byte code of the pdf file as input as well as filename and url.
For the purpose of sending the byte code to the web service i want to know how to write byte code to the context. How do i go about this?
Thanks
Debashri Prajapati
Write your own custom class that handles the logic and create a context attribute of this java native type ...
This will allow you to hide the inner workings of how to deal with the file handling ( and any other manipulation )
Then you can simply do something like:
wdContext.current<MyElement>().getPDFHandler().<executeMethod>
Regards,
Steven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
File actualfile = new File(<<fileName>>);
FileInputStream fis = null;
byte[] bytes = null;
try{
fis = new FileInputStream(actualfile);
long length = actualfile.length();
bytes = new byte[(int) length];
long bytesRead = fis.read(bytes);
}
You can create a context Attribute of type binary and assign the above byte array to binary.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.