Corba Help

Zvi <>
Fri Aug 6 13:47:35 CEST 2010


Hi Niclas,

I need a minimal example of using CORBA from Erlang. I.e. simple
"Hello World" stuff using orber application.
Can you give me any pointers / examples?

Thanks in advance.
Zvi

On Aug 5, 3:31 pm, Niclas Eklund <> wrote:
> Hello!
>
> Check out the chapter "6.8 Typecode, Identity and Name Access Functions"
> in Orber's User's Guide:
>
> http://www.erlang.org/doc/apps/orber/ch_idl_to_erlang_mapping.html#id...
>
> The record is defined in a generated hrl-file after you've compiled the
> IDL-file. Remember to include that file.
>
> In fact, you should read all in "6 OMG IDL to Erlang Mapping", since it
> describe step by step how one should do.
>
> The debugging chapter should also be helpfull -http://www.erlang.org/doc/apps/orber/ch_debugging.html
>
> You will probably find the IC backend erl_template rather usefull (will
> generate a complete call-back module). Note, it will overwrite any
> existing version of the *impl.erl file. Read more about it in chapter 6.
>
> If possible you should use Light IFR when compiling the IDL files and
> starting Orber.
>
> Best regards,
>
> Niclas @ Erlang/OTP
>
>
>
> On Thu, 5 Aug 2010, Ali Yakout wrote:
> > 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
> > ________________________________________________________________
> > erlang-questions (at) erlang.org mailing list.
> > Seehttp://www.erlang.org/faq.html
> > To unsubscribe; mailto:
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> Seehttp://www.erlang.org/faq.html
> To unsubscribe; mailto:


More information about the erlang-questions mailing list