Hi, I believe you took my example code too literally. The headers are only email, password, etc. You shouldn't include the SOAP envelope and header elements in your header. Also, you shouldn't use the v13 namespace unless you've already defined it.
Rather than struggle with v13 reports, have you considered switching over to v2010 reports? As we've mentioned you can't download the old scheduled reports, but there are many other benefits to the new system that you can leverage. Best, - Eric Koleda, AdWords API Team On Dec 15, 2:16 pm, cvijayarenu <cvijayar...@gmail.com> wrote: > i am trying to build the header like that but without any success. > > $soapHeaders = '<soapenv:Envelope>' > .'<soapenv:Header>' > .'<v13:email>'.$email.'</v13:email>' > .'<v13:password>'.$password.'</v13:password>' > .'<v13:clientEmail>'.$client_email.'</v13:clientEmail>' > .'<v13:useragent>'.$useragent.'</v13:useragent>' > .'<v13:developerToken>'.$developer_token.'</v13:developerToken>' > .'<v13:applicationToken>'.$application_token.'</ > v13:applicationToken>' > .'</soapenv:Header>' > .'<soapenv:Body>' > .'</soapenv:Body>' > .'</soapenv:Envelope>'; > > $namespace = 'https://sandbox.google.com/api/adwords/v13'; > > $client = new SoapClient('https://sandbox.google.com/api/adwords/v13/ > ReportService?wsdl'); > > $client->__setSoapHeaders($soapHeaders); > > This gives me > > PHP Fatal error: SoapClient::__setSoapHeaders(): Invalid SOAP header > in /srv/dev11/current/tools/scripts/marketing/google_adword_report.php > on line 46 > > Could you please show how to do this with php _setSoapHeaders > > > > > > > > AdWords API Advisor wrote: > > Hi, > > > The v13 API doesn't use a RequestHeader element to wrap the header > > values. Instead each header value is it's own SOAP header. > > > <soapenv:Envelope ...> > > <soapenv:Header> > > <v13:email>...</v13:email> > > <v13:password>...</v13:password> > > ... > > </soapenv:Header> > > <soapenv:Body> > > ... > > </soapenv:Body> > > </soapenv:Envelope> > > > Best, > > - Eric Koleda, AdWords API Team > > > On Dec 14, 6:25 pm, cvijayarenu <cvijayar...@gmail.com> wrote: > > > I am trying with this code. > > > > $options = array ('email' => $email, > > > > 'password' => $password, > > > > 'clientEmail' => $client_email, > > > > 'useragent' => $useragent, > > > > 'developerToken' => $developer_token, > > > > 'applicationToken' => $application_token > > > > ); > > > > $namespace = 'https://adwords.google.com/api/adwords/v13'; > > > > $client = new SoapClient( > > > 'https://sandbox.google.com/api/adwords/v13/ReportService?wsdl', > > > > array( > > > > 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, > > > > 'encoding' => 'utf-8' > > > > )); > > > > $header = new SoapHeader($namespace, 'RequestHeader', $options); > > > > $client->__setSoapHeaders($header); > > > > try { > > > > var_dump($client->getAllJobs()); > > > > } > > > > catch (Exception $ex) > > > > { > > > > echo $ex->getMessage(); > > > > var_dump($client->__getLastRequestHeaders()); > > > > } > > > > I get this error. > > > > The request did not contain a header named 'email'.NULL > > > > How do i set the headers in the proper way? -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en