That is indeed possible, but I wanted to use the classloader.
2011/2/22 Willem Jiang <[email protected]>
> On 2/21/11 10:38 PM, Koen Thomeer wrote:
>
>> Sorry for bothering:
>> the first two issues have been resolved: simple Java errors.
>>
>> The third thing is a little bit complex:
>>
>> The instance OriginalDataType has three values: Id, Randomize and
>> InputData.
>> They are all set up: no problem.
>>
>> The instance EncodeRequesType has two values: applicationName and
>> "OriginalDataType".
>>
>> How do I put an instance in another instance?
>>
>> Something like this?
>> Method m2 = EncodeRequestType.getClass().getMethod("getOriginalData.add",
>> Object.class);
>> m2.invoke(EncodeRequestType, OriginalDataType);
>> (It doesn't work.)
>>
> As you already get the class file, can you just use new EncodeRequestType()
> to create the object that you want ?
>
>
>
>
>> The EncodeRequestType.java file from wsdl2java says this;
>> /**
>> * Gets the value of the originalData property.
>> *
>> *<p>
>> * This accessor method returns a reference to the live list,
>> * not a snapshot. Therefore any modification you make to the
>> * returned list will be present inside the JAXB object.
>> * This is why there is not a<CODE>set</CODE> method for the
>> originalData property.
>> *
>> *<p>
>> * For example, to add a new item, do as follows:
>> *<pre>
>> * getOriginalData().add(newItem);
>> *</pre>
>> *
>> *
>> *<p>
>> * Objects of the following type(s) are allowed in the list
>> * {@link OriginalDataType }
>> *
>> *
>> */
>> public List<OriginalDataType> getOriginalData() {
>> if (originalData == null) {
>> originalData = new ArrayList<OriginalDataType>();
>> }
>> return this.originalData;
>> }
>>
>>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>
--
*Koen Thomeer*, MD, MSc
http://koen.thomeer.be