Yes, I could create the classes by hand, and that is what I may end up doing. But I would want more than just get/set methods. I'd love to have type checking and proper interpretation of the data that came from the server.

I'd rather have this autogenerated. All the data is in the WSDL, so I shouldn't have to redo it all.

Let me explain one problem I've seen a few times which is one of the reasons that pushed over over the edge from being happy with hashes to wanting classes.

For this example, lets say I'm talking to a bug tracking system and the call returns a bug. Each bug can have 0 or more comments. If there is no comments the XML that comes back looking like

<Commments></Comments>
In which case SOAP::Lite decodes this as a string. If I get one:
<Commments><Comment>blah</Comment></Comments>
Which means Comments points to a hash {Comment => 'blah' }. If I have multiple comments:
<Commments><Comment>blah</Comment><Comment>foo</Comment></Comments>
Then I get Comments pointing to an array of hashes.

This is annoying for end users to deal with. The WSDL defines the Comments type as an array of Comment types, and the user expects it to be an array even if there is only one or zero elements.

And yes, I could write my classes to deal with this, but I'd rather not have too. If I was doing a lot of these, I'd definitely want an automated tool.

In reply to Re^2: auto generating wrapper classes for complex types defined in WSDL by cwilliams
in thread auto generating wrapper classes for complex types defined in WSDL by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.