Jeff,

Thank you for your response. It was the first one you said. (namespace
on the validateReportJob tag in my case). This really helped me out
with my project, as it would have taken forever for me to ever figure
that one out.

Thanks again,
Simon


On Jun 25, 12:44 pm, AdWords API Advisor
<[email protected]> wrote:
> HelloSimon,
>
>  That's an interesting project to undertake.
>
>  When I've seen that sort of failure in the past, it's usually because
> the SOAP request doesn't have either the proper namespace set on the
> <scheduleReportJob> element, or the xsi:type set on the <job> element.
> An example of what should be a valid XML request for the
> scheduleReportJob() SOAP call can be found at
>
>  http://code.google.com/p/adwords-api-xml-samples/source/browse/trunk/...
>
> Cheers,
> -Jeff Posnick, AdWords API Team
>
> On Jun 25, 3:11 am,SimonSturmer <[email protected]> wrote:
>
> > I am having trouble writing a script to use SOAP to retrieve my report
> > data. There are many examples on how to do this in .NET and other
> > languages, but not in WSH (VBScript/JScript).
>
> > The goal is to schedule this script to automatically pull the report
> > data from AdWords API once per day and save it to a file/database.
>
> > Below is my script so far. I am using "MSXML2.ServerXMLHTTP" to post
> > the XML to the API URL instead of using the MSSOAP components, mainly
> > because I could not find enough documentation / examples on how to do
> > it with the SOAP library.
>
> > Any help or direction to a good resource or example would be much
> > appreciated.
>
> > Thanks,
> >Simon
>
> > ========JSCRIPT CODE BELOW========
> > var obj_params = {
> >         email:'[email protected]',
> >         password:'MySecretPassword',
> >         useragent:'MyCompanyName',
> >         developerToken:'xxxxxxxxxxxxxxxxxxxxx',
> >         applicationToken:'xxxxxxxxxxxxxxxxxxxxx',
> >         clientEmail:'[email protected]',
> >         startDay:_fDate(obj_date),
> >         endDay:_fDate(obj_date)
>
> > };
>
> > var obj_xml = new ActiveXObject("Msxml2.DOMDocument");
> > obj_xml.async = false;
> > obj_xml.loadXML(_toNode(obj_params,'r'));
> > var obj_xsl = new ActiveXObject("Msxml2.DOMDocument");
> > obj_xsl.async = false;
> > obj_xsl.load(str_script_path + 'adwords_soap.xsl');
> > var str_xml = obj_xml.transformNode(obj_xsl);
>
> > var str_url = 'https://adwords.google.com/api/adwords/v13/
> > ReportService';
> > var obj_http = WScript.CreateObject("MSXML2.ServerXMLHTTP");
> > obj_http.open('POST',str_url,false);
> > obj_http.setRequestHeader('Content-Type','text/xml; charset=utf-8');
> > obj_http.setRequestHeader('Content-Length',str_xml.length);
> > obj_http.setRequestHeader('SOAPAction','"validateReportJob"');
> > obj_http.send(str_xml);
> > WScript.Echo(obj_http.responseText);
>
> > function _fDate(d) {
> >         //some un-important code here to format date as 'YYYY-MM-DD'
> >         return r;}
>
> > function _toNode(o,r) {
> >         var x = '';
> >         for (var i in o) x += '<' + i + '>' + _XMLEnc(o[i]) + '</' + i + 
> > '>';
> >         if (r) x = '<' + r + '>' + x + '</' + r + '>';
> >         return x;}
>
> > function _XMLEnc(s) {
> >         var r = s;
> >         var m =
> > {'"':'&quot;','\'':'&apos;','&':'&amp;','<':'&lt;','>':'&gt;'};
> >         for (var i in m) r = r.split(i).join(m[i]);
> >         return r;
>
> > }
>
> > ========XML RESPONSE EXCERPT BELOW========
> > <faultcode>soapenv:Server.userException</faultcode>
> > <faultstring>org.xml.sax.SAXException: Unable to create JavaBean of
> > type com.google.ads.netapi.services.report.ReportJob.  Missing default
> > constructor?  Error was: java.lang.IllegalAccessException: Class
> > org.apache.axis.encoding.ser.BeanDeserializer can not access a member
> > of class com.google.ads.netapi.services.report.ReportJob with
> > modifiers &quot;protected&quot;.</faultstring>
> > <detail>
> > <ns1:stackTrace xmlns:ns1="http://xml.apache.org/
> > axis/">org.xml.sax.SAXException: Unable to create JavaBean of type
> > com.google.ads.netapi.services.report.ReportJob.  Missing default
> > constructor?  Error was: java.lang.IllegalAccessException: Class
> > org.apache.axis.encoding.ser.BeanDeserializer can not access a member
> > of class com.google.ads.netapi.services.report.ReportJob with
> > modifiers &quot;protected&quot;.
> > at org.apache.axis.encoding.ser.BeanDeserializer.startElement
> > (BeanDeserializer.java:124)
> > 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 com.google.ads.netapi.config.AdWordsApiProvider.processMessage
> > (AdWordsApiProvider.java:62)
> > 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.FilteredServlet$ChainEnd.doFilter
> > (FilteredServlet.java:172)
> > at com.google.inject.servlet.DefaultFilterPipeline.dispatch
> > (DefaultFilterPipeline.java:43)
> > at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:
> > 110)
> > at com.google.gse.FilteredServlet$Chain.doFilter(FilteredServlet.java:
> > 149)
> > at com.google.soap.base.LoggingFilter.doFilter(LoggingFilter.java:142)
> > at com.google.gse.FilteredServlet$Chain.doFilter(FilteredServlet.java:
> > 149)
> > at
> > com.google.servlet.balancing.LoadBalancingFilter.processRequestLocally
> > (LoadBalancingFilter.java:425)
> > at com.google.servlet.balancing.LoadBalancingFilter.loadBalanceRequest
> > (LoadBalancingFilter.java:228)
> > at com.google.servlet.balancing.LoadBalancingFilter.doFilter
> > (LoadBalancingFilter.java:169)
> > at com.google.gse.FilteredServlet$Chain.doFilter(FilteredServlet.java:
> > 149)
> > at com.google.gse.FilteredServlet.service(FilteredServlet.java:120)
> > at com.google.gse.HttpConnection.runServletFromWithinSpan
> > (HttpConnection.java:804)
> > at com.google.gse.HttpConnection.access$000(HttpConnection.java:63)
> > at com.google.gse.HttpConnection$1.runServletFromWithinSpan
> > (HttpConnection.java:732)
> > at com.google.gse.GSETraceHelper$TraceableServletRunnable$1.run
> > (GSETraceHelper.java:388)
> > at com.google.tracing.LocalTraceSpanRunnable.run
> > (LocalTraceSpanRunnable.java:56)
> > at com.google.tracing.LocalTraceSpanBuilder.run
> > (LocalTraceSpanBuilder.java:466)
> > at com.google.gse.GSETraceHelper
> > $TraceableServletRunnable.runWithTracingEnabled(GSETraceHelper.java:
> > 348)
> > at com.google.gse.GSETraceHelper$TraceableServletRunnable.run
> > (GSETraceHelper.java:331)
> > at com.google.gse.HttpConnection.runServlet(HttpConnection.java:728)
> > at com.google.gse.HttpConnection.run(HttpConnection.java:695)
> > at com.google.gse.DispatchQueue$WorkerThread.run(DispatchQueue.java:
> > 354)
> > </ns1:stackTrace>
> > </detail>
--~--~---------~--~----~------------~-------~--~----~
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