Everyone,
I've talked with our engineers, and it looks like there's a bug with
the WSDLs for v3. Basically, it comes down to the endpoints being
malformed (in this case, IP addresses instead of simple hostnames). I
don't have an ETA on the fix, but in the meantime, I can offer you all
a workaround: manually override the endpoints of your requests to hit
https://{sandbox|www}.
google.com/api/adsense/v3/${SERVICE} where the
first choice is between 'sandbox' and 'www' depending on whether
you're in production, and ${SERVICE} is a singular selection of
AccountService, AdSenseForContentService, ChannelService, etc.
The process for manually overriding in PHP (when using nuSOAP) is a
matter of including a line like:
$client->setEndpoint('
https://sandbox.google.com/api/adsense/v3/
AccountService');
after you generate a client with:
$client = new soapclient($wsdl, true);
Additionally, there are a few hurdles you might encounter when
switching to v3. I'll attempt to detail a few of them here:
1. Namespaces. Your XML should include the namespace in the method
wrapper tag. For example,
<createAccount>...</createAccount>
would have been valid in v2. In v3, it must be of the form:
<ns1:createAccount xmlns:ns1="
http://www.google.com/api/adsense/
v3">...</createAccount>
2. Enumerations. The use of enclosing <value></value> tags is now
mandatory. For example,
<synServiceTypes>ContentAds</synServiceTypes>
would have been allowed in v2, but in v3 it's:
<synServiceTypes>
<value>ContentAds</value>
</synServiceTypes>
This comes up several times in many of our method calls, so just
keep an eye out for it.
If you guys have any more issues, don't hesitate to let me know.
Cheers,
Wes
AdSense API