How to parse complextype in WSDL to get basic elements in it in Java? -


i have parsed wsdl files of wsdl4j, jdom , castor libraries. now, can complex types still can not access elements in sequence.

<xs:element name="addinstancegroupsresult">     <xs:complextype>          <xs:annotation>           <xs:documentation><![cdata[               <p>output addinstancegroups call.</p>            ]]></xs:documentation>         </xs:annotation>        <xs:sequence>         <xs:element name="jobflowid" type="tns:xmlstringmaxlen256" minoccurs="0">            <xs:annotation>             <xs:documentation><![cdata[                 <p>the job flow id in instance groups added.</p>              ]]></xs:documentation>           </xs:annotation>          </xs:element>         <xs:element name="instancegroupids" type="tns:instancegroupidslist" minoccurs="0">            <xs:annotation>             <xs:documentation><![cdata[                 <p>instance group ids of newly created instance groups.</p>              ]]></xs:documentation>           </xs:annotation>          </xs:element>       </xs:sequence>     </xs:complextype>   </xs:element> 

for example, can reach addinstancegroupsresult complex type, can not basic elements in (jobflowid , instancegroupids)..

case structure.modelgroup: group modelgroup = (group)ct; contentmodelgroup contentmodel = modelgroup.getcontentmodelgroup(); int count = contentmodel.getparticlecount(); (int n=0; n< count; n++){     elementdecl elementdecl2 = (elementdecl)contentmodel.getparticle(n);       result.add(elementdecl2.getname());     resultlong.add(parseparametername(elementdecl2.getname()));     resulttype.add(elementdecl2.gettype().getname()); 

}

any suggestions? thanks..

you need like:

sequence seq = ct.getsequence(); 

then once you've done can elements in sequence elements in complex type i.e.

for(element el : seq.getelements()) {      //do stuff } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -