When more than a single wsdl is passed to the wsdl2h preprocessor the generated
header file is possibly missing some build-in type declarations. This apparently
happens in rare occasions only, if one or more message parts consist of a build-in
type rather than a complex type defined elsewhere. Eg. the build-in type base64Binary
triggers this behaviour. If a message looks like this:
<wsdl:message name="getInfo">
<wsdl:part name="part1" element="tns:getInfoResult"/>
<wsdl:part name="part2" type="xsd:string"/>
<wsdl:part name="part3" type="xsd:base64Binary"/>
</wsdl:message>
and more than one file is passed to wsdl2h then every file is parsed separately
as member of an imports list contained in a generic definitions instance. The
header is then generated from this generic instance. When collecting the types
used, they are are gathered separately in the builtinTypes member of each of
the wsdls definitions instance. These different builtinTypes lists however
are not accumulated into their appropriate parents definitions instance.
Therefore at the end of the collection process some built-in types used by child
wsdls are missing in the parent definitions instance. These types are therefore
not serialized which leads to a compiler error.
I fixed this issue by adding the child builtinTypes of a schema to their parent
during the collection process. I added same fix for the according builtinElements
and builtinAttributes lists.
This gives me the desired result, however as the internal processing of wsdl2h is
quite complex I'm not quite sure that there are no side-effects.
I attached the patchfile and a sample wsdl. To reproduce the effect just call
wsdl2h b64.wsdl -o single.h
wsdl2h b64.wsdl b64.wsdl -o multiple.h
and compare the output of both commands.
diff single.h multiple.h
Of course you would not pass the same file twice, but the effect is just the same
with different wsdls. I kept it simple for the ease of demonstration in this ticket.
Thanks for the feedback and the patch. Version 2.8.71 is fixed.