pavan aryan

Greenhorn
+ Follow
since Feb 28, 2010
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 pavan aryan

suprita xyz wrote:Please anyone help me....how to use dll in java and how to call .net dll in java



I also got a similar requirement.. kindly let me know if you have figured it out..
7 years ago
some one please help guys...
12 years ago
Hi all once again, one more question from me. But this one stands between me and my final work. I am doing a REST Webservice, in which I have to send image files from the server and had to calculate processing times at the client. So, I choosen InputStream at the server, and same to catch at the Client. Seems some basic problem, I am measuring time before and after InputStream at Client..seems since its a stream as soon as receiving some bytes the program was coming to the next....better to put it in code... REST Web Service and i am using Netbeans 6.8

Server COde



And at the Client Side



So thats the problem ..no matter the size of the image files (trying from 5 mb to 50mb) the processing time is just few milli seconds and almost the same..


tried a bit logic to convert the files



But getting different size files...and if i take the time here, it also includes conversion and saving file locally times....Since its REST and i test with a plane url and its returning same files size ( tried right click and save as )...

Thanks in advance guys,...spent whole night on this..
12 years ago
i fixed my problem..thanks to Ivan for major help. i just got something and opened my complete referene (took time to find it ) and got these two lines of code that fixed the problem..



12 years ago

Ivan Krizsan wrote:Hi!
I am not sure about the cause of your problems, but since you have rather large files, I would suggest another strategy:
- Change the return type of the atttest method to javax.activation.DataHandler.
- Do not read the file into memory, but instead use an instance of FileDataSource like this:

Hope this helps!




thanks Ivan Krizsan for the solution yes it is working i am having problem at client side to store locally. I am gettting the image in bytearray at client side i tried various ways to convert the bytearray to file and store locally..but the file being stored was of different file size ..i am using bytearray.length at the client side and its returning same sizes for small images...i think i am messing at the clien side...sorry for asking again..please show me a solution..the code i have been trying

Server Side


Client side



Thanks in advance,
Kumar.
12 years ago
Sorry for the title. It will be a long story for my error..to be precise. I am doing a cross study between SOAP and REST and their features. Now working on Files..say client request a file from the server and server returns it. To make it more challenging and for load testing i choosen Image files. of sizes 5mb-40mb ( i developed myself using photoshop ) . So for the SOAP not to depend on SAAJ and MTOM, i followed different examples and made a custom code myself.

Coming to here, the server returns an image, i converted image to byte array and returned to client. At the Client i am storing it to files locally..now the problem I am getting files of different sizes from server (dont know problem with serverlogic or client logic). A file of 5 mb from the server , stores as 3.34mb first time and later 900 kb second time and 3.34mb again not the 5 mb. I am Using Net Beans 6.7 and Glass Fish V3 Prelude.

Server Code


Client Side Code



All this i am doing from long time, now at the time i am getting some results.. this was happening. Please Help me guys i am very very close to my deadline.
Looks like some compression is going..not gettign wether at server side or client side :'(

THanks,
Kumar
12 years ago
I am working on a WebService that returns a Image from Server to Client. I followed different examples, and built a service that will reads a file from a URL and writes to a Byte Array.



Now i am looking for a way to read a file from local drive to ByteArray..i tried URL("c:\newimage.png") its not working..tried many ways from File to FileInputStream and BufferedInputStream to convert to bye array..nothing is working. Rest of code works only on ByteArray..i have to figure out a way to store an image from local directory to ByteArray....Please help Friends.

Thanks,
Kumar.


12 years ago
sorry for mispelling your name..i apologize. but really i dont know how to take your reply ...the procedure of downloading it. I realized later that, my dept has blocked downloading attachment since they are doing some tests...yes you can also say this as a story..but thanks for replying and providing me a link and teaching how to download it. i owe you one.
12 years ago
thanks a lot for the replies...IBM link looks promising. @Ian i really not getting that pdf.
12 years ago
First thanks to one and all for this rocking forum...i am spending lot of time these days following different threads. Ok now the business, i was trying to build an webservice with SOAP using SOAP attachment. My goal was to return a file from server to client (say picture in few mega bytes), i tried searching from 2 days all i can found was some tutorials and codes that test the code only in serverside and display at the server using System.out.println. All i want is retun something from server and being displayed at the client. I am running very short on time, thought it will n00bish to ask before searching at all. but now i am paying for that.

Edit: I am looking for pure Web Service methodology , no EJB's Please.

Please help me guys, thanks in advance,

Kumar.
12 years ago
i thought string array will be more effective, so no way of doing with string array.
-pavan.
12 years ago

Hi all,

I am trying to implement @GET variety of REST, the main idea is to return a String with the details of the Customer from Database..



And when i am accessing the resource in IE..with /restserver/gettest it somettimes giving 500 error and some times doing nothing..

the error log at the GlassFish



Help me please guys,
thanks,
Pavan.
12 years ago
yes the more i am getting close to REST, i am liking it more. I did in a way like...sending pictures from server to client. I read the pictures (say like 20mb file size..i developed using photoshop) into a File and returning the file from Server with a simple logic and catching the file using inputstream (bufferedreader) at the client. But by doing this there is a chance of loosing some bytes in transition (then i have to do checksum to verify it). But the SOAP does in different way as an attachment...i am not getting how to implement that in REST..can you help me with few lines of syntax or code, It will be great.

thanks,
Kumar.
12 years ago

i am trying to develop a SOAP webservice, the service will read xml as InputStream from Client..and parse it.

Yes, i am aware of the SOAP mechanism. But i need to develop similar to this for my class project.
example code i am trying


The basic idea is a client will send the XML in the form of InputStream ..the server parses it and stores in a DB. I am getting runtime erros about trouble in creating InputStream initialzing and XML Unmarshall exception

some of the lines from server log


Thanks in Advance,
Pavan.
12 years ago
I am doing a case study for my course, and searching soap attachment equivalent in REST. I dint found any interesting results, can you guide to proper pages.

thanks,
Kumar.
12 years ago