Corba Help
Ali Yakout
ali.yakout@REDACTED
Thu Aug 5 14:56:34 CEST 2010
Hi,
I'm new to Corba and I can't find my way through...
I want to do the same operation done with the following Java code:
//-----------------------------------------
org.omg.CORBA.Any any = _orb.create_any();
any.insert_wstring("1.1");
com.lhs.ccb.soi.types.NvElementI namedValue = new com.lhs.ccb.soi.types.NvElementI("CS_CODE", any, 0, (short)0);
NvElementI[] input = new NvElementI[] {namedValue};
NvElementI[] result = execute("CUSTOMERS.SEARCH", input);
//-----------------------------------------
My problem is that I don't know how to create an object of NvElement with the above values.
I have the following types:
%%------------------------------------------
254> com_lhs_ccb_soi_types_NvElementI:tc().
{tk_struct,"IDL:com/lhs/ccb/soi/types/NvElementI:1.0",
"NvElementI",
[{"name",{tk_string,0}},
{"value",tk_any},
{"flags",tk_long},
{"length",tk_short}]}
255> com_lhs_ccb_soi_types_NvElementListI:tc().
{tk_sequence,{tk_struct,"IDL:com/lhs/ccb/soi/types/NvElementI:1.0",
"NvElementI",
[{"name",{tk_string,0}},
{"value",tk_any},
{"flags",tk_long},
{"length",tk_short}]},
0}
%%------------------------------------------
I tried the following but I got 'MARSHAL' exception.
244> AnyStr=any:create(orber_tc:wstring(3),"1.1").
{any,{tk_wstring,3},"1.1"}
245> NV=any:create(com_lhs_ccb_soi_types_NvElementI:tc(),["CS_CODE",AnyStr,0,0]).
{any,{tk_struct,"IDL:com/lhs/ccb/soi/types/NvElementI:1.0",
"NvElementI",
[{"name",{tk_string,0}},
{"value",tk_any},
{"flags",tk_long},
{"length",tk_short}]},
["CS_CODE",{any,{tk_wstring,3},"1.1"},0,0]}
246> com_lhs_ccb_soi_ServiceObjectI:executeI(CMIObj,"CUSTOMERS.SEARCH",[NV]).
** exception throw: {'EXCEPTION',{'MARSHAL',[],1163001856,'COMPLETED_NO'}}
in function corba:raise/1
in call from orber_iiop:request/8
So my question is, how to create Corba types in Erlang?
Thanks,
Ali
More information about the erlang-questions
mailing list