Hi Anash, im in a portable class libary, the AdWords API .NET libary does not work for me.
Yes you are right. Mono cant handle XmlIgnoreAttribute() correctly. Patching the generated code works fine for me now. Im getting the ReportFields now. But no values for example for clicks or impressions. Do I have to combine the getReportFields with something to get the values e.g. for all Campaigns? Thanks Michael Am Montag, 9. März 2015 14:28:55 UTC+1 schrieb Anash P. Oommen (AdWords API Team): > > Hi Michael, > > My best guess is that Mono is not > handling System.Xml.Serialization.XmlIgnoreAttribute() on a method > parameter correctly. Could you please consider using the AdWords API .NET > library <https://github.com/googleads/googleads-dotnet-lib> instead? > > If you want a longer explanation, then > > - reportTypeSpecified is generated by Mono because the wsdl definition for > getReportFields in ReportDefinitionService.wsdl > <https://adwords.google.com/api/adwords/cm/v201409/ReportDefinitionService?wsdl> > > looks like this: > > <element name="getReportFields"> > <complexType> > <sequence> > <element maxOccurs="1" minOccurs="0" name="reportType" > type="tns:ReportDefinition.ReportType"> > </element> > </sequence> > </complexType> > </element> > > ReportDefinition.ReportType is an enum (which is non-nullable in .NET), > but minOccurs=0, maxOccurs=1 in the wsdl suggests that the reportType > parameter may be set to null. reportTypeSpecified flag is a hack by the > .NET framework to tell the serialization framework whether or not to treat > the reportType node as null. (i.e. if reportTypeSpecified == false, then > ignore the value on reportType and treat it as a null) > > - However, since reportTypeSpecified is a hack parameter introduced by > .NET code generator (and not part of wsdl itself) it should decorate the > reportTypeSpecified parameter with > an [System.Xml.Serialization.XmlIgnoreAttribute()] to ensure > that reportTypeSpecified itself is not part of the SOAP envelope. > > - You can see that Mono does this for getReportFields method, but not for > getReportFieldsAsync method. > - From your SOAP logs, you can also see that Mono's XML serialization > framework doesn't respect [System.Xml.Serialization.XmlIgnoreAttribute()] > on a method parameter. > > The fix would be to patch the generated code to remove reportTypeSpecified > parameter from the getReportFields method. > > Cheers, > Anash P. Oommen, > AdWords API Advisor. > > On Monday, March 9, 2015 at 7:24:05 AM UTC-4, Michael D wrote: >> >> Hi Josh, >> >> Im adding the WebReference like I mentioned. >> >> When looking into the Reference the Constructor also shows that >> *reportTypeSpecified* is needed. >> >> >> <https://lh3.googleusercontent.com/-GGHydB2LFr8/VP2BJkkzHfI/AAAAAAAAARg/bNeuuFMa_OA/s1600/Reference.PNG> >> Thanks >> >> Michael >> >> >> Am Montag, 9. März 2015 04:02:36 UTC+1 schrieb Josh Radcliff (AdWords API >> Team): >>> >>> Hi, >>> >>> Are you using one of our client libraries >>> <https://developers.google.com/adwords/api/docs/clientlibraries>? If >>> so, please look for the *GetReportFields* example in the *reporting* >>> examples >>> folder. For example, the C# example is here >>> <https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201409/Reporting/GetReportFields.cs> >>> . >>> >>> As the WSDL you mentioned shows, there is no *reportTypeSpecified* argument >>> to *GetReportFields*, so I'm not quite clear on where you are seeing >>> this field. >>> >>> Thanks, >>> Josh, AdWords API Team >>> >>> On Sunday, March 8, 2015 at 11:56:25 AM UTC-4, Michael D wrote: >>>> >>>> Hi Josh, >>>> >>>> im using this Web Service: >>>> https://adwords.google.com/api/adwords/cm/v201409/ReportDefinitionService?wsdl >>>> >>>> First get the ReportDefinitionService: >>>> var client = new >>>> ReportDefinitionService.ReportDefinitionService(); >>>> >>>> set the ReportDefinitionReportType: >>>> const ReportDefinitionReportType reportType = >>>> ReportDefinitionReportType.ACCOUNT_PERFORMANCE_REPORT; >>>> >>>> But when im trying to get ReportFields with getReportFields or >>>> getReportFieldsAsync like below >>>> client.getReportFields(reportType,false); >>>> client.getReportFieldsAsync(ReportDefinitionReportType.KEYWORDS_PERFORMANCE_REPORT, >>>> >>>> false); >>>> >>>> both given Methods requires ReportDefinitionReportType and >>>> *reportTypeSpecified*. >>>> >>>> But if *reportTypeSpecified* is not part of the getReportFields then >>>> why they need it? >>>> >>>> >>>> >>>> Am Freitag, 6. März 2015 15:30:12 UTC+1 schrieb Josh Radcliff (AdWords >>>> API Team): >>>>> >>>>> Hi, >>>>> >>>>> The *reportTypeSpecified* field you mentioned is not part of the >>>>> *getReportFields* spec (see the service XSD here >>>>> <https://adwords.google.com/api/adwords/reportdownload/v201406/reportDefinition.xsd>). >>>>> >>>>> If you remove that field from your request, it should work. >>>>> >>>>> Thanks, >>>>> Josh, AdWords API Team >>>>> >>>>> On Friday, March 6, 2015 at 5:40:40 AM UTC-5, Michael D wrote: >>>>>> >>>>>> Hey People, >>>>>> >>>>>> im trying to get a report and im sending this request: >>>>>> >>>>>> POST >>>>>> https://adwords.google.com/api/adwords/cm/v201406/ReportDefinitionService >>>>>> >>>>>> HTTP/1.1 >>>>>> User-Agent: Mono Web Services Client Protocol 4.0.50524.0 >>>>>> Authorization: Bearer >>>>>> ya29.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >>>>>> SOAPAction: "" >>>>>> Content-Type: text/xml; charset=utf-8 >>>>>> Content-Length: 691 >>>>>> Host: adwords.google.com >>>>>> >>>>>> <?xml version="1.0" encoding="utf-8"?> >>>>>> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap=" >>>>>> http://schemas.xmlsoap.org/soap/envelope/"> >>>>>> <soap:Header> >>>>>> <RequestHeader xmlns=" >>>>>> https://adwords.google.com/api/adwords/cm/v201406"> >>>>>> <clientCustomerId>xxx-xxx-xxxx</clientCustomerId> >>>>>> <developerToken>XXXXXXXXXXXXXXXXXXXX</developerToken> >>>>>> <userAgent>UserAgent</userAgent> >>>>>> >>>>>> </RequestHeader> >>>>>> </soap:Header> >>>>>> <soap:Body> >>>>>> <getReportFields xmlns=" >>>>>> https://adwords.google.com/api/adwords/cm/v201406"> >>>>>> <reportType>CAMPAIGN_PERFORMANCE_REPORT</reportType> >>>>>> <reportTypeSpecified>true</reportTypeSpecified> >>>>>> </getReportFields> >>>>>> </soap:Body> >>>>>> </soap:Envelope> >>>>>> >>>>>> if reportTypeSpecified is true im gettin the Error: >>>>>> >>>>>> soap:Fault faultcode >>>>>> Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was >>>>>> found starting with element 'reportTypeSpecified'. No child element is >>>>>> expected at this point. >>>>>> >>>>>> if it is false: >>>>>> Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was >>>>>> found starting with element 'reportTypeSpecified'. One of '{" >>>>>> https://adwords.google.com/api/adwords/cm/v201406":reportType}' is >>>>>> expected. >>>>>> >>>>>> Does anyone know what I have to change to get some Reports? >>>>>> >>>>>> Thank you >>>>>> >>>>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9508018d-0f8e-434f-9370-3d2dab7e2b3b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.