cerror has asked for the wisdom of the Perl Monks concerning the following question:
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:
Thanks!
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:
The wsdl file defines setUserOffers like so:sub changePkg { my ($username, $pkg) = @_; my $client = connectXrc(); my $result = $client->setUserOffers( XRC_CLIENTID, $username, $pkg); }
And ArrayOfInt like this:<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>
My test, which fails, is very simple. The relevant parts look 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>
Everything works except offerIDs (@pkg). My XML that's passed to the server defines it like this:my @pkg = 5544; print "username: "; my $username = <STDIN>; chomp($username); XRC::changePkg($username, @pkg);
However, it always fails with this fault:<offerIDs xsi:type="types:ArrayOfInt">5544</offerIDs>
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?<faultstring>org.xml.sax.SAXException: Found character data inside an +array element while deserializing</faultstring>
Thanks!
- cerror
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: SOAP::Lite and XML
by rhesa (Vicar) on Jul 03, 2007 at 02:25 UTC | |
by cerror (Scribe) on Jul 03, 2007 at 02:40 UTC | |
Re: SOAP::Lite and XML
by ForgotPasswordAgain (Priest) on Jul 03, 2007 at 08:31 UTC | |
Re: SOAP::Lite and XML
by philcrow (Priest) on Jul 03, 2007 at 13:18 UTC |
Back to
Seekers of Perl Wisdom