It would be a huge help for NoClientLibrary .NET developers if you could please outline<http://code.google.com/p/google-api-adwords-dotnet/wiki/NoClientLibrary>where to add the override to GetWebRequest method w/n the generated stub code in order to pass along the OAuth token in the HTTP header, at the time of setting the SOAP headers.
Protected Overrides Function GetWebRequest(uri As Uri) As WebRequest Dim request As WebRequest = MyBase.GetWebRequest(uri) Dim oAuthHeader As String = ContextStore.GetValue("OAuthHeader").ToString() If Not String.IsNullOrEmpty(oAuthHeader) Then request.Headers("Authorization") = oAuthHeader End If Return request End Function Thanks in advance for your assistance, DK On Monday, October 14, 2013 10:10:03 AM UTC-4, Danial Klimkin wrote: > > Hello Danil, > > > From the request it looks like you are sending AuthToken string. Are you > also sending OAuth HTTP header? > > > -Danial, AdWords API Team. > > > On Tuesday, October 8, 2013 3:58:17 PM UTC+4, Danil Ivanov wrote: >> >> Hi all. >> I make a request to API CustomerService and I get a >> response AuthenticationError.OAUTH_TOKEN_HEADER_INVALID. >> But request ReportDefinitionService is successful. I used production. My >> developer_token approved (not for this account). >> >> What am I doing wrong? Can you help me, please? >> >> Curl: >> >>> curl --header "Content-Type: application/soap+xml" --data @customer.xml >>> https://adwords.google.com/api/adwords/mcm/v201306/CustomerService?wsdl >> >> >> customer.xml: >> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <soap:Envelope >>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" >>> xmlns="https://adwords.google.com/api/adwords/mcm/v201306"> >>> <soap:Header> >>> <RequestHeader> >>> <authToken>my_token</authToken> >>> <userAgent>danilphd</userAgent> >>> <developerToken>mydev_token</developerToken> >>> <clientCustomerId>111-111-1111</clientCustomerId> >>> </RequestHeader> >>> </soap:Header> >>> <soap:Body> >>> <get></get> >>> </soap:Body> >>> </soap:Envelope> >> >> >> Response: >> >>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> >>> <soap:Header> >>> <ResponseHeader xmlns:ns2=" >>> https://adwords.google.com/api/adwords/cm/v201306" >>> xmlns=" >>> https://adwords.google.com/api/adwords/mcm/v201306"> >>> >>> <ns2:requestId>0004e8391ab899400ade104600003d18</ns2:requestId> >>> <ns2:serviceName>CustomerService</ns2:serviceName> >>> <ns2:methodName>get</ns2:methodName> >>> <ns2:operations>0</ns2:operations> >>> <ns2:responseTime>192</ns2:responseTime> >>> </ResponseHeader> >>> </soap:Header> >>> <soap:Body> >>> <soap:Fault> >>> <faultcode>soap:Server</faultcode> >>> <faultstring>[AuthenticationError.OAUTH_TOKEN_HEADER_INVALID >>> @ ; trigger:'<null>']</faultstring> >>> <detail> >>> <ApiExceptionFault xmlns=" >>> https://adwords.google.com/api/adwords/mcm/v201306" >>> xmlns:ns2=" >>> https://adwords.google.com/api/adwords/cm/v201306"> >>> >>> <ns2:message>[AuthenticationError.OAUTH_TOKEN_HEADER_INVALID @ ; >>> trigger:'<null>'] >>> </ns2:message> >>> >>> <ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type> >>> <ns2:errors xmlns:xsi=" >>> http://www.w3.org/2001/XMLSchema-instance" >>> xsi:type="ns2:AuthenticationError"> >>> <ns2:fieldPath></ns2:fieldPath> >>> <ns2:trigger><null></ns2:trigger> >>> >>> <ns2:errorString>AuthenticationError.OAUTH_TOKEN_HEADER_INVALID</ns2:errorString> >>> >>> <ns2:ApiError.Type>AuthenticationError</ns2:ApiError.Type> >>> >>> <ns2:reason>OAUTH_TOKEN_HEADER_INVALID</ns2:reason> >>> </ns2:errors> >>> </ApiExceptionFault> >>> </detail> >>> </soap:Fault> >>> </soap:Body> >>> </soap:Envelope> >> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.