Hi, Looks like you are clearing out previous headers each time your define a new one. So, by the time "applicationToken" is loaded, the "email" header is already overwritten. There's an example for setting multiple request headers at http://stackoverflow.com/questions/589228/sending-a-soap-header-with-a-wsdl-soap-request-with-php.
--Stan On Jun 23, 12:12 pm, jrj10 <[email protected]> wrote: > I am using PHP's built in SOAP extension. My test code works in > production and I can pull down campaign info from our live account. > The same code fails when attempting to work in the Google Sandbox. > (Error is: The request did not contain a header named 'email'.) > > Additionally, I can take the credentials I'm using for the sandbox and > plug them into one of Google's NuSOAP based examples and that works > just fine. So, I know I have the sandbox credentials correct. > > Here's the code I'm trying (minus the login credentials) > . > . > . > $namespace = 'https://sandbox.google.com/api/adwords/v13'; > $campWSDL = $namespace.'/CampaignService?wsdl'; > > $client = new SoapClient( $campWSDL, array("trace"=>1) ); > > $headers[] = new SoapHeader($namespace, 'email', $email); > $headers[] = new SoapHeader($namespace, 'password', $password); > $headers[] = new SoapHeader($namespace, 'clientEmail', $clientEmail); > $headers[] = new SoapHeader($namespace, 'useragent', $useragent); > $headers[] = new SoapHeader($namespace, 'developerToken', > $developerToken); > $headers[] = new SoapHeader($namespace, 'applicationToken', > $applicationToken); > > $client->__setSoapHeaders($headers); > > $getAllAdWordsCampaigns = array('getAllAdWordsCampaigns' => array > ('dummy'=>'0')); > $result = $client->__soapCall('getAllAdWordsCampaigns', > $getAllAdWordsCampaigns); > print_r($result); > > Any suggestions would be greatly appreciated. > > Thanks, > Joe --~--~---------~--~----~------------~-------~--~----~ 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=en -~----------~----~----~----~------~----~------~--~---
