Solved

How to assign a value of a custom ArrayOfString?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDFBox - convert image to PDF, PDF resolution 3 117
backtracking recursion  code 19 53
simple java question 3 44
Java Options in Zimbra Server 2 46
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…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

910 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

17 Experts available now in Live!

Get 1:1 Help Now