Initializing with a null


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 -

  • 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!!


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.

Assign an empty string to var1, var2.

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:


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?