Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://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/Lite.pm.
# inserted at line 2281 before the "my $result =" line my $file = "/tmp/soap.in.xml"; if (open (my $fh,">$file")) { print $fh $_[0]; warn $file; } else { die "Couldn't open: $file"; }

And
# 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.

Phew...

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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found