Hello This part of your xml, <ruleOperands xsi:type="RemarketingUserList"> <id>1527309</id> </ruleOperands>
xsi:Type="RemarketingList" should be the element of UserList, not the ruleOperands. Please refer the correct xml example, below I made. Best, - Takeshi, AdWords API Team <?xml version="1.0" encoding="UTF-8"?> <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:Header> <ns1:RequestHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201209"> <ns1:authToken xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201209">******</ns1:authToken> <ns1:clientCustomerId>********</ns1:clientCustomerId> <ns1:developerToken>*********</ns1:developerToken> <ns1:userAgent>INSERT_COMPANY_NAME (AwApi-Java/8.10.0, Axis/1.4, Java/1.6.0-google-v4, legacy)</ns1:userAgent> <ns1:validateOnly>false</ns1:validateOnly> <ns1:partialFailure>false</ns1:partialFailure> </ns1:RequestHeader> </soapenv:Header> <soapenv:Body> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201209"> <operations> <operator>ADD</operator> <operand xsi:type="ns2:LogicalUserList" xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201209"> <name>logicalUserList1355973710893</name> <description>A list of mars cruise customers in the last year</description> <rules> <operator>ANY</operator> <ruleOperands> <UserList xsi:type="ns2:RemarketingUserList"> <id>1591608</id> </UserList> </ruleOperands> </rules> </operand> </operations> </mutate> </soapenv:Body> </soapenv:Envelope> On Tuesday, December 18, 2012 12:49:49 PM UTC+9, 马玉潮 wrote: > > I use google-adwords-api gem of ruby to write this function. > > > My code is below, > > > operation = { > > :operator => 'ADD', > > :operand => { > > :xsi_type => "LogicalUserList", > > :name => "TestFromMike-#{Time.now.to_i}", > > :description => "TestFromMike-#{Time.now.to_i}", > > :status => "OPEN", > > :membership_life_span => 30, > > :rules => [ > > { > > :xsi_type => "UserListLogicalRule", > > :operator => "ANY", > > :rule_operands => [ > > {:xsi_type => "RemarketingUserList" , :id => "1527309"} > > ] > > > } > > ] > > } > > } > > > > response = user_list_service.mutate([operation] > > > but it failed. > > > The log is like below: > > *Request* > > SOAP request: > https://adwords.google.com/api/adwords/cm/v201209/UserListService > > SOAPAction: "mutate", User-Agent: XMO-Google-Client (AwApi-Ruby/0.7.2, > Common-Ruby/0.8.2, Savon/1.2.0, ruby/1.9.2, HTTPI/1.1.1, net_http), > Content-Type: text/xml;charset=UTF-8, Content-Length: 1410 > > <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd=" > http://www.w3.org/2001/XMLSchema" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl=" > https://adwords.google.com/api/adwords/cm/v201209" xmlns:env=" > http://schemas.xmlsoap.org/soap/envelope/"><env:Header><wsdl:RequestHeader > xmlns="https://adwords.google.com/api/adwords/cm/v201209"><userAgent>********</userAgent><developerToken>********</developerToken><clientCustomerId>********</clientCustomerId><authToken>**********</authToken></wsdl:RequestHeader></env:Header><env:Body><mutate > > xmlns="https://adwords.google.com/api/adwords/cm/v201209"><operations><operator>ADD</operator><operand > > xsi:type="LogicalUserList"><name>TestFromMike-1355801232</name><description>TestFromMike-1355801232</description><status>OPEN</status><membershipLifeSpan>30</membershipLifeSpan><rules > > xsi:type="UserListLogicalRule"><operator>ANY</operator><ruleOperands > xsi:type="RemarketingUserList"><id>1527309</id></ruleOperands></rules></operand></operations></mutate></env:Body></env:Envelope> > > *Response* > > HTTPI executes HTTP POST using the net_http adapter > > SOAP response (status 500): > > <soap:Envelope > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling > > Error: cvc-elt.4.3: Type 'RemarketingUserList' is not validly derived from > the type definition, 'LogicalUserListOperand', of element 'ruleOperands'. > </faultstring></soap:Fault></soap:Body></soap:Envelope> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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