Hello Monks,

I know I'm kind of rehashing an old node, but I've made some progress and would like some advice on how to proceed from here. I think the problem I've been having may be in the way SOAP::Lite serializes the array, though I may be mistaken. Here's the relevant offending code from my XRC module as it is now:
sub changePkg { my ($username, $pkg) = @_; my $client = connectXrc(); my $result = $client->setUserOffers( XRC_CLIENTID, $username, $pkg); }
The wsdl file defines setUserOffers like so:
<wsdl:message name="setUserOffersRequest"> <wsdl:part name="clientID" type="xs:int"/> <wsdl:part name="username" type="xs:string"/> <wsdl:part name="offerIDs" type="types:ArrayOfInt"/> </wsdl:message>
And ArrayOfInt like this:
<xs:complexType name="ArrayOfInt"> <xs:annotation><![CDATA[ A SOAP encoded array of the xs:int type. ]]></xs:annotation> <xs:complexContent> <xs:restriction base="soapenc:Array"> <xs:attribute ref="soapenc:arrayType" wsdl:arrayType="xs:int[]"/ +> </xs:restriction> </xs:complexContent> </xs:complexType>
My test, which fails, is very simple. The relevant parts look like this:
my @pkg = 5544; print "username: "; my $username = <STDIN>; chomp($username); XRC::changePkg($username, @pkg);
Everything works except offerIDs (@pkg). My XML that's passed to the server defines it like this:
<offerIDs xsi:type="types:ArrayOfInt">5544</offerIDs>
However, it always fails with this fault:
<faultstring>org.xml.sax.SAXException: Found character data inside an +array element while deserializing</faultstring>
I know I'm not actually passing a string, so I'm not really certain what's going on here. Google gave me some ideas, which I tested, but nothing ultimately came of it. Does anyone else have a suggestion?

Thanks!
- cerror

In reply to SOAP::Lite and XML by cerror

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, details, 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, summary, 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.