in reply to Generate Perl Code from XML Schema?

Forgive me, but I'm a little confused as to why you'd even want to do this. Please elaborate and maybe one of us can point you towards something ... I know of a few things that might do most of the trick, but they're kinda different ...

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re: Generate Perl Code from XML Schema?

Replies are listed 'Best First'.
Re: Re: Generate Perl Code from XML Schema?
by exussum0 (Vicar) on Dec 18, 2003 at 10:40 UTC
    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..