How to enable soap request and response logging in Adwords API.

562 views
Skip to first unread message

mounica...@ggktech.com

unread,
Aug 4, 2016, 6:29:18 AM8/4/16
to AdWords API Forum
In my project, we are not using app.config, instead we are initializing the config properties while declaring the AdWords User like this.

_config = new AdWordsAppConfig();
            _config.UserAgent = configData[Constants.Westpac.Social.GOOGLE_USER_AGENT].ToString();
            _config.ClientCustomerId = configData[Constants.Westpac.Social.GOOGLE_CLIENT_CUSTOMER_ID].ToString();
            _config.DeveloperToken = configData[Constants.Westpac.Social.GOOGLE_DEVELOPER_TOKEN].ToString();
            _config.OAuth2ClientId = configData[Constants.Westpac.Social.GOOGLE_OAUTH2_CLIENT_ID].ToString();
            _config.OAuth2ClientSecret = configData[Constants.Westpac.Social.GOOGLE_OAUTH2_CLIENT_SECRET].ToString();
            _config.OAuth2RefreshToken = configData[Constants.Westpac.Social.GOOGLE_OAUTH2_REFRESH_TOKEN].ToString();
            _config.OAuth2Mode = OAuth2Flow.APPLICATION;
           
            //Initialize the AdWordsUserListService
            _adWordUser = new AdWordsUser(_config);
            _adWordUserListService = (AdwordsUserListService)_adWordUser.GetService(AdWordsService.v201605.AdwordsUserListService);

Now i want to log the SOAP Request and Reponse of AdWords API. I know, that we can log by adding few keys and listeners to App.config. But we do not want to use app.config. Is there any possibility to log them using code. Also, i want to log to database. Any examples would be helpful.

Vishal Vinayak (Adwords API Team)

unread,
Aug 4, 2016, 3:19:50 PM8/4/16
to AdWords API Forum
Hi Mounica,

Unfortunately, there is no way to log the SOAP calls without using the App.config. In case you decide to use App.config, your best option to log into the database would be to read the output log file, parse the XML request and response objects as necessary and insert relevant fields into a database table. 

Regards,
Vishal, AdWords API Team

mounica...@ggktech.com

unread,
Aug 5, 2016, 2:50:05 AM8/5/16
to AdWords API Forum
Hi Vishal,

Isn't there any method that the .NET SDK for Adwords would provide me to get the request and response objects?

Joyce Lava

unread,
Aug 5, 2016, 3:58:50 AM8/5/16
to AdWords API Forum
Hi Mounica,

There is no way I am aware of in AdWords API and its services that will return the request and response objects. Also, as informed by Vishal, SOAP calls in the API can be logged only by using the App.config file.

Thanks,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages