Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Conversion from Java "byte[]" to Dynascript "binary"

2 posts in General Discussion (old) Last posting was on 2000-03-27 21:59:05.0Z
Alberto Serrano Posted on 2000-03-27 19:01:26.0Z
Newsgroups: sybase.public.easerver
Date: Mon, 27 Mar 2000 21:01:26 +0200
From: Alberto Serrano <1775987909#apserrano@bbvnet.com>
Reply-To: Alberto Serrano <apserrano@bbvnet.com>
X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.15pre15 i486)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Conversion from Java "byte[]" to Dynascript "binary"
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 35
NNTP-Posting-Host: 206105.rad.bbv.es 195.53.206.105
Message-ID: <347_38DFB006.483CFCD7@bbvnet.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25597
Article PK: 155670

Hi all,
I have a PB NVO deployed as a Jaguar component.
One of its methods returns a .PSR using the PowerBuilder Blob datatype:
I'd like to embed that report in a dynamo template.

query.stm:
...
<EMBED SRC="psrgen.stm">
...

psrgen.stm:
<!--SCRIPT
// Jaguar component instantiation.
var psrgen = java.CreateComponent("CICRA/PSRGen", ....);
// PSR generation.
var psrblob = psrgen.generate();
// Document generation.
document.contentType = "application/datawindow7";
document.write(psrblob);
....

PowerBuilder IDL generator maps blob type to CORBA's BCD::Binary type,
and Jaguar's stub generator maps that type to Java's byte array. The
problem is that,
from PowerDynamo's point of view, psrblob is a Java object with an
"object" type
which can't be converted to Dynascript "binary" type, so
document.write(psrblob)
outputs "{}" instead of the binary contents.

I've tried to instantiate a Java String using the byte array

str = java.CreateObject("java.lang.String", psrblob);

but the resulting string gets truncated with the first "\0" ocurrence in
the binary blob.

I know that I could save the PSR to a file and change the <EMBED> tag so
that it points
to that PSR file, but I prefer the returned blob approach. Is there any
way to convert
Java's byte array to a Dynascript binary object?

Thanks in advance,
Alberto.


Carson Hager[Team Sybase] Posted on 2000-03-27 21:59:05.0Z
Newsgroups: sybase.public.easerver
From: chager@dyn-data.com (Carson Hager[Team Sybase])
Subject: Re: Conversion from Java "byte[]" to Dynascript "binary"
Date: Mon, 27 Mar 2000 21:59:05 GMT
Organization: Dynamic Data Solutions, Inc.
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 61
NNTP-Posting-Host: charon.lifescape.com 63.86.26.130
Message-ID: <347_38dfd98e.79085538@forums.sybase.com>
References: <347_38DFB006.483CFCD7@bbvnet.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25592
Article PK: 155666

I haven't tried this in a while but the last time I did, it did not
work for the exact reason that you are seeing.


Carson

___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training
http://www.dyn-data.com

DDS is now hiring EAServer consultants
to support its exploding EAServer business!
Please submit your resume to
hr@dyn-data.com!


On Mon, 27 Mar 2000 21:01:26 +0200, Alberto Serrano

<1775987909#apserrano@bbvnet.com> wrote:

> Hi all,
>I have a PB NVO deployed as a Jaguar component.
>One of its methods returns a .PSR using the PowerBuilder Blob datatype:
>I'd like to embed that report in a dynamo template.
>
>query.stm:
>...
><EMBED SRC="psrgen.stm">
>...
>
>psrgen.stm:
><!--SCRIPT
>// Jaguar component instantiation.
>var psrgen = java.CreateComponent("CICRA/PSRGen", ....);
>// PSR generation.
>var psrblob = psrgen.generate();
>// Document generation.
>document.contentType = "application/datawindow7";
>document.write(psrblob);
>....
>
>PowerBuilder IDL generator maps blob type to CORBA's BCD::Binary type,
>and Jaguar's stub generator maps that type to Java's byte array. The
>problem is that,
>from PowerDynamo's point of view, psrblob is a Java object with an
>"object" type
>which can't be converted to Dynascript "binary" type, so
> document.write(psrblob)
>outputs "{}" instead of the binary contents.
>
>I've tried to instantiate a Java String using the byte array
>
>str = java.CreateObject("java.lang.String", psrblob);
>
>but the resulting string gets truncated with the first "\0" ocurrence in
>the binary blob.
>
>I know that I could save the PSR to a file and change the <EMBED> tag so
>that it points
>to that PSR file, but I prefer the returned blob approach. Is there any
>way to convert
>Java's byte array to a Dynascript binary object?
>
>Thanks in advance,
> Alberto.
>
>

___________________________________________________________

Carson Hager
Team Sybase
Dynamic Data Solutions, Inc.
Enterprise Application Studio 3.0 Consulting and Training

DDS Enterprise Application Framework
Available Now as Open Source!
http://www.dyn-data.com