Solved

How to assign a value of a custom ArrayOfString?

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

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…
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 covers a step-by-step guide to install VisualVM launcher in eclipse.

717 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