IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Getting null tags in xmlString

  • 1.  Getting null tags in xmlString

    Posted Mon June 12, 2017 12:29 AM

    Hello Team,

    I am getting a JSON string as input in which some of the fields are optional but source system sends null as part of it. When I am trying to convert it to xmlString,
    I am getting null tags as well which I don’t want to receive.

    I can overcome this situation by checking null value, if not null, assigning it to a different doc and then convert it to xmlString but there are so many fields as
    input so I don’t want to follow this one. As part of wmpublic.xmldocumenttoxmlstring BIS we have input parameter properties like generateRequiredTags,generateNilTags.
    I tried to set both as true in one case and false in other case but still I am getting null tags.

    Ex.

    Input JSON String:

    {
    “input”:
    {
    “a”:“a value”,
    “b”:“b value”,
    “c”:null
    }
    }

    XML String:
    a valueb value

    Expectation:
    a valueb value

    Kindly help.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Getting null tags in xmlString

    Posted Mon June 12, 2017 07:06 AM

    Hi Anil,

    is field c markeds as required or not.
    When a field is marked as required, but can be empty it should be declared as nillable (“allow null” in Designer) to get an empty tag for satisfying validation.

    Can you share the definition of the document input with the exact field constraints?

    Are there any mappings in to downstream?
    If so, you can use Copy Conditions on these fields and only map them when they have a meaningful value.

    Regards,
    Holger


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB