Google Groups Home
Help | Sign in
Message from discussion AdWords API 500 Internal Server Error
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jason H  
View profile
 More options Mar 16 2005, 5:49 pm
From: Jason H <baiy...@gmail.com>
Date: Wed, 16 Mar 2005 17:49:50 -0500
Local: Wed, Mar 16 2005 5:49 pm
Subject: Re: AdWords API 500 Internal Server Error
Never mind guys, I got it to work.

Thanks
JH

On Wed, 16 Mar 2005 13:12:48 -0800, JH <baiy...@gmail.com> wrote:

> Hello all,

> I am geting "500 Internal Server Error" when using API with XML.
> Anybody have similar experience?  I appreciate any help.  Here is my
> code for request (with login credentials removed):

> ** URL for the web service
> lcUrl =
> "https://adwords.google.com/api/adwords/v2/TrafficEstimatorService"

> ** create a placeholder for the return message
> loReturn = CREATEOBJECT("Line")
> loReturn.AddProperty("FullMessage", null)
> loReturn.AddProperty("Message", null)
> loReturn.AddProperty("lError", .F.)
> loReturn.AddProperty("ErrorMessage", null)

> *** Build the SOAP:Envelope
> lcEnvelope = ""
> lcEnvelope = lcEnvelope + [<?xml version="1.0"?>]
> lcEnvelope = lcEnvelope + [<soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns="https://adwords.google.com/api/adwords/v2">]

> lcEnvelope = lcEnvelope + [<soap:Header>]
> lcEnvelope = lcEnvelope + [<email>myemail</email>]
> lcEnvelope = lcEnvelope + [<password>mypassword</password>]
> lcEnvelope = lcEnvelope + [<token>mytoken</token>]
> lcEnvelope = lcEnvelope + [</soap:Header>]

> lcEnvelope = lcEnvelope + [<soap:Body>]
> lcEnvelope = lcEnvelope + [<estimateKeywordList>]
> lcEnvelope = lcEnvelope + [<keywordRequests>]
> lcEnvelope = lcEnvelope + [<type>Broad</type>]
> lcEnvelope = lcEnvelope + [<text>hello</text>]
> lcEnvelope = lcEnvelope + [<maxCpc>50000</maxCpc>]
> lcEnvelope = lcEnvelope + [</keywordRequests>]
> lcEnvelope = lcEnvelope + [</estimateKeywordList>]
> lcEnvelope = lcEnvelope + [</soap:Body>]

> lcEnvelope = lcEnvelope + [</soap:Envelope>]

> ** show the message sent to the server
> STRTOFILE(lcEnvelope, "xmlsend.xml")

> *** Create the XMLHttp request object
> loHTTP = CREATE("Microsoft.XMLHTTP")

> * Add request headers
>  loHTTP.Open("POST", lcURL, .T.)
>  loHTTP.setRequestHeader("Content-Type:", "text/xml")
>  loHTTP.setRequestHeader("SOAPAction:", "TrafficEstimatorService")
>  loHTTP.Send(lcEnvelope)
>  Sleep(5000)
>  loReturn.Message = ""
>  loReturn.FullMessage = ""

>  IF loHTTP.Status <> 200
>    loReturn.lError = .T.
>    loReturn.ErrorMessage  = TRANSFORM(loHTTP.Status) + " : " +
> loHTTP.StatusText
>    loReturn.FullMessage  = "<RETURN>" + TRANSFORM(loHttp.status) +
> "</RETURN>"
>    loReturn.Message   = ""
>   ELSE
>    loReturn.FullMessage  = loHTTP.responseXML.XML
>    loReturn.Message   = loReturn.FullMessage
>  ENDIF
> ENDIF

> loHTTP = .NULL.

> ** show the message returned from the server
> STRTOFILE(loReturn.FullMessage, "xmlreceive.xml")

> RETURN


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google