Hi, The UI supports a wide variety of ads, but the API may not necessarily support every one of these formats. As a starting point, have you tried creating the ad through the UI using the image in question? If the UI won't create the ad, then the API will not either.
Also, the MediaService is meant for usage with template ads <https://developers.google.com/adwords/api/docs/appendix/templateads>, which does *not* include ImageAd <https://developers.google.com/adwords/api/docs/reference/v201402/AdGroupAdService.ImageAd>s. If you want to create an *ImageAd* you'll have to skip *MediaService* altogether and pass the image data directly on the ImageAd.image.data <https://developers.google.com/adwords/api/docs/reference/v201402/AdGroupAdService.Image#data> field in your *AdGroupAdService* request. Cheers, Josh, AdWords API Team On Friday, June 6, 2014 12:08:42 PM UTC-4, Chingiz Aitkul wrote: > > Hi there, I am trying to upload an animated GIF Image via upload() method > of MediaService using example code provided with Java library for AdWords > API. When I upload a static GIF or JPEG file it works ok. > > When I try to upload an animated GIF Image, the Service replies with a > MediaID without any errors, but when I query for all available media files, > I don't recieve any entries for the animated GIF Images, only the static > Image Uploads I retrieved. > > I noticed that in the example code > (adwords.axis.v201402.misc.UploadImage.java) the MediaType of the Image is > set before uploading to MediaMediaType,IMAGE. So I Change it to > MediaMediaType.DYNAMIC_IMAGE, and when I do so, I get the following error. > > Could you please advice, if this is a bug or I am doing something wrong > here? > > *<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="* > *http://schemas.xmlsoap.org/soap/envelope/* > <http://schemas.xmlsoap.org/soap/envelope/> > > *"> <soap:Header> <ResponseHeader xmlns="* > *https://adwords.google.com/api/adwords/cm/v201402* > <https://adwords.google.com/api/adwords/cm/v201402> > > > > > > > > > > > > > *"> > <requestId>0004fb2cc9f931980ae06184c4000fa2</requestId> > <serviceName>MediaService</serviceName> > <methodName>upload</methodName> > <operations>1</operations> > <responseTime>600</responseTime> </ResponseHeader> > </soap:Header> <soap:Body> <soap:Fault> > <faultcode>soap:Server</faultcode> > <faultstring>[MediaError.UNSUPPORTED_OPERATION @ > media[0].type]</faultstring> <detail> > <ApiExceptionFault xmlns="* > *https://adwords.google.com/api/adwords/cm/v201402* > <https://adwords.google.com/api/adwords/cm/v201402> > > > *"> <message>[MediaError.UNSUPPORTED_OPERATION @ > media[0].type]</message> > <ApplicationException.Type>ApiExceptionException in thread "main" > </ApplicationException.Type> <errors xmlns:xsi="* > *http://www.w3.org/2001/XMLSchema-instance* > <http://www.w3.org/2001/XMLSchema-instance> > > > > > > > > > > > *" xsi:type="MediaError"> > <fieldPath>media[0].type</fieldPath> > <trigger/> > <errorString>MediaError.UNSUPPORTED_OPERATION</errorString> > > <ApiError.Type>MediaError</ApiError.Type> > <reason>UNSUPPORTED_OPERATION</reason> > </errors> </ApiExceptionFault> </detail> > </soap:Fault> </soap:Body></soap:Envelope>* > > > > > > > > *AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server > <http://schemas.xmlsoap.org/soap/envelope/%7DServer> faultSubcode: > faultString: [MediaError.UNSUPPORTED_OPERATION @ > media[0].type] faultActor: faultNode: faultDetail: > {https://adwords.google.com/api/adwords/cm/v201402}ApiExceptionFault > <https://adwords.google.com/api/adwords/cm/v201402%7DApiExceptionFault>:<message>[MediaError.UNSUPPORTED_OPERATION > > @ > media[0].type]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors > > xmlns:xsi="**http://www.w3.org/2001/XMLSchema-instance* > <http://www.w3.org/2001/XMLSchema-instance>*" > xsi:type="MediaError"><fieldPath>media[0].type</fieldPath><trigger/><errorString>MediaError.UNSUPPORTED_OPERATION</errorString><ApiError.Type>MediaError</ApiError.Type><reason>UNSUPPORTED_OPERATION</reason></errors>* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *[MediaError.UNSUPPORTED_OPERATION @ media[0].type] at > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at > java.lang.reflect.Constructor.newInstance(Constructor.java:408) at > java.lang.Class.newInstance(Class.java:433) at > org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104) > at > org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90) > at > com.google.api.ads.adwords.axis.v201402.cm.ApiException.getDeserializer(ApiException.java:143) > at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at > java.lang.reflect.Method.invoke(Method.java:483) at > org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154) > at > org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84) > at > org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464) > at > org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547) > at > org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157) > at > org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:378) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2770) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) > at > com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117) > at > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) > at > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649) > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333) > at > org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) > at > org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at > org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at > org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) > at > org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at > org.apache.axis.client.Call.invokeEngine(Call.java:2784) at > org.apache.axis.client.Call.invoke(Call.java:2767) at > org.apache.axis.client.Call.invoke(Call.java:2443) at > org.apache.axis.client.Call.invoke(Call.java:2366) at > org.apache.axis.client.Call.invoke(Call.java:1812) at > com.google.api.ads.adwords.axis.v201402.cm.MediaServiceSoapBindingStub.upload(MediaServiceSoapBindingStub.java:816) > at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at > java.lang.reflect.Method.invoke(Method.java:483) at > com.google.api.ads.common.lib.soap.SoapClientHandler.invoke(SoapClientHandler.java:109) > at > com.google.api.ads.common.lib.soap.axis.AxisHandler.invokeSoapCall(AxisHandler.java:201) > at > com.google.api.ads.common.lib.soap.SoapServiceClient.callSoapClient(SoapServiceClient.java:64) > at > com.google.api.ads.common.lib.soap.SoapServiceClient.invoke(SoapServiceClient.java:93) > at > com.sun.proxy.$Proxy14.upload(Unknown Source) at > adwords.axis.v201402.misc.UploadImage.runExample(UploadImage.java:81) at > adwords.axis.v201402.misc.UploadImage.main(UploadImage.java:60)* > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
