How to add xsi:nil=”true” to XML schema elements in SOAP request
The SOAP request that we are sending goes through DataPower, which is validating the int/decimal/long types (even though they are nillable with minOccurs=0). Is there any way to add xsi:nil="true" to XML schema elements with the options available in Pega 7.1.7.
Thanks Gopi for responding. This is ConnectSOAP. We are invoking a Java Web Service (WS), that goes through Data Power (DP) (since the WebService proxy is configured in DP). DP is validating integer/decimal/long types not to have null values even though they have nillable="true" defined in the generated XSD of Java Web Service. One possible way to get rid off this situation as per the IBM article http://dw.developer-works.com/article/10225679/INT+Validation+%23+XI50 is to specify xsi:nil="true" on all elements of type int, long, decimal, datetime...instead of empty node.
After we consume the WS, in the auto-generated XML Stream rule, is there any way we can have Pega add xsi:nil="true" in Pega 7.1.7.
I just figured out this. In case if someone have to deal with DataPower, this answer might save some time. Per the PDN article (NodeID: 253396) I've mentioned in my previous msg, $is-present() API doesn't work for auto-generated XML. If we replace this in the generated JSP tag of XML Stream rule, Pega does include xsi:nil="true" attribute in the request envelope for the elements marked as 'nillable'.
Here are the detailed Steps:
1. Uncheck 'Auto-generated XML' under XML tab of XML Stream rule