Options

Can XMLPort works for dynamic XML response ?

bilalraibilalrai Member Posts: 50
Hi guys,
I am stuck in a problem. I am getting XML response from a webservice in NAV. I have created XMLPort for importing data from XML response to NAV table. It works fine when the response has all the tags that are defined in the structure of XMLPort but when anyone of the tag is missed in response it throws an error. Is there a way that when a tag is missed in XML response NAV just skip it and import data from other tags?

Answers

  • Options
    vaprogvaprog Member Posts: 1,118
    Setting the MinOccurs property to Zero should do the trick.
  • Options
    bilalraibilalrai Member Posts: 50
    Thanks @vaprog but I have already tried that option in properties.
  • Options
    JuhlJuhl Member Posts: 724
    Load it into XDocument and go through it manually.
    Follow me on my blog juhl.blog
  • Options
    vaprogvaprog Member Posts: 1,118
    bilalrai wrote: »
    Thanks @vaprog but I have already tried that option in properties.

    In this case you need to update NAV to a newer version or build; or follow @Juhl's advice.
  • Options
    devdronedevdrone Member Posts: 14
    vaprog wrote: »
    Setting the MinOccurs property to Zero should do the trick.

    This is the only legit trick. Set this property to all the nodes.
Sign In or Register to comment.