Subject: | Values for Simple Types are Not Properly Encoded |
Due to the way that the Service module sets up the SOAP::SOM object
SOAP::Lite's normal autotyping behaviour is subverted and the values of
simple types are not encoded. The below code demonstates this behaviour.
my $testWord = [
Yahoo::Marketing::Keyword->new( )
->text( "Test Term" )
->url( "http://www.yahoo.com/?param1=test¶m2=breakme" )
];
$keyword_proxy->addKeywords( keywords => $testWord );
Produces:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ysm="http://marketing.ews.yahooapis.com/V1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext"><wsse:UsernameToken
soapenc:arrayType="xsd:string[2]"
xsi:type="soapenc:Array"><wsse:Username
xsi:type="xsd:string">ydidit5test</wsse:Username><wsse:Password
xsi:type="xsd:string">ydid110091</wsse:Password></wsse:UsernameToken></wsse:Security><license
xmlns="http://marketing.ews.yahooapis.com/V1"
xsi:type="xsd:string">51095ab3-12ef-4fa1-3a09-a508e7b0fb0f</license><masterAccountID
xmlns="http://marketing.ews.yahooapis.com/V1"
xsi:type="xsd:string">30092347</masterAccountID><accountID
xmlns="http://marketing.ews.yahooapis.com/V1"
xsi:type="xsd:string">30092348</accountID></soap:Header><soap:Body><addKeywords
xmlns="http://marketing.ews.yahooapis.com/V1"><keywords
xsi:type="tns:ArrayOfKeyword"><Keyword><text xsi:type="xsd:string">Test
Term</text><url
xsi:type="xsd:string">http://www.yahoo.com/?param1=test¶m2=breakme</url></Keyword></keywords></addKeywords></soap:Body></soap:Envelope>
The relevant section to fix is in Service.pm:553
}elsif( my $type = $self->_simple_types( $name ) ){
return SOAP::Data->type( $type )
->name( $name )
->value( $value )
;
}