Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Blob as web service parameter
Blob as web service parameter [message #986873] Thu, 22 November 2012 03:22 Go to next message
Thomas VIEL is currently offline Thomas VIEL
Messages: 2
Registered: November 2012
Junior Member
Hello,

I have a dataset which contains a Blob field. I mapped this dataset to a table and now I would like to insert inside another table mapped on a web services dataset. I want to pass the Blob dataSetRow as a parameter to the web service but there is no such type (Blob type), how can i do that ?
My web service method has currently a byte array parameter so I suppose there is a conversion between Blob to byte array but i don't know where..

thanks
Re: Blob as web service parameter [message #987515 is a reply to message #986873] Mon, 26 November 2012 17:54 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you try to base64encode the blob and pass it? Or store the blob in a session object and retrieve it in script in detail report.

importPackage(Packages.org.apache.commons.codec.binary)
var base64blob = Base64.encodeBase64(yourblob.getBytes());

Jason
Re: Blob as web service parameter [message #987890 is a reply to message #987515] Wed, 28 November 2012 09:51 Go to previous messageGo to next message
Thomas VIEL is currently offline Thomas VIEL
Messages: 2
Registered: November 2012
Junior Member
Thanks Jason for your reply,

about your first answer : where can i do this conversion ? I can edit the dataset parameter binding, get my blob as var myBlob = row["myBlob"] but there is no method getBytes. The code I wrote :

importPackage(Packages.org.apache.commons.codec.binary)
var myBlob = row["myBlob"];
var base64blob = Base64.encodeBase64(yourblob.getBytes());

The error :
Cannot find function getBytes in object 25 50 44 46 2D 31 2E 35...

about your second answer : i don't understand, if i store the blob in a session object (i don't really know what that is), what can i pass to my web service ? this object ? which type is it ?

Thanks

Re: Blob as web service parameter [message #988437 is a reply to message #987890] Thu, 29 November 2012 16:42 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Sorry that was my mistake. Did you try:

var base64blob = Base64.encodeBase64(myBlob);

Jason
Previous Topic:Format Report
Next Topic:Report Designer terribly slow in Linux
Goto Forum:
  


Current Time: Wed Jul 30 01:17:08 EDT 2014

Powered by FUDForum. Page generated in 0.09363 seconds