Solved

How to assign a value of a custom ArrayOfString?

Posted on 2008-10-08
5
422 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
  • 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 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB Script to add site to Java Exception List 4 80
Should localization be done inside spring controller 5 27
factorial example 4 41
MySqlDump not dumping triggers 1 33
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

832 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