Hello Danial,

Thank you so much for your help. It's truly apreciated.

I tried the SOAP above, but I keep getting the same error: (500) Internal 
Server Error. I am using a valid developerToken and the authToken is 
refreshed before the call. I can confirm these two tokens work, because I 
am able to download reports via __rdxml="report definition..." using these 
tokens.

I had trouble implementing the client libraries, and I would rather have 
more control by using a direct SOAP api call. I adapted the example from 
https://code.google.com/p/google-api-adwords-dotnet/wiki/NoClientLibrary#Option_1:_Make_a_raw_API_callto
 VB.Net, using your SOAP code. It's pasted below and I would kindly ask 
if you could please take a look at it and perharps discover what's wrong.

        Dim requestXml As String = String.Format( _
        vbCr & vbLf & "<?xml version=""1.0"" encoding=""UTF-8""?>" & _
        vbCr & vbLf & "<env:Envelope 
xmlns:xsd=""http://www.w3.org/2001/XMLSchema""; " & _
        vbCr & vbLf & "                 
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""; " & _
        vbCr & vbLf & "                 
xmlns:wsdl=""https://adwords.google.com/api/adwords/mcm/v201209""; " & _
        vbCr & vbLf & "                 
xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""; " & _
        vbCr & vbLf & "                 
xmlns:ns0=""https://adwords.google.com/api/adwords/cm/v201209"";>" & _
        vbCr & vbLf & "     <env:Header>" & _
        vbCr & vbLf & "          <wsdl:RequestHeader 
xmlns=""https://adwords.google.com/api/adwords/cm/v201209"";>" & _
        vbCr & vbLf & "            <userAgent>{0}</userAgent>" & _
        vbCr & vbLf & "            <developerToken>{1}</developerToken>" & _
        vbCr & vbLf & "            <authToken>{2}</authToken>" &
        vbCr & vbLf & "          </wsdl:RequestHeader>" & _
        vbCr & vbLf & "     </env:Header>" & _
        vbCr & vbLf & "     <env:Body>" & _
        vbCr & vbLf & "          <get 
xmlns=""https://adwords.google.com/api/adwords/mcm/v201209"";>" & _
        vbCr & vbLf & "            <serviceSelector>" & _
        vbCr & vbLf & "              <ns0:fields>Login</ns0:fields>" & _
        vbCr & vbLf & "              <ns0:fields>CustomerId</ns0:fields>" & 
_
        vbCr & vbLf & "              <ns0:fields>Name</ns0:fields>" & _
        vbCr & vbLf & "            </serviceSelector>" & _
        vbCr & vbLf & "          </get>" & _
        vbCr & vbLf & "     </env:Body>" & _
        vbCr & vbLf & "</env:Envelope>", _
        "whatever", "valid_dev_token", "fresh_authToken").Trim()

        Dim serviceAddress As String = 
"https://adwords.google.com/api/adwords/mcm/v201209/ManagedCustomerService";
        Dim webRequest As WebRequest = HttpWebRequest.Create(serviceAddress)
        webRequest.Method = "POST"
        webRequest.ContentType = "text/xml; charset=utf-8"
        webRequest.Headers.Add("SOAPAction", "")
        Dim postBytes As Byte() = Encoding.UTF8.GetBytes(requestXml)
        webRequest.ContentLength = postBytes.Length

        Using strmReq As Stream = webRequest.GetRequestStream()
            strmReq.Write(postBytes, 0, postBytes.Length)
        End Using

        Try
            'Next line fails: "The remote server returned an error: (500) 
Internal Server Error."
            Dim response As WebResponse = webRequest.GetResponse()
            Dim ResponseBody As Stream = response.GetResponseStream()
        Catch ex As WebException
            Throw New ApplicationException("Could not make Api call.", ex)
        End Try

Thanks for any light you can shed on this issue.

Best Regards,
Bernardo

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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



Reply via email to