Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I'm new to SOAP::WSDL, and am having some trouble specifying namespaces in the SOAP header. Does anyone have an example of how this is done?

(I'm trying to call an addObject method which has, as one of its arguments, a complex type prefixed in a second namespace, like this):

<addObject> <ns1:userid>1</ns1:userid> <ns1:userprofile> <ns2:first>Bob</ns2:first> <ns2:last>Smith</ns2:last> </ns1:userprofile> </addObject>

I can't seem to find a way to specify both the ns1 and ns2 namespaces, and the Axis2 server on the other end keeps complaining that it doesn't recognize the first parameter in the second namespace (in my example, 'ns2:first'): 'Unexpected subelement first'.

Also, one of my favorite features in SOAP::Lite is the +trace => 'all' option -- is there a way to turn trace on for SOAP::WSDL so that I can see the actual SOAP transactions that are sent and returned?

In general, I'm unhappy with the level of control that I seem to have lost, using the SOAP::WSDL class libraries generated by wsdl2perl.pl, probably because I don't really understand how they work. The getObject method (which has no complex parameters) worked great, but now that the addObject() method fails, I don't seem to have any tools to remedy the situation.

Even so, if there is any way I can avoid going back to rolling my own Type and Interface libraries, I would very much prefer to keep using SOAP::WSDL. This service that I need to connect to has a lot more types and methods than previous web services I have used.


No good deed goes unpunished. -- (attributed to) Oscar Wilde

In reply to Specifying SOAP::WSDL namespaces by ptum

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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 taking refuge in the Monastery: (15)
    As of 2014-07-31 16:08 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (249 votes), past polls