Skip to content

Empty XML nodes incorrectly serialized/deserialized #449

Open

Description

@christopherseeley

Seems like this zeep issue is impacting Ad Manager:
mvantellingen/python-zeep#923

Specifically, video line items with an empty requestPlatformTargeting. Reading one of these and sending it unchanged in an updateLineItemsRequest fails with NotNullError.NULL @ targeting.requestPlatformTargeting

Activity

  1. aebenw commented on Aug 31, 2021

    @aebenw

    @christopherseeley Is there any update on this? I am experiencing this same issue.

    My job is fetching line items and pushing them back up, this property is not changed though yet I'm getting this error.

  2. christopherseeley commented on Oct 12, 2021

    @christopherseeley
    MemberAuthor

    As a workaround, you can explicitly set an xsi_type for these line items and zeep will correctly serialize it:

    line_item['targeting']['requestPlatformTargeting'] = {
                'xsi_type' : 'RequestPlatformTargeting'
            }
    

    For background, an empty <requestPlatformTargeting/> node gets deserialized to None instead of the RequestPlatformTargeting wrapper object. The workaround coerces zeep to serialize it back as:
    <requestPlatformTargeting></requestPlatformTargeting>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions