Hi Anash,
I follow you advise and check for the .net library and got the
following error: Failed to create accounts. Exception says "{0}"An API
exception has occurred. See ApiException and InnerException fields for
more details.
Please see my code below and the web.config file.
Try
Dim user As New AdWordsUser
user = New AdWordsUser()
Dim createAccountService As CreateAccountService =
user.GetService(AdWordsService.v201109.CreateAccountService)
Dim account As New Account()
account.currencyCode = "EUR"
account.dateTimeZone = "Europe/London"
' Create the operation.
Dim operation As New CreateAccountOperation()
operation.operator = [Operator].ADD
operation.operand = account
operation.descriptiveName = "Account created with
CreateAccountService"
' Create the account. It is possible to create multiple
accounts with
' one request by sending an array of operations.
Dim accounts As Account() = createAccountService.mutate( _
New CreateAccountOperation() {operation})
' Display the results.
If (Not accounts Is Nothing AndAlso accounts.Length > 0)
Then
Dim newAccount As Account = accounts(0)
Label2.Text = "Account with customer ID '{0:###-###-
####}' was successfully " & "created." & newAccount.customerId
Else
Label2.Text = "No accounts were created."
End If
Catch ex As AdWordsApiException
Label2.Text = "Failed to create accounts. Exception says
""{0}""" + ex.Message
End Try
web.config file
<AdWordsApi>
<!-- Change the appropriate flags to turn on SOAP logging. -->
<add key="LogPath" value="C:\"/>
<add key="LogToConsole" value="false"/>
<add key="LogToFile" value="True"/>
<add key="MaskCredentials" value="true"/>
<add key="LogErrorsOnly" value="false"/>
<!-- Set the service timeout in milliseconds. -->
<!-- <add key="Timeout" value="100000"/> -->
<!-- Fill the following values if you plan to use a proxy server.--
>
<add key="ProxyServer" value=""/>
<add key="ProxyUser" value=""/>
<add key="ProxyPassword" value=""/>
<add key="ProxyDomain" value=""/>
<!-- Use this key to change the default timeout for Ads services
(in milliseconds.)-->
<add key="Timeout" value="100000"/>
<!-- Use this key to enable or disable gzip compression in SOAP
requests.-->
<add key="EnableGzipCompression" value="true"/>
<!-- Fill the header values. -->
<add key="UserAgent" value="CMS"/>
<!--<add key="ClientEmail"
value="[email protected]"/>-->
<add key="DeveloperToken" value="xxxxxxxxxxxxxxxxx"/>
<!-- Uncomment this key and comment ClientEmail if you want to
specify
customer id instead of customer email. -->
<!--<add key="ClientCustomerId"
value="180-617-2733"/>-->
<!-- Application token is now optional and will be ignored by the
server.-->
<!-- <add key="ApplicationToken"
value="INSERT_YOUR_APPLICATION_TOKEN_HERE"/> -->
<!-- Set the Authorization method to be used with the client
library. -->
<!-- To use ClientLogin as authentication mechanism, uncomment the
following
section and comment the OAuth section below. -->
<!--<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="[email protected]"/>
<add key="Password" value="cms2011*"/>-->
<!-- Optional: uncomment this if you want to reuse an authToken
multiple
times. -->
<add key="AuthToken"
value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/
>
<!-- To use OAuth as authentication mechanism, uncomment the
following
section and comment the AuthToken section above. -->
<!-- Note: For testing purposes, you can use the OAuth consumer
key/secret
as anonymous/anonymous.-->
<!--<add key="AuthorizationMethod" value="OAuth" />
<add key="OAuthConsumerKey" value="anonymous/anonymous" />
<add key="OAuthConsumerSecret"
value="anonymous/anonymous" />-->
<!-- Uncomment this key if you want to use v13 sandbox. -->
<!-- <add key="LegacyAdWordsApi.Server"
value="https://sandbox.google.com"/> -->
<!-- Uncomment this key if you want to use AdWords API sandbox. --
>
<add key="AdWordsApi.Server" value="https://adwords-
sandbox.google.com"/>
</AdWordsApi>
On Feb 13, 10:47 pm, "Anash P. Oommen" <anash.p.oommen
[email protected]> wrote:
> Hi Orlando,
>
> I suspect the problem is a variant of the one listed
> here:http://code.google.com/p/google-api-adwords-dotnet/wiki/NoClientLibra....
> Could you post the sanitized SOAP request and response xmls here? You could
> setup Fiddler as a proxy and modify your service to set a WebProxy that
> points to Fiddler.
>
> Also, just curious, did you consider using the AdWords API .NET library for
> your project instead of relying on SOAP stubs generated by Visual Studio?
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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