Insertion of user defined structure in CORBA ANY

I am using JDK 1.4.2 CORBA (ORB) APIs.
I am using CORBA Any in my application. I am able to insert primitive values like short, long, char, etc. into the Any using the specified APIs. But if I try to insert a user defined structure, I get an exception.
This can be explained further by the code below:
Consider the following IDL definition:
// IDL
struct Foo {
string bar;
float number;
interface Flexible {
void doit (in any a);
Now in order to pass the structure Foo in Any, I use the following code snippet:
// Java
// Client.java,
import org.omg.CORBA.*;
Flexible fRef;
Any param = ORB.init().create_any();
Foo toPass = new Foo();
toPass.bar = "Bar";
toPass.number = (float) 34.5;
try {
fRef = FlexibleHelper.bind("anyMarker:anyServer", hostname);
fooHelper.insert (param, toPass);
fref.doit (param);
catch (Exception e) {
But I get an exception when I use the above mentioned methodology.
What is that I am doing wrong.
Or is there some known issue with Sun Java ORB.

I just noticed that these files appear to be under copyright. My first question is do you have the copyright permissions to post them in a public forum? If not then you may wish to delete them. That being said I have examined the code and it seems easy enough to work around your issues (provided you have the copyright permissions). The way to work around the issues is indeed to replace the struct fields with variables. This will of course require you to change a couple function definitions to input and output the neccesary variables which I believe was at most 5 variables. You will also need to redo the error checking code that uses a cell array. Altogether I estimate about 30 minutes of work. I would have given you the work around in these files had the files not been copyrighted. So, unfortunately, you will have to implement the work around yourself.
Good luck!
K Scott

Similar Messages

  • How to Insert a User Defined Column with CheckBox In ADF Swings

    I have create JTable by dragging a view object from Data Control Palette .But apart from columns listed in JTable i need to insert a User Defined column with Check Box selection option in each row .
    Can any one help me out to sort the problem.
    Regards
    Bhanu Prakash
    Message was edited by:
    user579125

    I retrieve 10 column from Database and build JTable. But apart from 10 column displayed i need to display one more column( User Defined) at run time with the check box option for each row . Because on select of corresponding check box i need to do some mathematical calculation. add also How do i know whether check box is selected or not.
    Regards
    Bhanu Prakash

  • Insert to User Defined Table

    Guys.. How can i insert my data to my user defined table (Master Document), i have write code:
    Set oUserTable = oCompany.UserTables.Item("TR_MD_FAKPAJAK")
    oUserTable.Code = "1"
    oUserTable.Name = "TORO"
    oUserTable.UserFields("U_field1").Value = "toro"
    oUserTable.UserFields("U_field2").Value = "toro"
    oUserTable.UserFields("U_field3").Value = "toro"
    oUserTable.UserFields("U_field4").Value = "toro"
    oUserTable.UserFields("U_field5").Value = "toro"
    Dim retval As Long
    retval = oUserTable.Add
    If retval <> 0 Then
        oCompany.GetLastError lErrCode, sErrMsg
        MsgBox lErrCode & " " & sErrMsg
    Else
        MsgBox "Masuk"
    End If
    my question is, when i run always display error "-4002 To Generate This Document, first defined the numbering series in Administration Module",
    any idea guys ??
    Thx

    Hi Ria,
    Unfortunately you cannot insert data in to a UDO table using the DI API (by marking your table as a 'Master Document' table you have made your UDT part of a UDO). It is one of the current limitations with working with UDOs. All data must be entered through the UI (ie manually).
    If you just want to store data in a UDT then it is best to create the table as 'No object'. You can then use the DI API to read and write data to your table. However, you do lose the UDO functionality (eg no automatic saving or searching etc).
    Kind Regards,
    Owen

  • Smartforms (User defined structure in a priver program in smartform)

    I am declaring my own structure in the driver program.
    How can i call this structure into my smartform?
    Ex: types: begin of ty_stud,
                       field1,
                       field2,
                       end of ty_stud.
    i want to use this structure in my smartform.
    is it possiable? If yes, who please explain me.
    Thanks,
    Raj

    I am invoking a servlet from a java program. Some
    data is being sent to the servlet. I want to
    manipulate that data in servlet. The data sent from
    java program is received in doGet(). Now to
    manipulate the data can I write member functions
    inside a class within the servlet, create an object
    of that class and invoke the mem Funcs ?Have that class outside the servlet. You can also store the object by binding it to a scope and reuse it within a jsp.
    ram.

  • How do i make a array of user defined structure and creat a pointer for the same

    Function
    The prototype of the dll function is
    unsigned long PassThruIoctl(unsigned long A, unsigned long B, void *pvar1, void *pvar2);
    "void *pvar1" and "void *pvar2" are pointers to different Structures. The value of  "unsigned long B" will determine what kind of Structure the pointer will represent.
    One sample structure is given below when pvar1 is the pointer to SCONFIG_LIST.
    typedef struct
          unsigned long ParameterID;    // this an input to the dll
          unsigned long Value;          // this is an output from dll
    } SCONFIG;
    typedef struct
          unsigned long NumOfParams;    // the no. of elements(SCONFIG) in array
    (input)
          SCONFIG *ConfigPtr;           // the pointer to array of SCONFIG
    (input)
    } SCONFIG_LIST;
    The function is supposed to get the values of configuration parameters (from an external interfacing device).
    When I tried to run the function as shown in the attached VI, I always end up with error. The error I get is saying something about DLL corrupting the memory of Lab View.
    Solved!
    Go to Solution.

    What will be the structure for pVar2?
    One issue that I can see in you code is, for pvar1 instead of passing an array of clusters, you are passing a cluster of SCONFIG. Also you need to initialize the numbr of elements in the array before passing it to the DLL (see attached code). In this I have assumed that pVar2 is also expecting a similar input.
    I was not able to run the code here becasue the dll is not there. So please try and let me know.
    "A VI inside a Class is worth hundreds in the bush"
    യവന്‍ പുലിയാണു കേട്ടാ!!!
    Attachments:
    GETCONFIG_2.vi ‏9 KB

  • User defined field insertion problem in Stock Taking Report (PLD)

    We are creating one PLD for one of our customer for Stock Taking Report by modifying the existing sytem report. We will insert two user defined fields (Rack & Bin) from OITW table and link these with the warehouse code field which is at report header as there are different warehouse for the item and material is kept in different rank and bin in different warehouse. But after inserting these fields we found that repetative area becomes blank in the report.
    So please let us know how to overcome this problem.
    Thanks & with regards.
    Aloke
    Edited by: ALOKE BANDYOPADHYAY on Sep 4, 2010 4:42 PM

    Hi Aloke,
    This PLD is one of the hard coded PLD. You are not able to add UDF freely. I believe you may only add UDF from OITM table. Try you own report instead.
    Thanks,
    Gordon

  • How can I enter user defined info into a seq file

    I would like to insert some user defined information that I can extract either viac C-code (step invoked) or from the Operator Interface once the seq file has been loaded into memory.

    Hi hurst,
    You probably want to create a dialog panel that will allow the user to enter the information.
    Where you store this information really depends on how much of the sequencefile needs to have access to this information.
    If its global then writing it to either StationGlobals or to FileGlobals. Writting to StationGlobals means it going to be available after the execution of your sequencefile has finished. Writing to FileGlobals means its only going to be available during the execution of your sequencefile and also only in scope for the sequencefile its contained in. Unless you change the default setting so that all sequencefiles use the same FileGlobals.
    To get the information to the SequenceFile will be by TestStand API calls using the PropertySetValue.
    Another way would be to use the propertyloader.
    There are plenty of examples either with TestStand or on the NI website on transferring data of all types from a step during execution.
    This is a bit general. Maybe if you can expand on your query.
    hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Restricting User-Defined Layout in CV04N

    Hi All
    A user having cv04n authorization can change the layout and save as User-Specific Layout. We may be giving various information via CHARS / Values and users add those to layouts and see
    Now a User who do not have Authorization to a Document type , say FIN (for Finance) , can get the details in the CHARS and Values of FIN Document Type using cv04n, by modifying the standard layout.
    Any Authorization to control user not to change layouts in cv04n...?
    I have found one Authorization S_ALV_LAYO which restricts to make Global layout, but it allows to make User Defined layouts..
    Any solutions to restrict User not to modify default layout in cv04n?? Or in way can we restrict User not to add CHAR s into search layouts?
    Regards
    Aby

    Hi Aby,
    We can restrict the user from viewing the documents based on document type and authorization group. This can be achieved by implementing BADI  "DOCUMENT_SEARCH01" and interface "CHANGE_SEARCH_ORDER". Inside this we can do an authority check on each document (DOKAR), using standard authorization object for document type C_DRAW_TCD. And similarly authorization group (BEGRU) can be checked using auth obj C_DRAW_BGR can be checked.
    The authority check can be done in following way,
    LOOP AT EACH DOC.
        AUTHORITY-CHECK OBJECT 'C_DRAW_TCD'
             ID 'DOKAR' FIELD LV_DOKAR                              " LV_DOKAR is doc no.
             ID 'ACTVT' FIELD '03'.                                           " 03 is display mode
    Similarly check for auth grp.
    Hope this will help you. If you need any more inputs let me know.

  • User-defined tagged structures in Documents

    Hi, here's my situation. I'm trying to build an interface for users to create, edit, and view information that is marked up with two types of tags. The first type is structural and function pretty much identically to XML tags. Not a problem, really, if that's all I wanted. However, the second type of tags are structure-independent (i.e. can start and end anywhere) and thus don't work as part of an XML document.
    Here's an example:
    <Start>
    Starting here...
    <1>Hey, this is <A id = "blue">pretty </1>
    <2>cool</A id = "blue"></2>
    </Start>
    the "Start" and "1" tags are the structure tags and the "A" is what I call a floating tag. My plan is to have the user perform various operations on both sets of tags, such as adding of deleting them, moving the start or end, swapping between various stored content, etc.
    Anyway, I've been banging my head against the wall trying to integrate this with the StyledDocument interface, hopefully by slightly extended the DefaultStyledDocument class. I oculd run the whole thing with Positions and insertString() and delete()'s, but I feel as if there should be something that I can hook in with that let's me do this.
    I've been hoping that the Element interface would be my savior here, but that seems to be getting further and further from happening the more I screw around with it.
    Anyway, if you've gotten this far, thanks for your time and interest. Here are my questions:
    1) Is there any way to implement the Element interface and then insert my classes into a DefaultStyledDocument?
    2) Is there anyway of using the createBranchElement and createLeafElement from AbstractDocument to insert Elements into an already filled Document?
    3) When using the ElementSpec methods of inserting Elements, is there any way of getting the created Elements a la the createXXXElement methods from AbstractElement?
    4) After I get an Element in a Document, is there any simple way of getting it a reference to it based on position in the Document? Also, is there a programmatic way of removing it from the Document?
    5) Am I totally on the wrong track here? Is there some really easy way of pulling this off that I'm just overlooking?
    Again, thanks for your time,
    Steve Erdman

    Hi Jack,
    Here they hav explained clearly pls go through the link below USER DEFINED INCLUDE STRUCTURES
    http://www.michaelmanagement.com/forum/uploads/20070621_164819_OSS_335065_-_Us.pdf
    Datasourceenhancement
    Below are the steps to enhace a data source.
    log on to r/3
    1..R/3sys, enter RSA7, SELECT UR DS(0FI_GL_4), SELECT DISPLAY ENTRIES,
    2.Select Delta Update and Execute.
    3.now u can see the records if at all they r available.
    4.Now Check The Data in u2018smq1u2019 in R/3 and Execute.
    5.Select ur Data source now.
    6.Display Entries.
    if at all any entries are there it display in the form of queues
    if u find any where data , it must be scheduled to ur data target using Info packages.
    Now let us see How to Enhance the Data source.
    7.R/3, Enter RSA6., select ur Data source, then Click on enhance extract structure.
    8. Now it populates a structure name. Like this u201CZADTFIGL_4u201D. Go with continue
    9.Give the Description.
    10. Under Component Give the Description of the fields u want to add Starting with ZZ
    11. Under component type give the concerned Technical names OF RELEVANT FIELDS in r/3. AND u201CENTERu201D
    12. SAVE
    13.Give The Package go with save, request no go with continue.(or create a new request)
    14. Now check and activate.
    15. go back from current screen select ds and go with change. Message continue, Request no continue
    16.now find ur newly added fields in ds, deselect hide flag and field only flag(check box)
    17. So far u have added field to ur DS, now u need to populate Data to UR Newly Added fields by writing user exit.
    Enter CMOD in R/3, give the project name , go with Create.
    18. Give the Description and Save
    log on to bw , rsa1-source systems, find ur ds replicate ds
    Now Devolope Required fields in Bw
    Add to ur communication structure,
    apply the Transfer rules ,
    Add to ur Target
    Recreate Update rules.
    Schedule the data..
    Regards,
    Marasa.

  • ORA-22979: cannot INSERT object view REF or user-defined REF

    I'm getting this error when trying to insert a parent_type object into an object table. The parent object contains a nested table of parent object references.
    CREATE TYPE cl_ArgList AS TABLE OF REF cl_Expression
    CREATE TYPE cl_Expression AS OBJECT (
    args cl_ArgList;
    Somehow the system-generated parent object REF that is returned from one STATIC function (using MAKE_REF) turns into a incompatible REF by the time it is passed to aother STATIC function and used in the constructor of the nested table for a new args instance.
    Does anybody know how this might be happening?
    Is there any way to test if a REF is a valid system-generated REF vs. a user-defined REF?
    I don't even know what a user-defined REF is, how I might be getting one, and what's wrong with it anyway. Shouldn't strong-typing ensure that the REF is okay if it is of the appropriate type?
    Glenn.

    Okay, solved that.
    FYI the problem is that the nested table arguments (REF cl_Expression) have to be SCOPED REFs, ie. constrained to refer only to objects in a particular table (although I don't really understand why).
    Then of course the trick is how to constrain the arguments in the nested table, because you can't do it in the CREATE TYPE statement. You also can't do it when you create the containing table, when you define how the nested table is stored:
    CREATE TABLE <containing table> OF cl_Expression (
    NESTED TABLE args STORE AS t_args
    Instead you have to modify the nested table properties after it has been created:
    ALTER TABLE t_args ADD (SCOPE FOR (column_value) IS t_Induhvidual);
    'column_value' is the actual syntax, not your own column name.
    But you probably knew that ;-)

  • User-defined include structures in FI

    Hi all,
    Can any body explain me about user-defined include structures in FI and how to do the enhancements..Plz suggest me by explaining with ABAP code. Plz tell me step by step.
    Thanks,
    Jack

    Hi Jack,
    Here they hav explained clearly pls go through the link below USER DEFINED INCLUDE STRUCTURES
    http://www.michaelmanagement.com/forum/uploads/20070621_164819_OSS_335065_-_Us.pdf
    Datasourceenhancement
    Below are the steps to enhace a data source.
    log on to r/3
    1..R/3sys, enter RSA7, SELECT UR DS(0FI_GL_4), SELECT DISPLAY ENTRIES,
    2.Select Delta Update and Execute.
    3.now u can see the records if at all they r available.
    4.Now Check The Data in u2018smq1u2019 in R/3 and Execute.
    5.Select ur Data source now.
    6.Display Entries.
    if at all any entries are there it display in the form of queues
    if u find any where data , it must be scheduled to ur data target using Info packages.
    Now let us see How to Enhance the Data source.
    7.R/3, Enter RSA6., select ur Data source, then Click on enhance extract structure.
    8. Now it populates a structure name. Like this u201CZADTFIGL_4u201D. Go with continue
    9.Give the Description.
    10. Under Component Give the Description of the fields u want to add Starting with ZZ
    11. Under component type give the concerned Technical names OF RELEVANT FIELDS in r/3. AND u201CENTERu201D
    12. SAVE
    13.Give The Package go with save, request no go with continue.(or create a new request)
    14. Now check and activate.
    15. go back from current screen select ds and go with change. Message continue, Request no continue
    16.now find ur newly added fields in ds, deselect hide flag and field only flag(check box)
    17. So far u have added field to ur DS, now u need to populate Data to UR Newly Added fields by writing user exit.
    Enter CMOD in R/3, give the project name , go with Create.
    18. Give the Description and Save
    log on to bw , rsa1-source systems, find ur ds replicate ds
    Now Devolope Required fields in Bw
    Add to ur communication structure,
    apply the Transfer rules ,
    Add to ur Target
    Recreate Update rules.
    Schedule the data..
    Regards,
    Marasa.

  • How to insert records in user defined tables through DI Server API

    Hi All,
    I have created a UDO using some userdefined tables .I am able to insert records in the user defined tables using DI API but problem is that now I want to insert records in those tables using DI Server API but I dont know how to do that please give me some way to do that
    Thanks and Regards
    Utpal

    The AddObject message is :
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
      <env:Header>
        <SessionID>...</SessionID>
      </env:Header>
      <env:Body>
        <dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">
          <BOM>
            <BO>
              <AdmInfo>
                <Object>...</Object>
              </AdmInfo>
            </BO>
          </BOM>
        </dis:AddObject>
      </env:Body>
    </env:Envelope>
    How to use it with a user defined table ?

  • Java user-defined function for mapping a complex structure

    All,
    Hope one of you can help me with this. I have a structure with over 15 fields and would like to concatenate all the fields into one target field and while I do this, I need to ensure that each field is padded with blanks as defined the data type. Can one of tell me if this is possible with a java user-defined function and if so, what type of logic is needed.
    Input_MT
    Field_1  string len=10 "need"
    Field_2  string len=6 "java"
    Field_3  string len=7 "help"
    Field_4  string len=8  "asap"
    etc,
    Output_MT 
    DataOut string  "need      java  help   asap    "
    (for some reason the exact spaces in between the words disappear in my Preview message)
    I have several fields in the input mt and therefore I find graphical mapping using concatenate and my own user defined function padWithSpace too messy.
    Thank you for you help.

    Hi,
    If your final req is to write all these fields next each other in a file, you can configure this in receiver file adapter by specifying the fixed length for each field.
    If you want the padded string as your MM o/p, you can create a simple user defined funtion with 15 fields as input and 15 constants for their lengths, and find out the length of the each string and pad it with required no of spaces.
    int max_len = 10;
    int actual_len;
    actual_len = a.lengh();
    for(int i=0; i < (max_len-actual_len; i++)
    a = a.append(" ");
    return a;
    praveen

  • Need user define function for the message  mapping structure

    Hi All
    I am new to XI.I need the java code for Udf for the following structure.
    i have two input and one out put as error.
    order_nos----
    user define function-------error message
    order_details----
    num of orders---- i.e. 10
    order_details------ i.e. whole order records details
    1.i have to compare the 1st  input with 2nd one means if the ist input contain 10 means there are 10 orders in 2nd input.if not then i have to give error message .
    2.then i have to check the fields in 2nd input has no null values.if no values the output will be error message.
    Edited by: Rohit Kumar on Dec 18, 2008 4:43 PM

    Hi Sudhir
    thanks for your continues help.i need some help so that i can fulfill my requirmrnt
    this is my message mapping xml.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:methodCall_MT xmlns:ns0="http://www.dfdsf">
      <num_orders>10</num_orders>
      <test_mode />
    - <order_x>                        ( which is order details)
      <order_id>t78tyu8t</order_id>
      <order_date />
      <mfg_id />
      <catalog_id />
      <first_name />
      <last_name />
      <recipient />
      <message />
      <address1 />
      <address2 />
      <address3 />
      <city />
      <state />
      <zip />
      <country />
      <country_code />
      <phone />
      <subtotal />
      <tax />
      <shipping />
      <total />
      <shopatron_total />
      <fulfiller_total />
      <shipment_id />
    - <additional_info>
      <in_store_pickup />
    - <express_shipping>
      <express_shipping_flag />
      <express_shipping_text />
      <express_shipping_arrival />
      </express_shipping>
      </additional_info>
    - <discount>
      <discount_description />
      <discount_percentage />
      <discount_total />
      </discount>
      <lang_id />
      <currency_id />
      <packing_list />
      <num_items />
    - <items>
      <item_id />
      <quantity />
      <price />
      <part_number />
      <fulfiller_total />
      <shopatron_total />
    - <options>
      <option_x />
      </options>
      </items>
      </order_x>
      </ns0:methodCall_MT>
    this my mapping where under one element number elements are there.when i am excuting the code to check the null value its always giving the there is null val but i have filled evrything.its due to first its checking the order_x and which will be always null.uder this all data will be filled.please suggest what to change in the udf.the code  given by u is working fine but its failing in this scenario because it getting the parent filed is null.

  • Use of user defined function in mathscript containing structure

    Hi, I am an beginner user of LabView's MathScript Module,
    I have the following problem when integrating my MATLAB code into LabView, for HMM:   In my program, I tried to call a user defined MATLAB function called 'mixgaussinit.m' It show this error ..
    Error -90162 occurred at Line 36, Column 20: unexpected char: '.'
    C:\HMMall\KPMstats\mixgauss_init.m
    Possible reason(s):
    LabVIEW:  A recognition error occurred while generating a stream of tokens.
    the line 36 of the file is this "mu = reshape(mix.centres', [d M])"
    mix.centers is a structure.. 
     How can this error be corrected?
    Solved!
    Go to Solution.

    I just noticed that these files appear to be under copyright. My first question is do you have the copyright permissions to post them in a public forum? If not then you may wish to delete them. That being said I have examined the code and it seems easy enough to work around your issues (provided you have the copyright permissions). The way to work around the issues is indeed to replace the struct fields with variables. This will of course require you to change a couple function definitions to input and output the neccesary variables which I believe was at most 5 variables. You will also need to redo the error checking code that uses a cell array. Altogether I estimate about 30 minutes of work. I would have given you the work around in these files had the files not been copyrighted. So, unfortunately, you will have to implement the work around yourself.
    Good luck!
    K Scott

Maybe you are looking for

  • Deleting a row from a resultSet with nulls

    Hello All, I have stumbled across a bit of a problem when using a cachedRowSet If I select columns from my database that have null values, and I call deleteRow() I get a NullPointerException. at com.sun.rowset.internal.CachedRowSetWriter.deleteOrigin

  • DVI to component

    Hi everyone, I've been on this site for a couple of weeks now reading the old posts about connecting a MacBook Pro to TV's. I think I know what I need to get but want to be absolutely certain. To start with, I went to an Apple Store but the associate

  • 'Bal.sheet preparation valuation' indicator in F.05

    hi, Would someone explain the use of 'Bal sheet preparation valuation' indicator on F.05 transaction? Is it one this indicator is selected, no foreign curr reval will be posted to the same period if there is any for currency transaction posted after

  • Case order of EVENT structure

    LV 8.2.1 - Regarding the order of cases in an EVENT structure: 1... Is there any performance (speed) advantage to having the most-commonly used events near the top of the list?  Does it have to search through a list to find which case to execute, or

  • Serial letter Templates from the Intranet

    By now our customer  has its serial letter Templates (Word) on a volume in LAN. Since this volume will be deinstalled, the customer wants to store these templates in Intranet in the future (on some sharepoint volume). By now (SAP R/3 Release 4.7) thi