popeye
26th September 2002, 21:08
Hi,
I am currently working on a BOI.
I have changed the standard BOI format.

I am not using structures etc - I don't need it for this BOI.
Reasons for not using Structures:
1. I am using it to insert just 2 fields and there is always only one record.
So it's not worth the overhead of using structures.
2. I am using 2 ref fields for the Errors instead on the Error Structure.

Baan BOI DLL

function extern long ccitmprodtsync.InsertItemSiebelID(domain tcitem hold.item,
domain tcmcs.str15 hold.siebel.id,
long hold.comp,
ref long error.code,
ref string hold.error.message)

Java Client (test)

String Item = new String();
String SiebelId = new String();
int ForCompany = Integer.parseInt(args[0]);
RefInteger ErrorCode = new RefInteger();
RefString ErrorMessage = new RefString();

int ret = pr.InsertItemSiebelID(Item,
SiebelId,
ForCompany,
ErrorCode,
ErrorMessage);
if (ret == 0)
{
System.out.println("ErrorCode : " + ErrorCode + " ErrorMessage = " + ErrorMessage);
}

The System.out.println does not give me a compilation issue.
But it does not print the Error Code / Error Message either.
Instead I get this ...
ErrorCode : com.baan.tech.baanconnection.RefInteger@89 ErrorMessage = com.baan.tech.baanconnection.RefString@82

How do I print these two values?
My Java skills are very limited.
Please advice.
Cheers,
Popeye!

ulrich.fuchs
27th September 2002, 10:33
A Java Object has a method toString() which will be executed if you put it in the System.out.println(). That method should normally be overridden by the developer of the object class to give some meaningful value. If it's not overridden, the default implemention in class Object returns sort of a reference id to the object, and that's what you get printed right now.

I am not familiar with how to call BOIS form java. But you are using two classes,

RefInteger and RefString out of the package com.baan.tech.baanconnection

those classes should normally provide some method of getting there value. You should check out the api for those classes. Probably they are encapsulating just another object (the true value) which you can get by some method like

ErrorCode.getUserObject() or anything like this.

Regards
Uli

(By the way, just because you are a Java beginner and want do things right from the start: it's good Java programming style to start variables with a lowercase letter. Uppercase starting letters indicate a Class name. So better user "errorCode" instead of "ErrorCode")

Jeyaseelan
30th September 2002, 07:03
Hai Pope,
Are u using the BOI based on OW or BCK?
Your approach regarding BOI DLL is perfect. We can write our own methods instead of using generic BOI methods. But I dont think u can skip the usage of structures. Its always best practice to use Structures.

The problem which u face is due to marshalling and unmarshalling of parameters. Did u modifed the proxy components generated by idl_compiler.

Send me your Java proxy components and BOI DLL, I will help you.


Jeyaseelan,
Wipro, Bangalore

popeye
30th September 2002, 20:26
Uli, Jeyaseelan,
Thanks for your replies.

I gave up an created an error structure.
I figured that'll it'll be faster than learning Java :)

Thanks a lot for your help.
Cheers,
Popeye!