Am working with Orbacus 4.2.x Corba C++, in a Unix environment.
Problem
with this IDL
===============================================
typedef sequence<string> INSequence;
===============================================
in my application am calling a function that uses the INSequence above
as shown below
=======================================================================
if(CORBA::is_nil(Account))
{
LogMessage(str_account + object_not_available_error_message);
return str_error_return_value;
}
// in string parameters
CORBA::String_var sqlAddCrit,bitmap;
//initialise
sqlAddCrit=CORBA::string_dup("");
bitmap=CORBA::string_dup(in_bitmap.c_str());
//out string
CORBA::String_var cmdResult;
//inout string
CORBA::String_var nbstart;
//initialise inout
nbstart=CORBA::string_dup("");
//inout sequence parameters and initialise
inObject::INSequence_var a_cursta = new inObject::INSequence;
a_cursta->length(1);
inObject::INSequence_var a_empty = new inObject::INSequence;
a_empty->length(1);
inObject::INSequence_var a_lock = new inObject::INSequence;
a_lock->length(1);
inObject::INSequence_var a_maxerr = new inObject::INSequence;
a_maxerr->length(1);
inObject::INSequence_var a_scsus = new inObject::INSequence;
a_scsus->length(1);
inObject::INSequence_var b_credcs = new inObject::INSequence;
b_credcs->length(1);
inObject::INSequence_var b_incom = new inObject::INSequence;
b_incom->length(1);
inObject::INSequence_var b_tanac = new inObject::INSequence;
b_tanac->length(1);
inObject::INSequence_var cc_cnt = new inObject::INSequence;
cc_cnt->length(1);
inObject::INSequence_var b_trbon = new inObject::INSequence;
b_trbon->length(1);
inObject::INSequence_var cc_date = new inObject::INSequence;
cc_date->length(1);
inObject::INSequence_var city_loc = new inObject::INSequence;
city_loc->length(1);
inObject::INSequence_var city_nbr = new inObject::INSequence;
city_nbr->length(1);
inObject::INSequence_var credit = new inObject::INSequence;
credit->length(1);
inObject::INSequence_var cs_freec = new inObject::INSequence;
cs_freec->length(1);
inObject::INSequence_var cs_lstd = new inObject::INSequence;
cs_lstd->length(1);
inObject::INSequence_var dynami_f = new inObject::INSequence;
dynami_f->length(1);
inObject::INSequence_var ff_flag = new inObject::INSequence;
ff_flag->length(1);
inObject::INSequence_var ff_group = new inObject::INSequence;
ff_group->length(1);
inObject::INSequence_var gprs = new inObject::INSequence;
gprs->length(1);
inObject::INSequence_var gprs_usr = new inObject::INSequence;
gprs_usr->length(1);
inObject::INSequence_var h_cscred = new inObject::INSequence;
h_cscred->length(1);
inObject::INSequence_var h_cscrep = new inObject::INSequence;
h_cscrep->length(1);
inObject::INSequence_var h_curmon = new inObject::INSequence;
h_curmon->length(1);
inObject::INSequence_var h_raz = new inObject::INSequence;
h_raz->length(1);
inObject::INSequence_var h_refill = new inObject::INSequence;
h_refill->length(1);
inObject::INSequence_var idx_hist = new inObject::INSequence;
idx_hist->length(1);
inObject::INSequence_var imsi = new inObject::INSequence;
imsi->length(1);
inObject::INSequence_var langcur = new inObject::INSequence;
langcur->length(1);
inObject::INSequence_var login = new inObject::INSequence;
login->length(1);
inObject::INSequence_var msisdn = new inObject::INSequence;
msisdn->length(9);
inObject::INSequence_var n_lip = new inObject::INSequence;
n_lip->length(1);
inObject::INSequence_var n_lip2 = new inObject::INSequence;
n_lip2->length(1);
inObject::INSequence_var n_lwlim = new inObject::INSequence;
n_lwlim->length(1);
inObject::INSequence_var n_lwlimc = new inObject::INSequence;
n_lwlimc->length(1);
inObject::INSequence_var n_raz = new inObject::INSequence;
n_raz->length(1);
inObject::INSequence_var n_refill = new inObject::INSequence;
n_refill->length(1);
inObject::INSequence_var n_uplim = new inObject::INSequence;
n_uplim->length(1);
inObject::INSequence_var n_uplimc = new inObject::INSequence;
n_uplimc->length(1);
inObject::INSequence_var next_fee = new inObject::INSequence;
next_fee->length(1);
inObject::INSequence_var nfirst = new inObject::INSequence;
nfirst->length(1);
inObject::INSequence_var nperiod = new inObject::INSequence;
nperiod->length(1);
inObject::INSequence_var number3 = new inObject::INSequence;
number3->length(1);
inObject::INSequence_var op_acdur = new inObject::INSequence;
op_acdur->length(1);
inObject::INSequence_var op_cred = new inObject::INSequence;
op_cred->length(1);
inObject::INSequence_var op_ddate = new inObject::INSequence;
op_ddate->length(1);
inObject::INSequence_var op_undur = new inObject::INSequence;
op_undur->length(1);
inObject::INSequence_var op2acdur = new inObject::INSequence;
op2acdur->length(1);
inObject::INSequence_var op2cred = new inObject::INSequence;
op2cred->length(1);
inObject::INSequence_var op2ddate = new inObject::INSequence;
op2ddate->length(1);
inObject::INSequence_var op2undur = new inObject::INSequence;
op2undur->length(1);
inObject::INSequence_var p_smscpt = new inObject::INSequence;
p_smscpt->length(1);
inObject::INSequence_var p_useend = new inObject::INSequence;
p_useend->length(1);
inObject::INSequence_var pin_f = new inObject::INSequence;
pin_f->length(1);
inObject::INSequence_var pin_nbr = new inObject::INSequence;
pin_nbr->length(1);
inObject::INSequence_var profile = new inObject::INSequence;
profile->length(1);
inObject::INSequence_var r_smscpt = new inObject::INSequence;
r_smscpt->length(1);
inObject::INSequence_var r_useend = new inObject::INSequence;
r_useend->length(1);
inObject::INSequence_var rateplan = new inObject::INSequence;
rateplan->length(1);
inObject::INSequence_var refill_e = new inObject::INSequence;
refill_e->length(1);
inObject::INSequence_var s_smscpt = new inObject::INSequence;
s_smscpt->length(1);
inObject::INSequence_var s_smsend = new inObject::INSequence;
s_smsend->length(1);
inObject::INSequence_var static_f = new inObject::INSequence;
static_f->length(1);
inObject::INSequence_var tac = new inObject::INSequence;
tac->length(1);
inObject::INSequence_var tb1 = new inObject::INSequence;
tb1->length(1);
inObject::INSequence_var tb2 = new inObject::INSequence;
tb2->length(1);
inObject::INSequence_var tbe = new inObject::INSequence;
tbe->length(1);
inObject::INSequence_var tcfaxda = new inObject::INSequence;
tcfaxda->length(1);
inObject::INSequence_var tend = new inObject::INSequence;
tend->length(1);
inObject::INSequence_var tmc = new inObject::INSequence;
tmc->length(1);
inObject::INSequence_var toterr = new inObject::INSequence;
toterr->length(1);
inObject::INSequence_var tr = new inObject::INSequence;
tr->length(1);
//out sequence parameters
inObject::INSequence_var rema_fee;
//allocate msisdn
msisdn[0] = CORBA::string_dup(in_msisdn.c_str());
cout<<"Length of msisdn string: "<< msisdn->length()<<"Value:
"<<msisdn[0]<<endl;
a_cursta[0] = CORBA::string_dup("");
a_empty[0] = CORBA::string_dup("");
a_lock[0] = CORBA::string_dup("");
a_maxerr[0] = CORBA::string_dup("");
a_scsus[0] = CORBA::string_dup("");
b_credcs[0] = CORBA::string_dup("");
b_incom[0] = CORBA::string_dup("");
b_tanac[0] = CORBA::string_dup("");
cc_cnt[0] = CORBA::string_dup("");
b_trbon[0] = CORBA::string_dup("");
cc_date[0] = CORBA::string_dup("");
city_loc[0] = CORBA::string_dup("");
city_nbr[0] = CORBA::string_dup("");
credit[0] = CORBA::string_dup("");
cs_freec[0] = CORBA::string_dup("");
cs_lstd[0] = CORBA::string_dup("");
dynami_f[0] = CORBA::string_dup("");
ff_flag[0] = CORBA::string_dup("");
ff_group[0] = CORBA::string_dup("");
gprs[0] = CORBA::string_dup("");
gprs_usr[0] = CORBA::string_dup("");
h_cscred[0] = CORBA::string_dup("");
h_cscrep[0] = CORBA::string_dup("");
h_curmon[0] = CORBA::string_dup("");
h_raz[0] = CORBA::string_dup("");
h_refill[0] = CORBA::string_dup("");
idx_hist[0] = CORBA::string_dup("");
imsi[0] = CORBA::string_dup("");
langcur[0] = CORBA::string_dup("");
login[0] = CORBA::string_dup("");
n_lip[0] = CORBA::string_dup("");
n_lip2[0] = CORBA::string_dup("");
n_lwlim[0] = CORBA::string_dup("");
n_lwlimc[0] = CORBA::string_dup("");
n_raz[0] = CORBA::string_dup("");
n_refill[0] = CORBA::string_dup("");
n_uplim[0] = CORBA::string_dup("");
n_uplimc[0] = CORBA::string_dup("");
next_fee[0] = CORBA::string_dup("");
nfirst[0] = CORBA::string_dup("");
nperiod[0] = CORBA::string_dup("");
number3[0] = CORBA::string_dup("");
op_acdur[0] = CORBA::string_dup("");
op_cred[0] = CORBA::string_dup("");
op_ddate[0] = CORBA::string_dup("");
op_undur[0] = CORBA::string_dup("");
op2acdur[0] = CORBA::string_dup("");
op2cred[0] = CORBA::string_dup("");
op2ddate[0] = CORBA::string_dup("");
op2undur[0] = CORBA::string_dup("");
p_smscpt[0] = CORBA::string_dup("");
p_useend[0] = CORBA::string_dup("");
pin_f[0] = CORBA::string_dup("");
pin_nbr[0] = CORBA::string_dup("");
profile[0] = CORBA::string_dup("");
r_smscpt[0] = CORBA::string_dup("");
r_useend[0] = CORBA::string_dup("");
rateplan[0] = CORBA::string_dup("");
refill_e[0] = CORBA::string_dup("");
s_smscpt[0] = CORBA::string_dup("");
s_smsend[0] = CORBA::string_dup("");
static_f[0] = CORBA::string_dup("");
tac[0] = CORBA::string_dup("");
tb1[0] = CORBA::string_dup("");
tb2[0] = CORBA::string_dup("");
tbe[0] = CORBA::string_dup("");
tcfaxda[0] = CORBA::string_dup("");
tend[0] = CORBA::string_dup("");
tmc[0] = CORBA::string_dup("");
toterr[0] = CORBA::string_dup("");
tr[0] = CORBA::string_dup("");
try
{
err.type = (constsOfRetValues)Account->list( a_cursta, a_empty,
a_lock, a_maxerr, a_scsus, b_credcs, b_incom, b_tanac, b_trbon,
cc_cnt, cc_date, city_loc, city_nbr, credit, cs_freec, cs_lstd,
dynami_f, ff_flag, ff_group, gprs, gprs_usr, h_cscred, h_cscrep,
h_curmon, h_raz, h_refill, idx_hist, imsi, langcur, login,
msisdn.inout(), n_lip, n_lip2, n_lwlim, n_lwlimc, n_raz, n_refill,
n_uplim, n_uplimc, next_fee, nfirst, nperiod, number3, op_acdur,
op_cred, op_ddate, op_undur, op2acdur, op2cred, op2ddate, op2undur,
p_smscpt, p_useend, pin_f, pin_nbr, profile, r_smscpt, r_useend,
rateplan, refill_e, rema_fee.out(), s_smscpt, s_smsend, static_f, tac,
tb1, tb2, tbe, tcfaxda, tend, tmc, toterr, tr, cmdResult,
nbstart,sqlAddCrit, bitmap);
err.descr = cmdResult;
cout<<"Error Returned: "<<err.type<<" Description: "<<err.descr
<<endl;
cout<<"length of msisdn string: "<<
msisdn->length()<<endl;
if(err.type != RES_OK)
{
LogMessage(err);
return str_error_return_value;
}
=======================================================================
Problem:
=======================================================================
I do not get any results from the above piece of code. Am wondering
whether the way am initializing and passing my inout sequence is
right? if not please assist
Enos
However am open to other options,
Some one has suggested that my aproach is ok, how can I be sure that am
doing it the right way, coz am not getting any results from the server.
If you could provide some code examples of another approach, i will
appreciate.
Thanks
"Smudge" <mu...@7northfield.com> wrote in message news:<1108037119....@o13g2000cwo.googlegroups.com>...