[erlang-questions] Corba Help

Niclas Eklund <>
Tue Aug 17 16:38:49 CEST 2010


Hello!

Depends on if the client you're using complies with wchar encoding 
information in the IOR. But changing the GIOP version to 1.1 should do the 
trick. See the Orber option 'giop_version' and make sure you use 1.1 in 
the corbaloc and/or corbaname string(s).

Best regards,

Niclas @ Erlang/OTP


On Tue, 17 Aug 2010, Ali Yakout wrote:

> Hi,
>
> I faced a problem with the orber while decoding a 4 bytes wchar...
>
>> =ERROR REPORT==== 10-Aug-2010::08:17:16 === =================== Orber
>> ================= [723] cdr_decode:dec_type(4); unsupported wchar
>> ===========================================
>> ** exception throw: {'EXCEPTION',
>> 		                {'DATA_CONVERSION',[],1163001856,'COMPLETED_NO'}}
>> 	in function  corba:raise/1
>
> Any workaround for this problem?
>
> /Ali
>
> -----Original Message-----
> From:  [mailto:] On Behalf Of Niclas Eklund
> Sent: Monday, August 09, 2010 10:31 AM
> To: Zvi
> Cc: 
> Subject: Re: [erlang-questions] Re: Corba Help
>
>
> Hello!
>
> Chapter 6 should take you through the process of creating a service rather easy, but here comes a very slimmed version. Run the example in an empty directory.
>
> %% Compile the attached file (my.idl) using the light_ifr option (reduces the footprints regarding memory usage):
>
>  shell> erlc +"{light_ifr,true}" my.idl
>
> %% Create the call-back module (equivalent to *Impl.java):
>
>  shell> erlc +"{be,erl_template}" my.idl
>
> %% Edit the module my_server_impl.erl
>
> echo(State, Str) ->
>     io:format("~s\n", [Str]), %% Add this line.
>     {reply, ok, State}.
>
> %% Compile
>
>  shell> erlc *.erl
>
> %% "Jump-start" Orber.
>
>  erl> orber:jump_start([{flags,16#80},{iiop_port,2809}]).
>
> %% Register interface in the IFR.
>
>  erl> oe_my:oe_register().
>
> %% Create an object instance.
>
>  erl> Obj = my_server:oe_create([]).
>
> %% Invoke the echo operation.
>
>  erl> my_server:echo(Obj, "It is easy to use CORBA").
> It is easy to use CORBA
>
> To gain access to a server instance, simply stor the object reference in the name service and use the "corbaname" schema from the peer to get hold of it. I.e. the same way you'd do using, for example, a Java server.
>
> Best regards,
>
> Niclas
>
> On Fri, 6 Aug 2010, Zvi wrote:
>
>> 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:
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:
>>
>>
>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>



More information about the erlang-questions mailing list