Configuring SOAP requests to return qualified responses
Some web service clients may consider SOAP responses from a ServiceNow instance to be invalid.
The web service client encounters one of these errors:
- The SOAP response from the ServiceNow Web service is invalid
- The SOAP response cannot be parsed
- The namespace is missing in the SOAP response
By default, response elements in ServiceNow SOAP responses are not qualified. Some web service clients may only accept qualified responses.
All elements within a qualified schema must be associated with a namespace. This association is made by prepending an element with a prefix defined by an xmlns attribute. It is also possible to specify a qualified namespace without a prefix in a qualified schema. This is known as the default namespace. All global elements within an unqualified schema must be associated with a namespace, and all child elements must not be associated with a namespace. The default namespace is invalid when used in an unqualified schema.
The examples below show how an element may specify a namespace, or use the default namespace.
|Qualified, namespace specified||Qualified, default namespace||Unqualified, namespace specified||Unqualified, default namespace (invalid XML)|
<snow:child>I am qualified</snow:child>
<child>I am qualified too</child>
<child>I am unqualified</child>
<child>I am not a valid XML document</:child>
For more information on qualified and unqualified responses, refer to these documents:
Perform one of these actions to resolve the issue:
- Set the system property glide.wsdl.schema.UnqualifiedElementFormDefault to false. Setting this property to false causes all inbound SOAP traffic to return qualified responses.
- Include the request parameter elementFormDefault=qualified in the request URI. For example, use <instance>.service-now.com/<table_name>.do?WSDL&elementFormDefault=qualified to obtain a qualified WSDL, or use <instance>.service-now.com/<table_name>.do?SOAP&elementFormDefault=qualified to obtain a qualified response when querying a table