can I suppress generation of nil tags in SOAP request for a specific web service descriptor?

Hi,

I’m trying to set up a web service consumer to connect to the Microsoft Exchange Web Services. I am able to successfully make a call from SoapUI but I’m running into issues trying to do the same in webMethods. I’m getting an error “The request failed schema validation: If the ‘nillable’ attribute is false in the schema, the ‘xsi:nil’ attribute must not be present in the instance.” I was able to reproduce the same error in SoapUI by adding an element to my SOAP request with the xsi:nil attribute = true when that element should not be null according to the schema. Unfortunately the error message from the service contains no specifics about which element is incorrect and I can debug into the generated WS connector but can’t debug into the soap client code (pub.client:soapClient) to see what xml is ultimately being generated and then sent to the service. It seems to me that the integration server is adding in elements that I am not specifying (optional elements) and setting xsi:nil=true. The 8.2 SP1 readme doesn’t specify in which exact situations the IS does this (http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_ga/readme/IntegrationServer_8-2-SP1_readme.pdf see “Modification to control whether SOAP messages distinguish between null and empty elements”), but the behaviour in this case seems odd as it appears to be setting this attribute when the element is not allowed to be null (or perhaps there is something weird going on in the generation of the doc types from the schema). I did try setting the extended setting watt.server.SOAP.generateNilTags to false. This fixed the problem, but I’m leery to flip this setting as our Integration Server hosts multiple packages/projects with various WS calls and I’m not sure what the impact would be on these other services. Is there a way to suppress generation of nil tags on a per-service basis rather than globally?

Thanks,
Anna

Anna,

Please check this KB from Empower and see the resolution helps but in your case both the settings to be “false”
and try not to set docTypeName?

Description:

An XML schema (i.e., XSD) may have elements defined with the attribute nillable and that attribute may be set to “true” (for example: <xs:element name=“empNumber” type=“xs:string” nillable=“true” minOccurs=“0” />). What this is supposed to allow is for the explicit sending of no value for a field in a message (e.g., ). In this way, the recipient of the message (a) recognizes that the absence of the value for the element (in this case, a value for empNumber) is not an accident, but intentional; and (b) knows to update the corresponding field on their system by removing any value that might currently exist for that field (e.g., ). Setting the nil attribute in a message is easy when creating XML and sending it as a string onto a message queue. However, when using a web service descriptor to consume a web service, there does not seem to be any field available which would effectively send “xsi:nil=“true”” as an attribute to an element in a field.
How can we achieve this in 8.2 environment

Resolution:

Recommended to set the documentTypeName and set the generateNilTags and generateRequiredTags to ?true? in pub.xml:documentToXMLString service to generate the xsi Nil tag. Also to detect the “wrong inputs” and throw appropriate errors, you can check the “Validate Input” checkbox for the service and pointing to the doctype as the Input.

HTH,
RMG

Hi RMG,

Thank you for your response but I’m not using the pub.xml:documentToXMLString service. I generated a WS consumer from a WSDL and therefore I am calling the generated connector with documents as input, not strings. The connector calls the pub.client:soapClient service. Are there any similar parameters for either of these services??

Thanks,
Anna

just a suggestion try using pub.schema:validate service to validate your request for consumer. validate service will tell you exactly which fields failed to pass validation.

If you want to go route validate against schema/DTD then pub.schema:validate should work it but the issue here is to supress the nill tags (unless your schema allows decides it to have it appear or not)

HTH,
RMG

Thank you all for your suggestions, I opened an Empower ticket and they got back to me verifying that my schema was valid (nillable was false for the elements that the xsi:nil=true attribute was being added to). They suggested upgrading our fix version from IS_8.2_SP2_Core_Fix6 and WSS_8.2_SP2_Fix4 to IS_8.2_SP2_Core_Fix12 WSS_8.2_SP2_Fix9. We have not had a chance to do this yet, but I will try to remember to update this post if and when we do.

Anna,Thanks for the update on this thread:

Thanks this post helped.
Had a similar situation WM consuming a web service and the doc created while creating the WSD connectors most of the elements in the XSD have the property “Allow null” = false.
Hence wanted to validate the Inputs to soap request before invoking the pub.client:soapClient and raise an exception when isValid=false from the pub.schema:validate.

Kunal,

It seems you found a work around option and validate step should work in this case.

HTH,
RMg