On 04/28/2010 03:53 PM, Joshua J. Kugler wrote:
Howdy!
I have one for you to argue with Yahoo about. :)
I am making this call:
client.deleteReports([5283740314, 528350731])
It is generating this XML:
<ns1:Body>
<ns0:deleteReports>
<ns0:reportIDs>5283740314</ns0:reportIDs>
<ns0:reportIDs>5283507314</ns0:reportIDs>
</ns0:deleteReports>
</ns1:Body>
Which generates a server-side error. Pinging yahoo about this, they
tell me it should be:
<v7:reportIDs>
<v7:long>5283740314</v7:long>
<v7:long>5283507314</v7:long>
</v7:reportIDs>
Yes, they are correct. This ^^ is what it should be according to the schema.
The WSDL, in part, has this:
<xsd:element name="deleteReports">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1"
name="reportIDs"
nillable="true" type="tns:ArrayOfLong"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
The full WSDL is here:
http://developer.searchmarketing.yahoo.com/docs/V7/wsdl/V7/BasicReportSer...
Who is wrong? Suds, the WSDL, or tech support? :)
Actually, the problem is the way you are calling this. The param reportIDs is an
ArrayOfLong which is defined as containing unbounded elements named 'long'. So,
in object
terms this is:
reportIDs = { 'long':[1,2,3] }
or
reportIDs = client.factory.create('ArrayOfLong')
reportIDs.long = [3,4,5]
Something I've noticed about Yahoo is that they seem to like named
parameters. Example: their docs will say that a call, say,
getReportList, returns:
ReportInfo[] - A list of all requested reports that you have access to
in the master account.
Yeah, there names are misleading.
But the response will be a response will be a single attribute (length
1), with a name of ReportInfo, which will then be a list of all
reports. Stated another way, instead of returning a list directly, it
returns an object with an attribute of ReportInfo, which is a list. At
least, that's what it does when called via Suds.
This is trunk, R671-20100405
Thanks!
j