Hi Travis,

The short answer is that SOAPpy isn't readily compatible with the
AdWords API web services.  Our web services are Document/Literal and
SOAPpy only support RPC/Encoded web services.  It is possible to get
SOAPpy to a compatible format, but it takes a lot of manual
manipulation of the requests.  The official AdWords API Python client
library has this functionality built in, and we recommend you use the
library instead of raw SOAPpy requests.

  http://code.google.com/p/google-api-adwords-python-lib/

Best,
- Eric Koleda, AdWords API Team

On Nov 11, 3:44 pm, Travis B <[email protected]> wrote:
> Hi folks,
>
> I can't seem to set the networkTargeting field using an updateCampaign
> call on CampaignService. I'm using the SOAPpy framework in python.
>
> The WSDL shows that geoTargeting is a complexType, just like
> networkTargeting, however I am able to set the later simply using
> dictionaries.
>
> Any help is appreciated.
>
> Here's some sample code that reproduces the problem:
> BEGIN ADWORDS SAMPLE CODE>>>>>>>
> import SOAPpy
> from conf import config_dict
>
> headers = SOAPpy.Types.headerType()
>
> headers.email = config_dict['email']
> headers.password = config_dict['password']
> headers.useragent = config_dict['useragent']
> headers.developerToken = config_dict['developerToken']
> headers.applicationToken = config_dict['applicationToken']
> headers.clientEmail = config_dict['clientEmail']
>
> camp_service = SOAPpy.SOAPProxy('https://sandbox.google.com/api/
> adwords/v13/CampaignService', header=headers)
> camp_service.config.debug = 0
>
> camp_service.getAllAdWordsCampaigns(0)
> print camp_service.updateCampaign({'id': 1938, 'geoTargeting':
> {'regionTargets': {'regions': ['US-CA']}}})
> print camp_service.updateCampaign({'id': 1938, 'networkTargeting':
> ['SearchNetwork']})
> <<<<<<<<<<<<<<END ADWORDS SAMPLE CODE
>
> As shown, the second line produces:
>
> SOAPpy.Types.faultType: <Fault soapenv:Server.userException:
> java.lang.IllegalArgumentException: Can not set
> com.google.ads.netapi.services.datamodel.NetworkTarget field
> com.google.ads.netapi.services.campaign.CampaignData.networkTargeting
> to [Ljava.lang.String;: <SOAPpy.Types.structType detail at
> 17938624>: ...
>
> If I change the second call to:
> print camp_service.updateCampaign({'id': 1938, 'networkTargeting':
> {'networkTypes': ['SearchNetwork']}})
>
> I get:
> SOAPpy.Types.faultType: <Fault soapenv:Server.userException:
> java.lang.IllegalArgumentException: Can not set
> [Lcom.google.ads.netapi.services.datamodel.NetworkType; field
> com.google.ads.netapi.services.datamodel.NetworkTarget.networkTypes to
> [Ljava.lang.String;: <SOAPpy.Types.structType detail at
> 14784704>: ....
>
> -Travis

--

You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=.


Reply via email to