<div dir="ltr"><div>Hi,</div><div><br></div><div>I'm using XML::Compile::WSDL11 with (what I expect is) a relatively</div><div>complex WSDL. I have no control or influence on the WSDL or service.</div><div>There are quite a few anyType elements, many of which have</div>
<div>sub-elements with complex types.</div><div><br></div><div>If I understand correctly, there's no way to tell XML::Compile how to</div><div>handle anyType elements other than the method that's the subject of my</div>
<div>remaining questions. Please let me know if there are other, simpler</div><div>approaches to handling anyType elements. For example, ideally there</div><div>would be a way to tell XML::Compile "Go ahead and dive down into those</div>
<div>complex typed sub-elements, making a good guess at the type, and Read</div><div>and Write accordingly."</div><div><br></div><div>Are there any publicly available examples of code which handle a</div><div>complex typed sub-element, i.e.,</div>
<div> XML::Compile::WSDL11->new(..., opts_rw => { any_type => \&code } ...</div><div>in Reader and Writer contexts?</div><div><br></div><div>Is a typical approach as follows (for a Reader)?</div><div><br></div>
<div>sub code {</div><div> my ($path, $node, $handler) = @_;</div><div><br></div><div> if ($path =~ /looks like this/) {</div><div> # then we know it's a particular complex type</div><div> # so parse $node using a particular complex type</div>
<div> # and return the hash</div><div> } elsif ($path =~ /looks like something else/) {</div><div> # then we know it's another complex type</div><div> # so parse $node using another complex type</div>
<div> # and return the hash</div><div> } ...</div><div>}</div><div><br></div><div>Does anyone have some good examples?</div><div><div><br></div><div>Also, what's a good approach for separating the Reader and Writer</div>
<div>aspects of any_type handlers?</div><div><br></div><div>Thanks and kind regards,</div><div>Kingsley</div></div><div><br></div></div>