Hi, It doesn't appear that you are setting the required headers on the service. In general we recommend that you use the .NET client library, since it does a lot of this work automatically. There is also a wiki article that documents some tips on how to use the AdWords API with .NET if you aren't using the client library:
http://code.google.com/p/google-api-adwords-dotnet/wiki/NoClientLibrary#Option_1:_Make_a_raw_API_call Best, - Eric On Apr 6, 11:27 am, dagr8anil <[email protected]> wrote: > basically i get the authtoken, then i try to get all the campaigns via > an email address. I beleive the error is happening when > Dim page As CampaignPage = campaignService.get(New CampaignSelector) > > Protected Function getGoogleAuthToken() As String > Application.DoEvents() > Dim result As String = "" > Try > Dim web As New System.Net.WebClient() > web.Headers.Add("Content-Type", "application/x-www-form- > urlencoded") > Dim d As Byte() = > System.Text.Encoding.ASCII.GetBytes("accountType=HOSTED_OR_GOOGLE&Email=" > & Email & "&Passwd=" & Password & "&service=adwords&source=Spectrum > Inc.-IMRReporter-3.0") > Dim res As Byte() = web.UploadData("https://www.google.com/ > accounts/ClientLogin", "POST", d) > Dim sResponse As String = > System.Text.Encoding.ASCII.GetString(res) > Dim splits As String() = sResponse.Split(ControlChars.Lf) > > For Each split As String In splits > Dim subsplits As String() = split.Split("="c) > If subsplits.Length >= 2 AndAlso subsplits(0) = "Auth" > Then > result = subsplits(1) > End If > Next > > Log("googleAuthToken", "getGoogleAuthToken - Auth Code > Obtained") > > Catch ex As WebException > Const bufferLength As Integer = 2048 > Dim buffer As Byte() = New Byte(bufferLength - 1) {} > Dim count As Integer = 0 > Dim readBytes As Integer = 0 > Dim responseFromServer As String = "" > Dim reader As New > StreamReader(ex.Response.GetResponseStream()) > Do > ' Open the stream using a StreamReader for easy > access. > Try > responseFromServer = reader.ReadToEnd() > readBytes = responseFromServer.ToString.Length > ' Read the content. > Throw New Exception("googleV2009 > GgetGoogleAuthToken Error: " & responseFromServer) > Catch ex1 As Exception > Throw New Exception("googleV2009 > GgetGoogleAuthToken Error: " & ex1.Message & ex1.StackTrace) > Finally > End Try > Loop While readBytes <> 0 > reader.Close() > reader.Dispose() > End Try > > Return result > > End Function > > Public Shared Sub GetAllCampaignsForIndividualAccount(ByVal Email As > String, ByVal AccountID As String) > Application.DoEvents() > > Dim campaignService As CampaignService = New CampaignService > Try > ' Get all campaigns. > Dim page As CampaignPage = campaignService.get(New > CampaignSelector) > ' Display campaigns. > If ((Not (page) Is Nothing) AndAlso (Not (page.entries) Is > Nothing)) Then > If (page.entries.Length > 0) Then > For Each campaign As Campaign In page.entries > Log("GetAdwordsListingsV2009", "Campaign with > id = " & campaign.id & ", name = " & campaign.name & " and status = " > & campaign.status & " was found.") > 'Console.WriteLine(("Campaign with id = '{0}', > name = '{1}' and status = '{2}'" + " was found."), campaign.id, > campaign.name, campaign.status) > Next > Else > Log("GetAdwordsListingsV2009", "No campaigns were > found.") > End If > End If > Catch ex As Exception > Throw New Exception("googleV2009 > GetAllCampaignsForIndividualAccount Error: " & ex.Message & > ex.StackTrace) > > End Try > > End Sub > > On Apr 6, 10:21 am, AdWords API Advisor <[email protected]> > wrote: > > > > > Hi, > > > This error usually means that you haven't specified the headers > > correctly, perhaps because of a missing namespace. Can you post the > > SOAP XML request that produces this error? > > > Best, > > - Eric Koleda, AdWords API Team > > > On Apr 5, 4:36 pm, dagr8anil <[email protected]> wrote: > > > > Hey Mighty AdWords Guru, I am trying to migrate v13 to v2009 and i am > > > getting an error when i am trying to access the campaign service > > > selector method: Missing SoapHeader while invoking public abstract -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. 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 [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 To unsubscribe, reply using "remove me" as the subject.
