• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Generated Holder Types

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • 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 ]
 
Hey! You're stepping on my hand! Help me tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic