STUBMAKER(1p)

πŸ“¦
version 1.27 Β· 2 versions
  • 1.27 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.27 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… STUBMAKER(1p) β€” the girlies' guide to generating client stubs ✨

okay so bestie, welcome to stubmaker, a page from the User Contributed Perl Documentation corner of the manual. what does it do? it generates client stubs from a WSDL file. that's the whole vibe. that's the assignment. periodt. πŸŽ€


✨ OPTIONS ✨

  • -d <dirname> β€” tells it where you want the output files to land. the directory has to already exist, though β€” it will NOT make it for you, it's not your mom. 🫢
  • -v β€” turns on "verbose" output while the code stub generation is happening. ngl, the program doesn't output much to begin with, but if you must see something printed to the console, this is the flag that does it. πŸ’€
  • --help β€” prints a short help message. short. brief. a little snack.
  • --version β€” prints out the current version of stubmaker. slay.

🌸 STUB FILES 🌸

πŸ¦‹ STUB SUBROUTINES πŸ¦‹

the class or package that stubmaker makes for you is actually a sub-class of the core SOAP::Lite object. which means β€” and this is the iconic part β€” every method you can call on SOAP::Lite, you can also call on the generated stubs. all of them. no cap. πŸ‘‘

so like, say you wanted readable output from your generated stub? just call readable(1) on the stub's instance. easy. see the example below, bestie. ⬇️

these next subroutines are the ones that are unique to generated stub classes, and they exist to help you control and configure the stub class itself:

  • want_som(boolean) β€” when you set it to 1, SOAP::Lite will hand you back SOAP::SOM objects whenever you invoke a method on a remote service. this is very helpful when you need to check whether the return value is a SOAP::Fault or not. when you set it to 0, SOAP::Lite just returns the return value of the method. that's it, that's the toggle. πŸŽ€

πŸ”₯ EXAMPLES πŸ”₯

🌈 Invoking stubmaker from the command line

> perl stubmaker http://www.xmethods.net/sd/StockQuoteService.wsdl

Or:

> perl "-MStockQuoteService qw(:all)" -le "print getQuote('MSFT')"

πŸ’œ Working with stub classes

Command line:

> perl stubmaker http://ws1.api.re2.yahoo.com/ws/soap-demo/full.wsdl

File:

> use full;
> use SOAP::Lite +trace => qw( debug );
> my $f = new full;
> $f->use_prefix(0);
> $f->readable(1);
> $f->want_som(1);
> $som = $f->echoViaBase64("foo");

Copyright (C) 2000-2005 Paul Kulchenko. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

bestie this is free software, not free-for-all β€” the same terms as Perl itself, okay? respect the license. 🫢

and that's the whole page, mwah. πŸ’– this was perl v5.36.0, dated 2023-03-01, and it ate, no crumbs. go generate some stubs, main character. 🌟

πŸ“¦ where this page comes from