Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I had to use SOAP.. so I started with SOAP::Lite.. a good module but very complex, especially if you have to read the internals.... oo maaan :), they are complex.
In the beginning I tried creating objects (bless {...}) and pass them to SOAP to create the xml-message, but this didn't worked well. Most of the times it created SOAP-xml that wasn't what the other side expected i.e. it was useless.
So my final solution was to use SOAP::Lite like wrapper for the communication and build the XML myself via Template-toolkit. I find the pseudo XPath expressions you can use on the result very useful.

The bad thing about this approach is that you have to read .wsdl and .xsd specs :( arggh..
One more thing to know about .wsdl. What SOAP::Lite does is it parses the .wsdl file and creates a module on the fly with all the methods, but that is. It does not go further to parse .xsd schemas, so you are on your own from there.
Another thing to be aware is if you have to preserve sessions and also use WSDL ->service() method i.e. you want to login with the first request and reuse this on subsequent one. To solve this I modified SOAP::Lite itself. At the end of SOAP::Lite::HTTP::new() add the following code :
use HTTP::Cookies; my $c = HTTP::Cookies->new(ignore_discard => 1); $self->cookie_jar( $c);
In normal SOAP::Lite usage afaik you can override this easier, but if want to use the wsdl functionality, then use this

hth

PS> If you decide to use TT like me to build the SOAP message I will recommend you to read the tutorials on : http://www.w3schools.com for XML Schema.
One thing to know 'S' in SOAP does not mean Simple, really .

In reply to Re: Starting on SOAP by rootcho
in thread Starting on SOAP by meraxes

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, 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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (5)
    As of 2020-01-29 11:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?