Using an array of strings to name an object

Hey everyone
I have an array of strings that are supposed to be the names of each panel in a grid, but I dont know how to use the string values to name the panels. From searching the forums almost everything refered to using a Map to do this, but I still can't grasp how to use one. Can someone help me with this?
import java.awt.*;
import javax.swing.border.*;
import javax.swing.*;
public class test
    public test()
    public JPanel grid()
         JPanel mainPanel = new JPanel(new GridLayout(10, 10));
         String [] names = new String[100];
         Border innerBorder = BorderFactory.createLineBorder(Color.black, 1);
          for (int i = 0; i < 100; i++)
               names[i] = "Panel" + i;
          for (int r = 0; r < 100; r++)
               String varName = names[r];
               JPanel /*I would like the JPanel to be named what the string varName is*/justSoItCompiles = new JPanel(new GridLayout(2,1));
               /*The JPanel above*/justSoItCompiles.setBorder(innerBorder);
               mainPanel.add(justSoItCompiles);
          return mainPanel;
}Thanks in advance

You just make a Map as:
Map<String, JPanel> panelMap = new HashMap<String, JPanel>();then add a panel as
panelMap.add("Panel1", new JPanel());then you can do whatever with it by saying
panelMap.get("Panel1").add(something);Make sense?

Similar Messages

  • Not using an array of strings

    how do I write a java method without using an array of strings?
    for example:
    import java.io.File;
    public class rename
    public static void main(String[] args)
    File src = new File(args[0]);
    File dst = new File("c:\\temp\\temp.txt");
    boolean wasRenamed = src.renameTo(dst);
    I don't want to have main use an array of strings but I want rename to work as a class

    This is what I changed it to and am getting an -- Exception in thread "main" java.lang.NoSuchMethodError: main
    Sorry this is my first java program
    import java.io.File;
    class App {
         private App() {
              super();
         static final public void main(final String[] args) {
              switch (args.length) {
                   case 1:
                        try {
                             Rename rename = new Rename();
                             rename.rename("c:\\felss\\charles.txt.bak"); // see, it's kind of silly to have same names for class and method
                             System.exit(0);
                        catch (Throwable e) {
                             e.printStackTrace();
                             System.exit(1);
                        break;
                   default:
                        System.err.println("Usage: java App [new name]");
                        System.exit(1);
    public class Rename {
         public Rename() {
              super();
         final public void rename(final String newName) {
              File src = new File(newName);
              File dst = new File("c:\\felss\\charles.txt");
              boolean done = src.renameTo(dst);
    }

  • How Do I Convert a String that Names an Object to a Reference to the Object

    You get many program-specific object names in the XML that is returned by describeType.  Suppose I find an object that interests me.  What is the best way to convert the String that names the object (e.g. the id of the object) to a reference variable that points to the object? 

    Sure.  I am working on a complex application that involves several ViewStacks, several Accordions, some checkboxes, some radio buttons, some text boxes.  These components are scattered about, but all are children of a base class that is successfully enumerated by
    var classInfo:XML = describeType(vwstk);
    Suppose I write a loop as follows:
     for each (var a:XML in classInfo..accessor){
    Inside that loop I have a series of tests like
    if (a.@type == "mx.controls::CheckBox"{
    Then, I iterate thru all of the children of the base class as in:
    for  
    (var u:Object in vwstk)
    {        if  
    Inside the if I persist the checked/not checked status of the checkbox.
    The tricky part is going from the string a.@name to the Object reference u.  I doubt my proposed method will work.  Do you have a better idea?

  • Is there a way of calling out all values in a String to name an object?

    Is the above possible?
    As in the generic statement below,
    [class name] [objectname] = new [constructor];
    to be able to make the value of a String to be the objectname? such that if this instance
    String s = "Peter";
    Then the objectname will be Peter, as in
    [class name] [Peter] = new [constructor];

    you could do something like this:
    String str[] = new String[10];
    then you could get the value of a string from a user and place it in a String variable.
    TextField text1 = new TextField ();
    String nameofObject = text1.getText();
    now you can do something like:
    create a button to submit the new name and then check to see if the button was pressed. If the button was pressed, iterate through the loop and set the str array object equal to the value of nameofObject string. Do it something like:
    str[0] = nameofObject;
    now you should be able to refer to the newly created object as the string name entered into the TextField you retrieved.
    That is just off the top of my head. I am sure what you are trying to do can be done.
    Hope that helps,
    Kent

  • "Using a CIN to Create an Array of Strings in LabVIEW" example crashes LV on Linux

    Tried to utilize this NI example: "Using a CIN to Create an Array of Strings in LabVIEW" (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4B282BE7EF907C8E034080020E74861&p_node=&p_source=External)
    Compiles OK with the makefile made by the LV's lvmkmf utility. Nevertheless when I try to run the VI (with the code loaded into the CIN, of course), LabVIEW 7.1.1 on a SUSE 9.3 Linux machine crashes:
    LabVIEW caught fatal signal
    7.1.1 - Received SIGSEGV
    Reason: address not mapped to object
    Attempt to reference address: 0x0
    Segmentation fault
    Any ideas? Did anybody try this on a Windows machine?

    H View Labs wrote:
    Tried to utilize this NI example: "Using a CIN to Create an Array of Strings in LabVIEW" (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4B282BE7EF907C8E034080020E74861&p_node=&p_source=External)
    Compiles OK with the makefile made by the LV's lvmkmf utility. Nevertheless when I try to run the VI (with the code loaded into the CIN, of course), LabVIEW 7.1.1 on a SUSE 9.3 Linux machine crashes:
    LabVIEW caught fatal signal
    7.1.1 - Received SIGSEGV
    Reason: address not mapped to object
    Attempt to reference address: 0x0
    Segmentation fault
    Any ideas? Did anybody try this on a Windows machine?
    This code is badly broken. In addition to resizing the actual handle to hold the number of string handles you also would need to create the string handles itself before attempting to write into them. NumericArrayResize is the fucntion to use as it will either resize an existing handle (if any) or create a new one if the value is uninitialized (NULL).
    /* resize strarr to hold handles to NUMSTRINGS strings */
    err = SetCINArraySize((UHandle)strarr, 0, NUMSTRINGS);
    if (err)
    goto out;
    /* perform this loop once for each element */
    /* of array of strings being created */
    for (i = 0; i < NUMSTRINGS;) {
    LStrHandle handle = (*strarr)->arg1[i];
    /* determine length of string that will be element of strarr */
    strsize = StrLen(str[i]);
    err = NumericArrayResize(uB, 1, &handle, strsize);
    if (err)
    goto out;
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    /* moves strsize bytes from the address pointed to */
    /* by str[i] to the address pointed to by the data pointer in the handle */
    MoveBlock(str[i], LStrBuf(*handle), strsize);
    /* manually set size of string pointed to by *strarr */
    (*((*strarr)->arg1[i]))->cnt = strsize;
    /* manually set dimSize of strarr */
    (*strarr)->dimSize = ++i;
    return noErr;
    out:
    return err;
    Rolf KalbermatterMessage Edited by rolfk on 06-30-2005 03:15 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Using JNI to pass an array of Strings to C and back from C

    I have some C code that I want to integrate with a new Java application and I need to be able to pass an array of strings to the C program and then the C program needs to be able to build an array of strings that is passed back to the Java program. I've got the first part working so that I can pass an array of strings to the C program and display them, but I can't figure out how to build the strings in C so that that when Java gets back control, it can display the strings tha were built in the C program.
    Has anyone done this? Do you have some sample code?

    I have a program which is written in C. I can give you the whole project as it is in a zip file. You'll need VC to work with it. By the way, I am using Windows for development. Should you need it, I'll mail you the same. Give me your mail address.

  • Converting array of strings using SCMS_STRING_TO_XSTRING

    Hello all,
    FM SCMS_STRING_TO_XSTRING can be used to convert a String to a XSTRING and then we can use FM SMUM_XML_PARSE to parse the XML.
    Now I will have a array of strings as an output from a web service and I need to parse them .. so the Function modules mentioned above are used for a single string but how to convert the array of strings??
    Please suggest me on how to proceed.
    Thanks in advance,
    Regards,
    Suman.

    Hi Raja,
    Thanks for your suggestion.
    I have yet to try this..I will update with the results.
    Regards,
    Suman.

  • ...USING :(Array or String of Host Variables)

    It`s posible????
    This is the code:
    String s="SELECT namecolumn FROM nametable WHERE namevar1=:var1 AND namevar2=:var2";
    String vars=":var1,:var2"
    #sql [default_context]{begin
    open :OUT cursor
    for :s
    using :vars;
    end;};

    The simplest (?) way to do it would be something like...
    String[][] attribs = new String [4][2];
    Class paramTypes[] = {String.class, attribs.getClass()};
    Object[] params = new Object[] {"PRINTER",attribs};
    Method m = obj.getClass().getMethod("cadastraTipoServico", paramTypes);
    m.invoke(obj,params);After a quick flick through the 1.3 API, I don't know if there's a simple way to create a Class representing an array of another Class. You could do...
    Class arrayClass = java.lang.reflect.Array.newInstance(componentClass, new int[] {0, 0}).getClass();... but you can guess why I might not recommend it in the general case.
    Hope this helps,
    -Troy

  • On my ipod touch, when i go on my game it pops up with a message saying "FlurryAppCircle: Attempting to pass blank hook name to getOffer. Please use a non-blank string for hook name" what does it mean?

    on my ipod touch, when i go on my game it pops up with a message saying "FlurryAppCircle: Attempting to pass blank hook name to getOffer. Please use a non-blank string for hook name" what does it mean?

    Try:
    iOS: Troubleshooting applications purchased from the App Store
    Contact developer/go to their support site.

  • How can I create a custom data type that is a 2D array of string by using TestStand API?

    Hi all,
    I'm new in TestStand:
    I'm able to create a custom data type that is a 1D array of string but I cannot find the way to create a 2D array of string.
    Can anyone help me?
    Thank you in advance.
    Federico

    I made it!!
    Indeed my 2D array is an item of a container:
    /*  Create a new container */
    RunState.Engine.NewPropertyObject(Locals.NewDataType,PropValType_Container,False,"",0)
    /*  Create an array of strings as item of the container */
    Locals.NewDataType.NewSubProperty("Array_2D",PropValType_String,True,"",0)
    /*  Reshape the array as an empty 2D array */
    Locals.NewDataType.GetPropertyObject("Array_2D",0).Type.ArrayDimensions.SetBoundsByStrings("[0][0]","[][]")
    being:
    NewDataType a local property (type Object)
    Attachments:
    AddCustomTypeAndCreateFileGlobals.seq ‏11 KB

  • Can anyone answer this question? What is used to format a string so that it falls into a certain Row/Column in excel? see text for indepth question.

    I'm attaching a file that may help. Just remember this is my FIRST attempt at using NI/FeildPoint so things that would be obvious to the normal users more than likely would slide right by me. So I'll try and explain what the text contains as to make my problem more clear. I'm using a FP-1000, FP-AI-100, and a FP-TB-10. i'm creating a application where I'm using the 8 channels from the FP-AI-100 to monitor a control system ,that we manufacture. The control system is in an environmental chamber. I use the FP-TB-10 to monitor the temperature while in the chamber. The control system is ran for 4 hours under varing enviromental conditions while I monitor vital system voltages with the FP-AI-100. Now the application that i'm building starts with the obvious FP CREATE.VI and so forth I have no problem communicating with the FP's, but the information that I'm monitioring needs to be placed into a file with Headers describing the information below it. Now I use a "WHILE LOOP.VI" to monitor the FP-AI-100 & FP-TB-10 for the 4 hour period. but before that I create and open a file where I use a "CONCATENATE STRINGS.VI" to enter the headers I need. I do this by CONSTANTS, CONTROLS, TABs, AND CARRIAGE RETURN being entered into the "CONCATENATE STRINGS.VI" in the order I want them to appear. I use ROW 1 to enter (OPERATOR:with a CONSTANT) an a (CONTROL so the operator may enter his name and be recorded into the file) using a TAB to seperate Columns and a CARRIAGE RETURNto drop down to ROW 2 for the next headers. I use header names and TABs to seperate the columns. This part works great. I end up with ROW 1 having the operator information then ROW 2 having the headers for all the channels I'm using to monitor the control system with in their own column. The trouble happens when I write to this file during the "WHILE LOOP". The information recorded for DATE:, TIME:, and Channel 0 of the FP-AI-100 end up right under their corresponding header on ROW 3, but the rest of the data ends up on ROW 4 in column 3 and goes down many rows with some of the data not being stored at all. It varies on how many rows are used starting at ROW 4 but hey always stay in column 3. I use the "FP READ.VI" outputing to a "ARRAY TO SPREADSHEET STRING.VI" outputing to a "CONCATENATE STRINGS.VI" for each channel within the "WHILE LOOP" then into the "WRITE.VI". I use the "CONCATENATE STRINGS.VI" to place my data OR atleast I thought you could do that some how I'm not quit doing something write either there is a sampling/timing issue or writing to file issue where things are being confused in the "WHILE LOOP" if someone know a better route to perform what I'm tring here I would be interested. Its not like I'm not giving it the old colledge try here but without proper training and the vagness of the manuals it's difficult to understand what every connection actually does.I'm tring though for everyone who happens to fill pity for me
    Thanks for your help
    John Morris
    Glendinning Marine Product, Inc.
    Attachments:
    ALLchannels ‏273 KB

    > I appreciate your effort to help me, but there is still a slight cloud
    > in front of my eyes here.(I must mention that I'm using Labview 5.1
    Oh, to bad. I'm using LV 6,02 and tried to save the application as LV5.1,
    but it didn't work.
    > Lets start with the easy one which is the SECOND main thing you
    > wanted to mention. In my application I used individual Create Tag.vi's
    > "so your saying that I can use just one Create Tag.vi and one Read.vi
    > and what ever I use to display the values will automatically to show
    > the individual channels" in other words if I use a "Indicator(DBL)"
    > comming out of the Read.vi what ever I use in the "PANEL" layout will
    > expand to show all 8 channel if I was using a FP-AI-100? Cool...
    Allmost right. The 8 channels come out as 1D-array, ch0...ch7.
    > #1--How do I change the delimiter (TAB) to a delimiter (comma) in a
    > Array to Spreadsheet String.vi?
    > ...cut
    I don't use this Spreadsheet VI, because files coming out there allways
    start this time consuming EXCEL wizzard. Because of this, I programmed my
    own CSV-conversion vi. Maybe you could just use a common texteditor, like
    wordpad and put the csv-examples from my last reply down to a text file
    and rename it to *.csv. Texteditors terminate lines with "\r\n" by
    default, so this is a very quick way for testing.
    > FP_Analog_Logging example to record all eight channels it uses a Array
    I didn't find the vi you metione above, but there is another good one:
    Look at examples\FieldPoint\DataLogging\FP Logger.vi.
    In a little case structure, at "false", there is a function called "Format
    into string".
    Pop up on the format string and adjust >>'\' Codes Display<<.
    Then you change the format string into: %.;%-f%s
    A Tab string is connected to the lower input of this function. Replace
    this one with a comma.
    That should do.
    >
    > #2--If using just one Create Tag.vi and one Read.vi and I have the
    > Item Name listed as ALL I take it that the information comming out of
    > the Read.vi is data for each channel in a String format starting with
    > channel 0 and ending with channel 7 for the FP-AI-100.
    Yes, just as explained above. If you put a indicator at the output to
    display the values, you can expand the display to show all 8 channels, but
    you can't name induvidual cells. In a array, all cells have identical
    named labels. If you want to name the individually, you have to attach the
    array to cluster function and put the indicator after this one. Enable
    labe display and name the output values individually.
    > #3--Now I use the following to "Format String" in the Array to
    > Spreadsheet string.vi (%.4f)but I don't see anyway of changing the
    > delimiter from (TAB) to (COMA)
    Explained above.
    > #4 you stated text strings need a "as prefix and sufix" and each
    > string is seperated by a coma, a period is used as decimal number
    > separator and lines have to be terminated by my question is
    > WHERE IS THIS ACCOMPLISHED? WHAT VI OR WHAT CONNECTOR PIN?
    Well, modifying strings are done with string functions.
    Above, as I explained how the sample FP Logger.vi can be modified to do
    the job for numbers. The pre- and suffixing with ", you only need for
    strings, which EXCEL should interpret a string and as nothing else as a
    string, even if there's a number inside. You usually need this only for
    headers. So its easyest, if you just write your string into a string
    constant or control and concatenate it to the previous csv-file contents.
    Oh, I just see by looking at the above mentioned example... Inside the
    case structure, but in the "true" case, there are error messages
    concatenated to the logfile. At this point it is importent, to use " for
    integrating the message into the CSV file, because a error message usually
    looks like this: >> ERROR 2345 in vi yxz <<
    Here you have text and number strings mixed in one line. EXCEL does not
    know, if it should interpret the number inside the error line as separate
    number, separating the line into three colums i.e. string before number,
    number and string after number. So tell EXCEL by putting a " before and
    after the line each.
    For this, expand the Format To String function by one input, move down all
    connections, to be able to insert a string constant with a " to the first
    argument connector. Change the contents of the string constant at the
    bottom argument from tab to ", (quotation mark AND comma)
    > #5 You gave me an example of what a 3 column header could look like:
    > "col0","col1","col2"\r\n Now is this something that you enter
    > somewhere cause I know that \r is carriage return and \n is newline so
    > I take it that the above is entered somewhere maybe in the Write.vi to
    > the connector called Header (F)? See this is what confuses me because
    > NI manuals have no examples of certain connectors types being used or
    > any reference as to how they manipluate data with there varing type
    > inputs. Or maybe I'm just missing them.
    The example I mentioned above help here to.
    Look at the Write File function. This function receves data from a
    function named concatenate strings. Expand this function to have one more
    spare input at the bottom. Create a string constant. Switch the constant
    display to "\" mode. Enter "col0","col1","col2"\r\n into the constant.
    Connect the constant to the spare input.
    Doing this, every dataline in the csv file is followed by
    "col0","col1","col2"\r\n .
    I wish you a nice weekend,
    Rainer Ehrt

  • Using Variables/Arrays from one class in another

    Hello all,
    First, to explain what I am attempting to create, is a program that will accept input of employee names and hours worked into an array. The first class will accept a command line argument when invoked. If the argument is correct, it will call another class that will gather information from the user via an input box. After all names and hours have been input for employees, this class will calculate the salary based upon the first letter of each employee name and print the total hours, salary, etc. for each employee.
    What I need to do now is to split the second class into two: one that will gather the data and another that will calculate and print the data. Yes, this is an assignment. However, I am trying to learn and I have gotten this far, but I am stuck on how to get a class to be able to use an array/variables from another class.
    I realize the below code isn't exactly cleaned up...yet.
    Code for AverageSalaryGather class:
    import javax.swing.JOptionPane; // uses class JOptionPane
    import java.lang.reflect.Array;     
    import java.math.*;
    public class AverageSalaryGather {
         public static void gatherData() {     
              char[] alphaArray = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z'};
              String[][] empInfoArray = new String[100][4];
              String[] empNameArray = new String[100];
              String finalOutput = "Name - Rate - Hours - Total Pay\n";
              String averageHoursOutput = "Average Hours Worked:\n";
              String averageSalaryOutput = "Average Hourly Salary:\n";
              String averageGroupSalaryOutput = "Average Group Salary:\n";
                        String[] rateArray = new String[26];
                        char empNameChar = 'a';
              int empRate = 0;
              int payRate = 0;
                        for (int i = 0; i < 26; i++) {
                   payRate = i + 5;
                   rateArray[i] = Integer.toString(payRate);
                        int countJoo = 0;
              while (true) {
                   String namePrompt = "Please enter the employee name: ";
                   String empName = JOptionPane.showInputDialog(namePrompt);
                                  if (empName == null | empName.equals("")) {
                        break;
                   else {
                        empInfoArray[countJoo][0] = empName;
                        for (int i = 0; i < alphaArray.length; i++) {
                             empNameChar = empName.toLowerCase().charAt(0);
                                                      if (alphaArray[i] == empNameChar) {
                                  empInfoArray[countJoo][1] = rateArray;
                                  break;
                        countJoo++;
              // DecimalFormat dollarFormat = new DecimalFormat("$#0.00");
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[i][0] == null)) {
                        String hourPrompt = "Please enter hours for " + empInfoArray[i][0] + ": ";
                        String empHours = JOptionPane.showInputDialog(hourPrompt);
                        int test = 0;
                        empInfoArray[i][2] = empHours;
                        // convert type String to double
                        //double tmpPayRate = Double.parseDouble(empInfoArray[i][1]);
                        //double tmpHours = Double.parseDouble(empInfoArray[i][2]);
                        //double tmpTotalPay = tmpPayRate * tmpHours;
                        // create via a string in empInfoArray
                             BigDecimal bdRate = new BigDecimal(empInfoArray[i][1]);
                             BigDecimal bdHours = new BigDecimal(empInfoArray[i][2]);
                             BigDecimal bdTotal = bdRate.multiply(bdHours);
                             bdTotal = bdTotal.setScale(2, RoundingMode.HALF_UP);
                             String strTotal = bdTotal.toString();
                             empInfoArray[i][3] = strTotal;
                        //String strTotalPay = Double.toString(tmpTotalPay);
                        //empInfoArray[i][3] = dollarFormat.format(tmpTotalPay);
                        else {
                             break;
              AverageSalaryCalcAndPrint averageSalaryCalcAndPrint = new AverageSalaryCalcAndPrint();
              averageSalaryCalcAndprint.calcAndPrint();
    Code for AverageSalaryCalcAndPrint class (upon compiling, there are more than a few complie errors, and that is due to me cutting/pasting the code from the other class into the new class and the compiler does not know how to access the array/variables from the gatherData class):
    import javax.swing.JOptionPane; // uses class JOptionPane
    import java.lang.reflect.Array;
    import java.math.*;
    public class AverageSalaryCalcAndPrint
         public static void calcAndPrint() {     
              AverageSalaryGather averageSalaryGather = new AverageSalaryGather();
              double totalHours = 0;
              double averageHours = 0;
              double averageSalary = 0;
              double totalSalary = 0;
              double averageGroupSalary = 0;
              double totalGroupSalary = 0;
              int countOfArray = 0;
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[0] == null)) {
                        totalSalary = totalSalary + Double.parseDouble(empInfoArray[i][1]);
                        totalHours = totalHours + Double.parseDouble(empInfoArray[i][2]);
                        totalGroupSalary = totalGroupSalary + Double.parseDouble(empInfoArray[i][3]);
                        countOfArray = i;
              averageHours = totalHours / (countOfArray + 1);
              averageSalary = totalSalary / (countOfArray + 1);
              averageGroupSalary = totalGroupSalary / (countOfArray + 1);
              String strAverageHourlySalary = Double.toString(averageSalary);
              String strAverageHours = Double.toString(averageHours);
              String strAverageGroupSalary = Double.toString(averageGroupSalary);
              for (int i = 0; i < empInfoArray.length; i++) {
                   if (!(empInfoArray[i][0] == null)) {
                        finalOutput = finalOutput + empInfoArray[i][0] + " - " + "$" + empInfoArray[i][1] + "/hr" + " - " + empInfoArray[i][2] + " - " + "$" + empInfoArray[i][3] + "\n";
              averageHoursOutput = averageHoursOutput + strAverageHours + "\n";
              averageSalaryOutput = averageSalaryOutput + strAverageHourlySalary + "\n";
              averageGroupSalaryOutput = averageGroupSalaryOutput + strAverageGroupSalary + "\n";
              JOptionPane.showMessageDialog(null, finalOutput + averageHoursOutput + averageSalaryOutput + averageGroupSalaryOutput, "Totals", JOptionPane.PLAIN_MESSAGE );

    Call the other class's methods. (In general, you
    shouldn't even try to access fields from the other
    class.) Also you should be looking at an
    instance of the other class, and not the class
    itself, generally.Would I not call the other classes method's by someting similar as below?:
    AverageSalaryCalcAndPrint averageSalaryCalcAndPrint = new AverageSalaryCalcAndPrint();
              averageSalaryCalcAndprint.calcAndPrint(); Well... don't break down classes based on broad steps
    of the program. Break them down by the information
    being managed. I'm not expressing this well...Could you give an example of this? I'm not sure I'm following well.
    Anyway, you want one or more objects that represent
    the data, and operations on that data. Those
    operations include calculations on the data. Other
    classes might represent the user interface, and
    different output types (say, a file versus the
    console).Yes, the requirements is to have a separate class to gather the data, and then another class to calculate and print the data. Is this what you mean in the above?

  • Error when using int array as out parameter

    Hi,
    I have created a simple webservice in Weblogic 8.1.4 and created a method that takes the following parameters:
    * @wlws:part errorCodes style="out"
    * @wlws:part Result style="out"
    public void checkPin(int[] cardId, int validation, String cardType, int blockedBy, int[] lang, int[]errorCodes, IntHolder Result)
    I've compiled the code using an ant script and it calls autotype, source2wsdd and clientgen, then deploys the webservice successfully. However, when I invoke the webmethod either through a client (.net client) or through the weblogic console webservice test interface it throws a soap fault:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception during processing: java.lang.IllegalArgumentException: argument type mismatch (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.IllegalArgumentException: argument type mismatch
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.webservice.component.javaclass.JavaClassInvocationHandler.invoke(JavaClassInvocationHandler.java:133)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:104)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:535)
         at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204)
         at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176)
         at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96)
         at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100)
         at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297)
         at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:485)
         at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    </bea_fault:stacktrace></detail></env:Fault></env:Body></env:Envelope>
    The WSDL looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <definitions xmlns:tns="http://tempuri.org/" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
    - <types xmlns:tns="http://tempuri.org/" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:stns="java:language_builtins" elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="java:language_builtins">
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    - <xsd:complexType name="ArrayOfInt">
    - <xsd:complexContent>
    - <xsd:restriction xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" base="soapenc:Array">
    <xsd:attribute xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]" />
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:stns="java:language_builtins.lang" elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="java:language_builtins.lang">
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    - <xsd:complexType name="ArrayOfString">
    - <xsd:complexContent>
    - <xsd:restriction xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" base="soapenc:Array">
    <xsd:attribute xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:schema>
    </types>
    - <message name="setBlockingStatus">
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="cardId" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="validation" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="cardType" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="blockedBy" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="block" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="newBlockedBy" />
    </message>
    - <message name="setBlockingStatusResponse">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodes" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="Result" />
    </message>
    - <message name="getStatus">
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="cardId" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="validation" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="cardType" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="blockedBy" />
    </message>
    - <message name="getStatusResponse">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="balance" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="lang" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="block" />
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="firstUse" />
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="lastUse" />
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="expireFirstUse" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="cardBlockedBy" />
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="expireLastUse" />
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="expireActivation" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodes" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="Result" />
    </message>
    - <message name="setLang">
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="cardId" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="validation" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="cardType" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="blockedBy" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="lang" />
    </message>
    - <message name="setLangResponse">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodes" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="Result" />
    </message>
    - <message name="changeBalance">
    <part xmlns:partns="java:language_builtins.lang" type="partns:ArrayOfString" name="cardId" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="validation" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="cardType" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="blockedBy" />
    </message>
    - <message name="changeBalanceResponse">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="units" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="balanceBefore" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="balanceAfter" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodes" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodePos" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="Result" />
    </message>
    - <message name="checkPin">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="cardId" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="validation" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:string" name="cardType" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="blockedBy" />
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="lang" />
    </message>
    - <message name="checkPinResponse">
    <part xmlns:partns="java:language_builtins" type="partns:ArrayOfInt" name="errorCodes" />
    <part xmlns:partns="http://www.w3.org/2001/XMLSchema" type="partns:int" name="Result" />
    </message>
    - <portType name="XanticChatCardServicePort">
    - <operation parameterOrder="cardId validation cardType blockedBy block newBlockedBy errorCodes Result" name="setBlockingStatus">
    <input message="tns:setBlockingStatus" />
    <output message="tns:setBlockingStatusResponse" />
    </operation>
    - <operation parameterOrder="cardId validation cardType blockedBy balance lang block firstUse lastUse expireFirstUse cardBlockedBy expireLastUse expireActivation errorCodes Result" name="getStatus">
    <input message="tns:getStatus" />
    <output message="tns:getStatusResponse" />
    </operation>
    - <operation parameterOrder="cardId validation cardType blockedBy lang errorCodes Result" name="setLang">
    <input message="tns:setLang" />
    <output message="tns:setLangResponse" />
    </operation>
    - <operation parameterOrder="cardId validation cardType blockedBy units balanceBefore balanceAfter errorCodes errorCodePos Result" name="changeBalance">
    <input message="tns:changeBalance" />
    <output message="tns:changeBalanceResponse" />
    </operation>
    - <operation parameterOrder="cardId validation cardType blockedBy lang errorCodes Result" name="checkPin">
    <input message="tns:checkPin" />
    <output message="tns:checkPinResponse" />
    </operation>
    </portType>
    - <binding type="tns:XanticChatCardServicePort" name="XanticChatCardServicePort">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="setBlockingStatus">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    - <operation name="getStatus">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    - <operation name="setLang">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    - <operation name="changeBalance">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    - <operation name="checkPin">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://tempuri.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    </binding>
    - <service name="XanticChatCardService">
    - <port name="XanticChatCardServicePort" binding="tns:XanticChatCardServicePort">
    <soap:address location="http://localhost:7001/XanticChatCardWebservice/XanticChatCardService" />
    </port>
    </service>
    </definitions>
    Any idea what the problem would be? This should work

    Ok...I proved myself wrong. After further review I found a post on here that somebody had a similar problem and solved it. It all comes down to the autotype generation. For some reason, my autotypes get generated in a different namespace "language_builtins.lang". I read that XML-RPC wants all custom out parameters to be placed under the webservice package/holders namespace but for some reason autotype autogenerates the holders in language_builtins. I've played with the options for autotype but nothing seem to fix it so I basically took the .wsdl file generated by source2wsdd, changed all references to language_builtins to the proper namespace and reran autotypes with the wsdl option instead of javaComponent. That seem to have forced the classes to be generated in the correct directories.

  • I need to sort an array of strings based on the number in each string.

    Basically, I have a directory of files that all have the same name but each with a different number on the end.
    example: image 1.jpg, image 2.jpg, etc.
    When I use the List Directory function that returns an array of strings containing the file names in the directory, they don't come out in a 1, 2, 3, order like they appear in the directory. It sorts them character by character so that they come out like: 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22 etc.
    Is there a simple way of sorting this array of strings with the file names (as above) so that they are in numerical order?

    It's a while since this thread was started, but I am sure others will have use for this so here goes:
    The in-built array sort function sorts the strings the same way DOS and Windows do. Microsoft has fixed this in the Explorer that comes with XP, however the rest of the OS(s) still sorts the old way.
    The attached "AlphaLogical String Array Sort" VIs will sort strings arrays the same way as the new XP Explorer. There are three different implementations of the sorting, one based on the Insertion sort algorithm, a Quick Sort based on recursive calls (the most elegant way, but unfortunately LabVIEW has too much overhead when doing recursive calls so this is actually a very slow alternative) and finally the fastest; a stack based Quick Sort. There is also a test VI that will show you how the different implementations perform.
    I had not used recursive calls in LV much until I made the attached quick sort and was a bit disappointed by the fact that it is so slow, but it's a good learning example...The ability to do recursive calls this way was introduced in LV7 I believe...There is an example here on the zone that shows how you can calulate a factorial by using recursive calls, however - unlike for the quick sort (normally) - recursive calls are actually not the optimal solution for that calculation.
    Message Edited by Mads on 09-13-2005 02:30 AM
    MTO
    Attachments:
    AlphaLogical Sorting.zip ‏142 KB

  • Mapping lookup up failure with input JavaBean with an array of strings

    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
         at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
         at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
         at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
         at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
         at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
         at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
         at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
         at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
         at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
         at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
         at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
         at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
         [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
         private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
         private String nodeId = null;
         private String incidentNbr = null;
         private String CSRCode = null;
         private String[] stopCodes = null;
         public void setStopCodes(String[] aStopCodes) {
              stopCodes = aStopCodes;
         public String[] getStopCodes() {
              return stopCodes;
         [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
         <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
         ejbJar="GIMServiceEJB.jar"
         targetNamespace="ncr.com"
                        serviceName="GIMService"
                        serviceURI="/GIM_URI"
                        generateTypes="True"
                        expandMethods="True"
                        style="rpc"
                        protocol="http" >
              <client
                   clientJarName="GIMService_client.jar"
                   packageName="com.ncr.gim.gimservice.client" >
              </client>
    </service>
    </servicegen>
    </target>
    </project>

    Hi Jeff,
    Looks like the Perl client is using an older (deprecated) schema
    namespace "http://www.w3.org/1999/XMLSchema" that is causing this
    failure.
    Hope this helps,
    Bruce
    Jeff Carey wrote:
    >
    To receive input data our Web service defines a JavaBean one element of which is
    an array of strings. When a test Java client calls the service method the call
    is completed successfully. When a Perl client calls the service method an exception
    is returned. If I understand BEA's Web service documentation, it isn't necessary
    to do development for the service specifically to enable correct processing of
    an array of strings.
    In our environment we are running WL 8.1 SP 1.
    Please review the problem documentation and explain to me the cause of the exception
    and what I must do to prevent it.
    Thank you.
    The exception:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Exception
    during processing: weblogic.xml.schema.binding.DeserializationException: mapping
    lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema context=TypedSchemaContext{javaType=java.lang.String}
    (see Fault Detail for stacktrace)</faultstring><detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"/>weblogic.xml.schema.binding.DeserializationException:
    mapping lookup failure. type=['http://www.w3.org/1999/XMLSchema']:xsd:string schema
    context=TypedSchemaContext{javaType=java.lang.String}
    at weblogic.xml.schema.binding.RuntimeUtils.lookup_deserializer(RuntimeUtils.java:461)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.getComponentDeserializer(SoapArrayCodecBase.java:574)
    at weblogic.xml.schema.binding.SoapArrayCodecBase.deserialize(SoapArrayCodecBase.java:285)
    at weblogic.xml.schema.binding.BeanCodecBase.processElement(BeanCodecBase.java:183)
    at weblogic.xml.schema.binding.BeanCodecBase.processAllElements(BeanCodecBase.java:165)
    at weblogic.xml.schema.binding.BeanCodecBase.processElements(BeanCodecBase.java:145)
    at weblogic.xml.schema.binding.BeanCodecBase.deserialize(BeanCodecBase.java:108)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:428)
    at weblogic.xml.schema.binding.RuntimeUtils.invoke_deserializer(RuntimeUtils.java:328)
    at weblogic.webservice.core.DefaultPart.toJava(DefaultPart.java:384)
    at weblogic.webservice.core.DefaultMessage.toJava(DefaultMessage.java:458)
    at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:78)
    at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143)
    at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:518)
    [more]
    The XML generated for the Perl client:
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:namesp2="http://namespaces.soaplite.com/perl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:getWorkOrdersByFilters
    xmlns:namesp1="ncr.com"><gIMServiceRequest xsi:type="ns:GIMServiceRequest" xmlns:ns="java:com.ncr.gim.bean.service"><applicationID
    xsi:type="xsd:string">REVLOG</applicationID><nodeId xsi:type="xsd:string">00XH</nodeId><stopCodes
    xsi:type="namesp2:array" SOAP-ENC:arrayType="xsd:string[2]"><xsd:string xsi:type="xsd:string">06</xsd:string><xsd:string
    xsi:type="xsd:string">16</xsd:string></stopCodes></gIMServiceRequest></namesp1:getWorkOrdersByFilters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The XML generated for a test Java client:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getWorkOrdersByFilters
    xmlns:m="ncr.com"><gIMServiceRequest xmlns:n1="java:com.ncr.gim.bean.service"
    xsi:type="n1:GIMServiceRequest"><CSRCode xsi:type="xsd:string">987x00</CSRCode><applicationID
    xsi:type="xsd:string">GIM</applicationID><incidentNbr xsi:nil="true"/><nodeId
    xsi:type="xsd:string">00T5</nodeId><stopCodes soapenc:arrayType="xsd:string[3]"><xsd:string
    xsi:type="xsd:string">00</xsd:string><xsd:string xsi:type="xsd:string">01</xsd:string><xsd:string
    xsi:type="xsd:string">02</xsd:string></stopCodes></gIMServiceRequest></m:getWorkOrdersByFilters></env:Body></env:Envelope>
    The JavaBean:
    public class GIMServiceRequest implements Serializable {
    private String applicationID = GIMConstants.UNKNOWN_APPLICATION_ID;
    private String nodeId = null;
    private String incidentNbr = null;
    private String CSRCode = null;
    private String[] stopCodes = null;
    public void setStopCodes(String[] aStopCodes) {
    stopCodes = aStopCodes;
    public String[] getStopCodes() {
    return stopCodes;
    [more]
    The service build.xml file:
    <project name="GIMService" default="all" basedir=".">
    <target name="all" depends="ear"/>
    <target name="ear">
    <servicegen
    destEar="GIMService.ear"
    contextURI="GIMContext" >
    <service
    ejbJar="GIMServiceEJB.jar"
    targetNamespace="ncr.com"
    serviceName="GIMService"
    serviceURI="/GIM_URI"
    generateTypes="True"
    expandMethods="True"
    style="rpc"
    protocol="http" >
    <client
    clientJarName="GIMService_client.jar"
    packageName="com.ncr.gim.gimservice.client" >
    </client>
    </service>
    </servicegen>
    </target>
    </project>

Maybe you are looking for

  • Help for Report Painter!!

    Dear All, When i create a report in Report Painter and execute, it requires insert report in report group, i chose once of report group --> ok, but an error occurs: "Objects with leading zero may not be changed". So, what can i do? pls help me. Thank

  • How do I set up folders in Mail?

    How do I set up different folders in my email accounts?  I have a POP account.  I have read that I need an IMAP account but do not understand what that is.  I tried syncing my iPad with my Mac and sending the mail accounts info but this did not work.

  • Extracting a csv file into a Z directory in AL11 via Open Hub

    Hi All, After reviewing alot of treads  I am able to etracte a .csv file via Open Hub Destination into DIR_HOME in AL11. But, My requirement is to create the file in AL11 directory "ZBIWCOPA" and this directory is available in all systems in the land

  • Cs4 dreamweaver suddenly crashes when selecting code/split view

    i have looked around and found this issue in older posts from 2008 but have not found a resolution. i've had dw cs4 for mac for a several months and all of a sudden it started crashing when i select code/split view. i have: deleted prefs deleted conf

  • Location wise authorization to user

    Hi my client is using account segmentation. it has diffrent users at diffrent locations. the server is at head office. the client does not want that the user at diffrent location could see the ledgers, business partners any thing related to user of o