Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I actually have been in the middle of this same thing for several weeks now and have some suggestions.

WSDL::Generator is kind of neat - but it is also a pain. I skipped the tests and installed the module itself (there is no binary portion). I hooked it just fine and it spat out a WSDL that would probably work just fine - actually it would work just fine. But it was ugly.

The solution I finally came down to was to hand code my own. I read about the WSDL spec. I also had recently been working the Net::Google which happens to have a WSDL document embedded in it. The Google WSDL is a good example of complex return types and various request data types. With this information in hand I coded my own WSDL.

The next step is making sure that using SOAP::Lite, as the server, would return the appropriately formatted XML. To debug what was getting input and output for the XML, I added the following code segments to SOAP/
# inserted at line 2281 before the "my $result =" line my $file = "/tmp/"; if (open (my $fh,">$file")) { print $fh $_[0]; warn $file; } else { die "Couldn't open: $file"; }

# inserted at line 2348 before the "return $t" line my $file = "/tmp/soap.out.xml"; if (open (my $fh,">$file")) { print $fh $t; warn $file; } else { die "Couldn't open: $file"; }

With the XML in hand, I could now make sure that my return data was getting serialized correctly. I made a special class that I blessed the data into. I then had a custom serializer that would look for that data type and when it was found, would invoke a custom package that inherited SOAP::Data to encapsulate the data correctly and did any touch ups on the XML attributes.


I found myself thinking that we really need a new WSDL generator (anybody with time is welcome). All it needs to do is take a data structure for the request, and a data structure for the response, and have a few extra fields for specifics, and spit out the WSDL. WSDL::Generator currently tries to use too much magic, and the resulting WSDL is not exactly easy to document. Maybe if I get some free cycles or some round toits I'll try and create the module.

Hope this has helped.

my @a=qw(random brilliant braindead); print $a[rand(@a)];

In reply to Re: WSDL generation for a SOAP::Lite server by Rhandom
in thread WSDL generation for a SOAP::Lite server by StoneTable

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (7)
    As of 2021-04-13 17:08 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found