Having done a bit of WSDL work in java w/ SOAP...

While the author of a webservice can generate a WSDL file from java, the client may not have nor get a java file representing the soap call typeor return type. It's a matter of convenience and accuracy in recreating the class as it was intended. It's not the only way of using SOAP, but if you wish to use dynamic proxies, going from WSDL -> java (or perl or whatever) is a lot shorter to write.

Typically, w/ dynamic proxy, you create and use objects that work remotely and passed back in fashion as if they were locally there. SOAP would create the objects for you via some factory, sometimes off of WSDL.

example from SOAP::Lite

use SOAP::Lite; $service = SOAP::Lite -> uri('urn:QuotationService') -> proxy('http://localhost:8080/soap/servlet/rpcrouter' +); $result = $service -> getAllQuotations() -> result(); $i = -1; while ( ref $result->[++$i] ) { print "$result->[$i]{'text'} ($result->[$i]{'author'})\n"; }

If the author of SOAP::Lite, for perl6, wants to make hashes that cannot be assigned arbitrary keys, or for speed reasons, create classes from pre-existing object files, may need to pregenerate the perl. I'm still fuzzy on how perl6 works, so forgive if I use the wrong terminology :) I'm sure there can be a way of generating objects and later choosing to lock down their attributes.

So anyway, having pre-generated code for wsdl is always useful for soap writters (toolkit or end user) who would need type clarification for knowing what's accessible and what doesn't exist. After all, what you pay for in dynamic-ness, you save by apriori knowledge especially in intense applications.


Play that funky music white boy..

In reply to Re: Re: Generate Perl Code from XML Schema? by exussum0
in thread Generate Perl Code from XML Schema? by ayvazj

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.