?
Solved

How to assign a value of a custom ArrayOfString?

Posted on 2008-10-08
5
Medium Priority
?
432 Views
Last Modified: 2008-10-10
I am using NetBeans IDE 6.1 and I am creating a Web Service Client using the code autogeneration capabilities of NetBeans I am having a problem assigning a value to an ArrayOfString object. This is the code.

com.ca.unicenterserviceplus.servicedesk.ArrayOfString attributes = null;

How would I assign a value to this object?

Thanks in advance
public static String getUserID(String miRefNum)
  {        try {
             java.lang.Integer sid = 0;
             java.lang.String objectType = "cr";
             java.lang.String whereClause = "";
             java.lang.Integer maxRows = 1;
             com.ca.unicenterserviceplus.servicedesk.ArrayOfString attributes = null;
                com.ca.unicenterserviceplus.servicedesk.USDWebService service = new com.ca.unicenterserviceplus.servicedesk.USDWebService();
   com.ca.unicenterserviceplus.servicedesk.USDWebServiceSoap port = service.getUSDWebServiceSoap();
      // TODO process result here
   java.lang.String result = port.doSelect(sid, objectType, whereClause, maxRows, attributes);
   System.out.println("Result = "+result);
        } catch (Exception ex) {
             ex.printStackTrace();
        }
 
      return "";
  }

Open in new window

0
Comment
Question by:Compmind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:wwnosal
ID: 22672581
I don't know what it is but I would try calling constructor i.e:
 com.ca.unicenterserviceplus.servicedesk.ArrayOfString attributes = new com.ca.unicenterserviceplus.servicedesk.ArrayOfString (?????);


in place of ??? there might be some parameter.. You would need to look it up in documentation for this class..

0
 

Author Comment

by:Compmind
ID: 22672911
I don't know in which documentation to look since this code was generated by NetBeans
0
 
LVL 6

Expert Comment

by:wwnosal
ID: 22676168
Ok I'll have look in the evening at home since I don't have Netbeans here..
0
 
LVL 6

Accepted Solution

by:
wwnosal earned 2000 total points
ID: 22680676
Ok I think I've managed to do what you've attempted.. Though I must admit that now I understand your confusion wiht that class cause it is initialized in a non-standard way..
ArrayOfString arr = new ArrayOfString();
       arr.getString().add( "xxx");

Open in new window

0
 

Author Comment

by:Compmind
ID: 22686338
Thanks! I never would have figured to use getString for assigning values.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question