Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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":



  • 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? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2023-09-23 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?