• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generated Holder Types

 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
While studying "Generated Holder Types" in RMH, page 463, I've got a doubt for the example quoted in the section. In the Listing 15-50, the WSDL XML Schema defines a complexType "StringArray". The complexType definition is as follows.

<xsd:complexType name="StringArray">
<xsd:sequence>
<xsd:element name="item" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>


So the generated Holder for StringArray should look like this.

public class StringArrayHolder implements javax.xml.rpc.Holder{
public StringArray stringArray;
public StringArrayHolder(){
}
public StringArrayHolder(StringArray stringArray){
this.stringArray=stringArray;
}
}

I don't understand two points here.
1. Why the StringArrayHolder class mentioned in the book is not like above. I strongly believe that the above StringArrayHolder is correct because JAX-RPC compiler also generates a Java Bean class StringArray with a field of type String[].
2. Why the class is final while the previous example (Listing 15-49) doesn't have final qualifier.

Also, if the WSDL XML Schema defined the StringArray in the following way

<element name="StringArray" type="xsd:string" maxOccurs="unbounded"/>

then StringArrayHolder given in the book is correct i.e.

public class StringArrayHolder implements javax.xml.rpc.Holder{
public String[] value;
public StringArrayHolder(){
}
public StringArrayHolder(String[] value){
this.value=value;
}
}

Someone please clarify me.

I feel this would the question most of the people get, so apologies if the question is repeated although I don't find one like this.

Thanks and Regards,
Naren

[ June 07, 2008: Message edited by: Naren Chivukula ]
[ June 07, 2008: Message edited by: Naren Chivukula ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic