Closed robnewton closed 10 years ago
My mistake. I was defining the wrong return type.
Once I changed
SchemaComponent comp = complexType.getSequence();
to
Sequence sequence = complexType.getSequence();
I was able to access the elements just as I expected.
Now the sample code
WSDLParser parser = new WSDLParser();
Definitions defs = parser.parse(wsdl);
for (Schema schema : defs.getSchemas()) {
System.out.println("Schema");
for (ComplexType complexType : schema.getComplexTypes()) {
System.out.println(" " + complexType.getName());
Sequence sequence = complexType.getSequence();
for (Element e : sequence.getElements()) {
System.out.println(" " + e.getName() + " (" + e.getBuildInTypeName() + ")");
}
}
}
Here's the output now.
fahrenheitToCelsiusResponse
celcius (string)
errors (null)
Thanks for docummenting and closing the issue!
You're welcome and nice work on the project!
Thanks, Rob
Sent from my iPhone
On Mar 4, 2014, at 2:55 AM, Thomas Bayer notifications@github.com wrote:
Thanks for docummenting and closing the issue!
Reply to this email directly or view it on GitHubhttps://github.com/membrane/soa-model/issues/211#issuecomment-36599899 .
I am having trouble finding a way to get to the list of elements within a complex type's sequence. Is there a method available to get them? I cannot find it.
For instance, in the following example, I am trying to get an array of the complexType elements: celcius, and errors.
The following example complex type from within a WSDL schema I am parsing:
My simple parsing code:
As you can see from the output, the particles variable is put into the ToString() and contains the elements that I am trying to get.
When browsing the code for the library I can see that the particles variable is what holds the data I'm looking for. I also see a getElements() method in ModelGroup.groovy that appears to return what I'm looking for but I am not seeing it in the 1.4 distribution.