Subject: | DateTime not handled properly when Yahoo::Marketing generates XML stream |
Versions:
perl 5.8.8
SOAP::Lite 0.710.08
Yahoo::Marketing 4.30
Invalid XML is generated when attempting to create a new Campaign as the
example suggests:
http://search.cpan.org/~shenj/Yahoo-Marketing-4.30/lib/Yahoo/Marketing.pm#Example_1_-_creating_a_campaign
Using that example (with future start and end dates) causes the
following SOAP error:
SOAP FAULT!
String: XML document invalid.
Code: E1037
Message: XML document invalid.
The attached file contains the XML dump from SOAP::Lite. Note the
DateTime, startDate, and endDate nodes.
See also http://perlmonks.com/?node_id=719151
Subject: | soap.xml |
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://namespaces.soaplite.com/perl" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ysm="http://marketing.ews.yahooapis.com/V4" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext"><wsse:UsernameToken soapenc:arrayType="xsd:string2" xsi:type="soapenc:Array"><wsse:Username xsi:type="xsd:string">xxxxxxxxxxx</wsse:Username><wsse:Password xsi:type="xsd:string">xxxxxxxxxxx</wsse:Password></wsse:UsernameToken></wsse:Security><license xmlns="http://marketing.ews.yahooapis.com/V4" xsi:type="xsd:string">x11111111111111x</license><masterAccountID xmlns="http://marketing.ews.yahooapis.com/V4" xsi:type="xsd:string">1111111</masterAccountID><accountID xmlns="http://marketing.ews.yahooapis.com/V4" xsi:type="xsd:string">11111111111</accountID></soap:Header><soap:Body><addCampaign xmlns="http://marketing.ews.yahooapis.com/V4"><campaign xsi:type="tns:Campaign"><accountID xsi:type="xsd:string">11111111111</accountID><endDate xsi:type="xsd:dateTime"><local_rd_secs xsi:type="xsd:int">0</local_rd_secs><local_rd_days xsi:type="xsd:int">733705</local_rd_days><rd_nanosecs xsi:type="xsd:int">0</rd_nanosecs><locale href="#ref-74529744" xsi:type="namesp1:DateTime__Locale__en_US"/><local_c><hour xsi:type="xsd:int">0</hour><second xsi:type="xsd:int">0</second><month xsi:type="xsd:int">10</month><quarter xsi:type="xsd:int">4</quarter><day_of_year xsi:type="xsd:int">298</day_of_year><day_of_quarter xsi:type="xsd:int">25</day_of_quarter><minute xsi:type="xsd:int">0</minute><day xsi:type="xsd:int">25</day><day_of_week xsi:type="xsd:int">7</day_of_week><year xsi:type="xsd:int">2009</year></local_c><utc_rd_secs xsi:type="xsd:int">21600</utc_rd_secs><formatter xsi:type="namesp1:DateTime__Format__W3CDTF"/><tz xsi:type="namesp1:DateTime__TimeZone__OffsetOnly"><name xsi:type="xsd:int">-0600</name><offset xsi:type="xsd:int">-21600</offset></tz><utc_year xsi:type="xsd:int">2010</utc_year><utc_rd_days xsi:type="xsd:int">733705</utc_rd_days><offset_modifier xsi:type="xsd:int">0</offset_modifier></endDate><name xsi:type="xsd:string">test campaign</name><startDate xsi:type="xsd:dateTime"><local_rd_secs xsi:type="xsd:int">0</local_rd_secs><local_rd_days xsi:type="xsd:int">733340</local_rd_days><rd_nanosecs xsi:type="xsd:int">0</rd_nanosecs><locale href="#ref-74529744" xsi:type="namesp1:DateTime__Locale__en_US"/><local_c><hour xsi:type="xsd:int">0</hour><second xsi:type="xsd:int">0</second><month xsi:type="xsd:int">10</month><quarter xsi:type="xsd:int">4</quarter><day_of_year xsi:type="xsd:int">299</day_of_year><day_of_quarter xsi:type="xsd:int">25</day_of_quarter><minute xsi:type="xsd:int">0</minute><day xsi:type="xsd:int">25</day><day_of_week xsi:type="xsd:int">6</day_of_week><year xsi:type="xsd:int">2008</year></local_c><utc_rd_secs xsi:type="xsd:int">21600</utc_rd_secs><formatter xsi:type="namesp1:DateTime__Format__W3CDTF"/><tz xsi:type="namesp1:DateTime__TimeZone__OffsetOnly"><name xsi:type="xsd:int">-0600</name><offset xsi:type="xsd:int">-21600</offset></tz><utc_year xsi:type="xsd:int">2009</utc_year><utc_rd_days xsi:type="xsd:int">733340</utc_rd_days><offset_modifier xsi:type="xsd:int">0</offset_modifier></startDate><status xsi:type="tns:CampaignStatus">On</status></campaign></addCampaign><DateTime__Locale__en_US xsi:type="namesp1:DateTime__Locale__en_US" id="ref-74529744"><default_time_format_length xsi:type="xsd:string">medium</default_time_format_length><native_territory xsi:type="xsd:string">United States</native_territory><native_language xsi:type="xsd:string">English</native_language><native_complete_name xsi:type="xsd:string">English United States</native_complete_name><en_language xsi:type="xsd:string">English</en_language><id xsi:type="xsd:string">en_US</id><default_date_format_length xsi:type="xsd:string">medium</default_date_format_length><en_complete_name xsi:type="xsd:string">English United States</en_complete_name><en_territory xsi:type="xsd:string">United States</en_territory></DateTime__Locale__en_US></soap:Body></soap:Envelope>