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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.
SOAP::Lite has absorbed some but not all functionality from SOAP::WSDL.

If you want to send objects (complexTypes) to a SOAP web-service use SOAP::WSDL. It works. Really.

Hand-building XML for SOAP (even using templates) is just a waste of time. That's what WSDL is for.

The only conceivably non-useless scenario I can think of for partially building SOAP messages with templates is the case where the web-service expects Document/Literal (or .NET) encoding, but at the same time allows for recursively defined complexTypes to be passed. That's quite a lot more complicated than what most developers have to deal with.

Everyone should know that "SOAP Interoperability" is a cosmic-scale joke perpetrated on the industry by hermit-like evil geniuses.

That being said, it's still much better to use SOAP::WSDL and to override its default behaviour where necessary. If you find you're using set of overrides a lot, create a sub-class of SOAP::WSDL. Simple.

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.
If you've gone down this path because SOAP::Lite / SOAP::WSDL don't yet implement the WSDL 'import' construct... that's a little drastic :-)

You have a few options:

  • Alter the web-service (if you wrote it) to "inline" the XSD schemas.
  • Save the WSDL file and modify it by hand to include the imported XSD schemas inline.
  • Get some off-the-shelf XSL to transform the WSDL such that the XSD schemas are inlined. You could even create a WSDL proxy service to automate the process.
In summary, stop doing things the hard way. ;)

-David


In reply to Re^2: Starting on SOAP by erroneousBollock
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 scrutinizing the Monastery: (3)
    As of 2020-02-24 06:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?










      Results (104 votes). Check out past polls.

      Notices?