Solved

How to assign a value of a custom ArrayOfString?

Posted on 2008-10-08
5
418 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now