Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #395 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

literal + nil + maxOccurs != 0 + nillable="true"

Reported by: nahi Assigned to: nahi
Priority: high Milestone: 1.5.8
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description

from soap4r-ml

For example, after adding obj.addCampaign(AddCampaign.new(campaign))

I got this error:
Exception `SOAP::FaultError' at /usr/lib/ruby/gems/1.8/gems/
soap4r-1.5.7/lib/soap/rpc/proxy.rb:188 -
com.google.ads.netapi.services.errors.InvalidEnumValue:
java.lang.IllegalArgumentException: No enum const class
com.google.ads.netapi.services.datamodel.DayOfWeek.
Exception `SOAP::FaultError' at /usr/lib/ruby/gems/1.8/gems/
soap4r-1.5.7/lib/soap/mapping/mapping.rb:118 -
com.google.ads.netapi.services.errors.InvalidEnumValue:
java.lang.IllegalArgumentException: No enum const class
com.google.ads.netapi.services.datamodel.DayOfWeek.
#<SOAP::Mapping::Object:0xb77299dc>:
com.google.ads.netapi.services.errors.InvalidEnumValue:
java.lang.IllegalArgumentException: No enum const class
com.google.ads.netapi.services.datamodel.DayOfWeek. (SOAP::FaultError)


Looking at the SOAP packet, it is because I have an empty schedule:
 <n1:schedule xsi:type="n1:AdSchedule">
          <n1:intervals xsi:type="n1:SchedulingInterval">
            <n1:day xsi:type="n1:DayOfWeek"></n1:day>
            <n1:endHour xsi:nil="true"></n1:endHour>
            <n1:endMinute xsi:nil="true"></n1:endMinute>
            <n1:multiplier xsi:nil="true"></n1:multiplier>
            <n1:startHour xsi:nil="true"></n1:startHour>
            <n1:startMinute xsi:nil="true"></n1:startMinute>
          </n1:intervals>
          <n1:status xsi:type="n1:AdScheduleStatus"></n1:status>
        </n1:schedule>

I do not want to use scheduling at all. I tried to remove it by
campaign.schedule = nil

No luck. I also tried removing it by commenting out parts that mention
schedule in class Campaign. No luck either.

Change History

08/05/07 11:02:15 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [1912]) * send xsi:nil=true element when literal + maxOccurs != 0 + nillable="true", not empty element. closes #395.