webMethods

webMethods

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
  • 1.  Initializing with a null

    Posted Mon September 14, 2009 07:25 AM

    Hi,

    Could you please let me know, how would one initialize a variable with null.

    Breaking it down: if I have a IS document with two parmeters -
    [COLOR=Blue][I]myDoc

    • var1
    • var2[/i][/color]
      And after initializing the two variables with null, if I convert document to XMLString. I’m in need of the below xml:



    My working environment is webMethods 6.1

    Thanks in advance!!

    Cheers,
    Pramod


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


  • 2.  RE: Initializing with a null

    Posted Mon September 14, 2009 10:03 AM

    I know that webMethods 6.5 sp3 provides and additional input variable “generateNilTags” for “pub.xml:documentToXMLString”, which can be used to achieve your requirement.

    In 6.1 this option is not available, in this case you need to do this manually. It might be worth to check if there is any fix available.


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


  • 3.  RE: Initializing with a null

    Posted Mon September 14, 2009 03:46 PM


  • 4.  RE: Initializing with a null

    Posted Tue September 15, 2009 05:30 AM

    Thanks for the response.

    But if I assign empty string, it would not result with the attribute xsi:nillable=true, instead it would result in self ending element for the variables as below… :frowning:



    Or





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


  • 5.  RE: Initializing with a null

    Posted Tue September 15, 2009 05:46 PM

    You may need to change the field from a string to a document:

    var1 (Document)
    @xsi:nil (String)
    …*body (String)

    Then during mapping you’d set @xsi:nil to true or false as needed. When false, map the data to *body.

    Perhaps someone else knows a better way?


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