Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

SOAP Fault: No deserializer defined for array type

by webchalkboard (Scribe)
on Aug 11, 2005 at 10:15 UTC ( [id://482894]=perlquestion: print w/replies, xml ) Need Help??

webchalkboard has asked for the wisdom of the Perl Monks concerning the following question:

Hello,
I need to enlist the infinite wisdom of the wise perl monks for yet another problem I am facing.

I am trying to interface with the google adwords API, using the SOAP::Lite perl module. I have managed to do this for a number of API calls, however the customReport call doesn't seem to work for me.

Here is the code I am using, can anyone see anything syntactically wrong with it?

my $report = { 'name' => 'test', 'aggregationType' => 'Summary', 'startDate' => $startDate, 'endDate' => $endDate, 'campaigns' => 5214135, 'customOptions' => ['AveragePosition', 'Clicks', 'Cpc', 'Ke +yword', 'AdGroupId'], }; my $req = SOAP::Data->name("customReportJob", $report); $req->attr( { 'xsi:type' => 'impl:CustomReportJob', 'xmlns:impl' => $namespace } ); my $jobId = $service->scheduleReportJob($req, @headers);

The array @headers is defined to include lots of header information such as login information.

I think the problem lies in the way I am defining the customOptions array in the report hash.

Any and all help appreciated, has anyone on here used the google adwords API for anything?

Oh I should also mention that the script can be seen running here: http://81.29.77.110/cgi-bin/reportservice-new.pl

This is the error it produces.

SOAP Fault: org.xml.sax.SAXException: No deserializer defined for arra +y type {http://www.w3.org/1999/XMLSchema}ur-type for input "" (Error +Code ) at reportservice-new.pl line 248.

Thanks,
Tom

Learning without thought is labor lost; thought without learning is perilous. - Confucius
WebChalkboard.com | For the love of art...

Replies are listed 'Best First'.
Re: SOAP Fault: No deserializer defined for array type
by gellyfish (Monsignor) on Aug 11, 2005 at 10:30 UTC

    Any chance you can show us the envelope that you client is sending - you can get this by changing your:

    use SOAP::Lite;
    to
    use SOAP::Lite +trace => 'debug';
    You might also want to set readable(1) on your SOAP::Lite object.

    /J\

Re: SOAP Fault: No deserializer defined for array type
by webchalkboard (Scribe) on Aug 11, 2005 at 11:36 UTC

    The debug thing didn't seem to make any difference, but I turned on on_debug function and that gave me loads of stuff, i've removed passwords from it, but here's the output otherwise.

    POST https://adwords.google.com/api/adwords/v2/ReportService HTTP/1.1 +Accept: text/xml Accept: multipart/* Content-Length: 1349 Content-Typ +e: text/xml; charset=utf-8 SOAPAction: "" usernamepassword Company -- + Report Service DemomLJY5JKVDelqtK74RxOt5wSummary2005-08-11T00:00:005 +214135testAveragePositionClicksCpcKeywordAdGroupId2005-08-04T00:00:00 + HTTP/1.1 500 Internal Server Error Cache-Control: private Connection +: Close Date: Thu, 11 Aug 2005 11:33:39 GMT Server: GFE/1.3 Content-T +ype: text/xml; charset=utf-8 Client-Date: Thu, 11 Aug 2005 11:33:37 G +MT Client-Peer: 216.239.59.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 Premium Server CA/email +Address=premium-server@thawte.com Client-SSL-Cert-Subject: /C=US/ST=C +alifornia/L=Mountain View/O=Google Inc/CN=adwords.google.com Client-S +SL-Cipher: AES256-SHA Client-SSL-Warning: Peer certificate not verifi +ed Client-Transfer-Encoding: chunked soapenv:Server.userExceptionorg. +xml.sax.SAXException: No deserializer defined for array type {http:// +www.w3.org/1999/XMLSchema}ur-typeorg.xml.sax.SAXException: No deseria +lizer defined for array type {http://www.w3.org/1999/XMLSchema}ur-typ +e at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(Ar +rayDeserializer.java:267) at org.apache.axis.encoding.DeserializerImp +l.startElement(DeserializerImpl.java:399) at org.apache.axis.encoding +.DeserializationContext.startElement(DeserializationContext.java:1038 +) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecord +er.java:159) at org.apache.axis.message.MessageElement.publishToHandl +er(MessageElement.java:1138) at org.apache.axis.message.RPCElement.de +serialize(RPCElement.java:199) at org.apache.axis.message.RPCElement. +getParams(RPCElement.java:342) at org.apache.axis.providers.java.RPCP +rovider.processMessage(RPCProvider.java:146) at org.apache.axis.provi +ders.java.JavaProvider.invoke(JavaProvider.java:319) at org.apache.ax +is.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.axi +s.handlers.soap.SOAPService.invoke(SOAPService.java:450) at org.apach +e.axis.server.AxisServer.invoke(AxisServer.java:285) at org.apache.ax +is.transport.http.AxisServlet.doPost(AxisServlet.java:637) at javax.s +ervlet.http.HttpServlet.service(HttpServlet.java:709) at org.apache.a +xis.transport.http.AxisServletBase.service(AxisServletBase.java:301) +at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at co +m.google.gse.HttpConnection.runServlet(HttpConnection.java:393) at co +m.google.gse.HttpConnection.run(HttpConnection.java:334) at com.googl +e.gse.DispatchQueue$WorkerThread.run(DispatchQueue.java:219)

    Thanks,
    Tom

    Learning without thought is labor lost; thought without learning is perilous. - Confucius
    WebChalkboard.com | For the love of art...

      That's not really what I wanted to see - I really wanted the XML of the SOAP envelope that you are sending, not what the service is returning (apparently stripped of the XML). Try setting  +trace => 'all' and the readable(1) and picking the pertinent bits out.

      /J\

Re: SOAP Fault: No deserializer defined for array type
by webchalkboard (Scribe) on Aug 11, 2005 at 13:09 UTC

    Hi there,
    I wasn't sure if that would be any help to you. I've added the +trace => 'debug' and readable(1) and it doesn't seem to do anything. I will keep playing around with it and read a few docs. Thanks anyway.

    Learning without thought is labor lost; thought without learning is perilous. - Confucius
    WebChalkboard.com | For the love of art...

      Yes it will, if you are running this as a CGI program as it appears then you will have the output in the error log of the web server. Alternatively and more sensibly you could try to run this as a standalone console program.

      /J\

Re: SOAP Fault: No deserializer defined for array type
by webchalkboard (Scribe) on Aug 12, 2005 at 12:37 UTC

    Right I have checked the errorlog and found some interesting debug information. Here are the bits that look the most interesting.

    <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Header> <impl:email xmlns:impl="https://adwords.google.com/api/adwords/v2" +>me@ourcompany.com</impl:email> <impl:password xmlns:impl="https://adwords.google.com/api/adwords/ +v2">mypassword</impl:password> <impl:useragent xmlns:impl="https://adwords.google.com/api/adwords +/v2">Existem -- Report Service Demo</impl:useragent> <impl:token xmlns:impl="https://adwords.google.com/api/adwords/v2" +>mLJY5JKVDelqtK74RxOt5w</impl:token></SOAP-ENV:Header> <SOAP-ENV:Body> <scheduleReportJob xmlns=""> <customReportJob xmlns:impl="https://adwords.google.com/api/adwo +rds/v2" xsi:type="impl:CustomReportJob"> <aggregationType>Summary</aggregationType> <endDate>2005-08-11T23:59:59</endDate> <campaigns>5214135</campaigns> <name>test</name> <customOptions SOAP-ENC:arrayType="xsd:ur-type[5]"> <item>AveragePosition</item> <item>Clicks</item> <item>Cpc</item> <item>Keyword</item> <item>AdGroupId</item></customOptions> <startDate>2005-08-11T00:00:00</startDate> </customReportJob> </scheduleReportJob> </SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Ser +ver Error

    Do you think it's this bit which is causing the problem?

    SOAP-ENC:arrayType="xsd:ur-type[5]"

    Here is the error response I am getting.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:// +www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><fau +ltcode>soapenv:Server.userException</faultcode><faultstring>org.xml.s +ax.SAXException: No deserializer defined for array type {http://www.w +3.org/1999/XMLSchema}ur-type</faultstring><detail><ns1:stackTrace xml +ns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXException: No des +erializer defined for array type {http://www.w3.org/1999/XMLSchema}ur +-type at org.apache.axis.encoding.ser.ArrayDeserializer.onStartEleme +nt(ArrayDeserializer.java:267) at org.apache.axis.encoding.DeserializerImpl.startElement(Dese +rializerImpl.java:399) at org.apache.axis.encoding.DeserializationContext.startElemen +t(DeserializationContext.java:1038) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventR +ecorder.java:159) at org.apache.axis.message.MessageElement.publishToHandler(Mes +sageElement.java:1138) at org.apache.axis.message.RPCElement.deserialize(RPCElement.j +ava:199) at org.apache.axis.message.RPCElement.getParams(RPCElement.jav +a:342) at org.apache.axis.providers.java.RPCProvider.processMessage(R +PCProvider.java:146) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProv +ider.java:319) at org.apache.axis.strategies.InvocationStrategy.visit(Invocat +ionStrategy.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(SOAPServic +e.java:450) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:28 +5) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServl +et.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709 +) at org.apache.axis.transport.http.AxisServletBase.service(Axis +ServletBase.java:301) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802 +) at com.google.gse.HttpConnection.runServlet(HttpConnection.jav +a:393) at com.google.gse.HttpConnection.run(HttpConnection.java:334) at com.google.gse.DispatchQueue$WorkerThread.run(DispatchQueue +.java:219) </ns1:stackTrace></detail></soapenv:Fault></soapenv:Body></soapenv:Env +elope>

    There is more about the error response if that's any help.

    Learning without thought is labor lost; thought without learning is perilous. - Confucius
    WebChalkboard.com | For the love of art...

      Hi there,

      I've done a bit of exploration and found a solution.

      I need to change my $report hash to something like this:

      my $report = { 'name' => 'test', 'aggregationType' => 'Summary', 'startDate' => $startDate, 'endDate' => $endDate, 'campaigns' => 5214135, 'customOptions' => SOAP::Data->name(customOptions => qw/AveragePosition Clicks Cpc Keyword AdGroupId/), };

      Thanks for the help.

      Learning without thought is labor lost; thought without learning is perilous. - Confucius
      WebChalkboard.com | For the love of art...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://482894]
Approved by aukjan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found