500 Internal Server Error

969 views
Skip to first unread message

Tom Hubbard

unread,
Mar 11, 2005, 2:55:29 PM3/11/05
to adwor...@googlegroups.com
Has anyone else seen a "500 Internal Server Error" when using the API
with Perl SOAP? I am having no problems with most of the commands I
have tried, but when I try to modify a Campaign geoTargeting, I get 500
Internal Server Error with no other explaination. I appreciate any
help. Here is the request and response (with login credentials
removed):

POST https://adwords.google.com/api/adwords/v2/CampaignService HTTP/1.1
Accept: text/xml
Accept: multipart/*
Content-Length: 1522
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:namesp3="http://namespaces.soaplite.com/perl"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><impl:email
xmlns:impl="https://adwords.google.com/api/adwords/v2">removed</impl:email><impl:password
xmlns:impl="https://adwords.google.com/api/adwords/v2">removed</impl:password><impl:useragent
xmlns:impl="https://adwords.google.com/api/adwords/v2">Perl
SOAP</impl:useragent><impl:token
xmlns:impl="https://adwords.google.com/api/adwords/v2">removed</impl:token></SOAP-ENV:Header><SOAP-ENV:Body><namesp2:updateCampaign
xmlns:namesp2="https://adwords.google.com/api/adwords/v2"><parameters
xsi:type="namesp3"><geoTargeting><metros
SOAP-ENC:arrayType="xsd:ur-type[3]">
<item>642</item><item>644</item><item>612</item></metros></geoTargeting>
<status>Paused</status><optInSearchNetwork>true</optInSearchNetwork>
<name>C897_creativepayroll_DMA_V1</name>
<optInContentNetwork>false</optInContentNetwork>
<languageTargeting><languages>en</languages></languageTargeting>
<dailyBudget>34300000</dailyBudget><endDate>2011-01-01T07:59:59.000Z</endDate>
<id>4705112</id>
<startDate>2004-11-05T02:35:43.000Z</startDate></parameters>
</namesp2:updateCampaign></SOAP-ENV:Body></SOAP-ENV:Envelope>

=====================================================================

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Connection: Close
Date: Fri, 11 Mar 2005 18:45:27 GMT
Server: GFE/1.3
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 11 Mar 2005 18:45:26 GMT
Client-Peer: 66.102.7.112:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte
Consulting cc/OU=Certification Services Division/CN=Thawte Server
CA/emailAddress=server...@thawte.com
Client-SSL-Cert-Subject: /C=US/ST=California/L=Mountain View/O=Google
Inc/CN=adwords.google.com
Client-SSL-Cipher: AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException:
No deserializer defined for array type
{http://www.w3.org/1999/XMLSchema}ur-type</faultstring><detail><ns1:stackTrace
xmlns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXException: No
deserializer defined for array type
{http://www.w3.org/1999/XMLSchema}ur-type
at
org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:267)
at
org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:399)
at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1038)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:159)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1138)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:199)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:342)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:146)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
at
org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
com.google.gse.HttpConnection.runServlet(HttpConnection.java:363)
at com.google.gse.HttpConnection.run(HttpConnection.java:313)
at
com.google.gse.DispatchQueue$WorkerThread.run(DispatchQueue.java:219)
</ns1:stackTrace></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
SOAP Fault: org.xml.sax.SAXException: No deserializer defined for array
type {http://www.w3.org/1999/XMLSchema}ur-type for input "" (Error Code
)

AdWordsAPIAdvisor

unread,
Mar 14, 2005, 6:10:07 PM3/14/05
to adwor...@googlegroups.com
Hi Tom --

Try constructing the geotargeting part of your request like so (this
should nuke some bad type info your client's sending):

my @metros = (
612,
642,
644
);

my $campaign = {
'id' => $id,
'geoTargeting' => \SOAP::Data->name('metros')->value(@metros),
%other_stuff
};

-- Brian Kennish, Google

Tom Hubbard

unread,
Mar 15, 2005, 2:18:42 PM3/15/05
to adwor...@googlegroups.com
Thanks, Brian! It works great now.

Tom

JH

unread,
Mar 16, 2005, 4:12:48 PM3/16/05
to adwor...@googlegroups.com
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

Jason H

unread,
Mar 16, 2005, 5:49:50 PM3/16/05
to adwor...@googlegroups.com
Never mind guys, I got it to work.

Thanks
JH
Reply all
Reply to author
Forward
0 new messages