I am trying to write an application to use the Google AdWords API. I am
using the MS soaptoolkit v3.0 and VB6 and I can sucessfully communicate
with the API in most cases however when I try to use the functions such
as:
--XML-----
<element name="getAdGroupStats">
<complexType>
<sequence>
<element name="campaignId" type="xsd:int"/>
<element maxOccurs="unbounded" name="adGroupIds" type="xsd:int"/>
<element name="start" type="xsd:dateTime"/>
<element name="end" type="xsd:dateTime"/>
</sequence>
</complexType>
</element>
--------
I cannot seem to be able to pass more than one value in the adGroupIds
parameter. I have tried in various ways including using an
IXMLDOMNodeList but VB just tells me:
--Error Msg-----
SoapMapper:Converting data for SoapMapper failed inside the typemapper
HRESULT=0x80020005: Type mismatch.
- SoapMapper:Saving SoapMapper campaignIds failed ... ect ...
-------
Here is the code for one of the methods I have tried:
--VB6Code-----
Dim strReturned As IXMLDOMSelection
Dim Dom2 As New DOMDocument30
Dim list As IXMLDOMNodeList
Dim CurrentDate As Date
Set sc = CreateObject("MSSOAP.SoapClient30")
Call
sc.MSSoapInit("https://adwords.google.com/api/adwords/v2/CampaignService?wsdl",
"", "", "")
Set sc.HeaderHandler = New ClientHeaderHandler
CurrentDate = Now()
Dom2.LoadXml
"<getCampaignStats><campaignIds>1234567</campaignIds><campaignIds>1234568</campaignIds></getCampaignStats>"
Set list = Dom2.documentElement.childNodes
Set strReturned = sc.getCampaignStats(list, CurrentDate,
CurrentDate)
-------
Anybody know what I am doing wrong?
Thanks.
Unfortunately it appears I accidentally posted the wrong WSDL data in
my original post, it should have read:
-------
<element name="getCampaignStats">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="campaignIds"
type="xsd:int"/>
<element name="start" type="xsd:dateTime"/>
<element name="end" type="xsd:dateTime"/>
</sequence>
</complexType>
</element>
-------
If you have anymore ideas they would be greatly appreciated.