Scripted Web Services : How to add namespace to response XML?

cc11
Tera Contributor

Hello,

I am working on the out-of-the-box scripted web service "InstanceInfo"

I am using SOAP UI client to invoke the web service.

Everything works fine, just that I need the namespace "xmlns:ins="http://www.service-now.com/InstanceInfo" in the response XML (I have copied request & response XMLs below).

----------------------

Request XML:

 

find_real_file.png

Response XML:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<executeResponse>
<result>
<install_name>Demo Server</install_name>
<instance_name>itsmdev</instance_name>
<instance_id>012345asdfkh09230909asdfjh</instance_id>
<build_date>03-15-2018_1411</build_date>
<build_tag>glide-jakarta-05-03-2017__patch8a-03-12-2018</build_tag>
<system_id>app1.iad1.service-now.com:itsmdev007</system_id>
<node_id>kjshadfkjh12312321lkjlkj1231231klj</node_id>
<instance_ip>10.20.30.40</instance_ip>
<mid_buildstamp>jakarta-05-03-2017__patch8a-03-12-2018_03-15-2018_1411</mid_buildstamp>
<mid_version>03-15-2018_1411</mid_version>
</result>
</executeResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ycd,

Why you want to modify the out of box scripted soap service?

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

I am working on an external system that consumes a SNow web service.

They are not able to read the SOAP response from SNow since it is missing a namespace.

They are pretty old and have limited access to change anything on their side. So, I am looking for options on the SNow side.

 

Thank you,

Yogesh

cc11
Tera Contributor

The following helped,

It tells how to get qualified responses from SNow.

By-default SNow responses are unqualified.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0546188

 

"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

For more information, see the "Setting Namespace Requirements" section in Compatibility for clients generated from WSDL.

"

 

Hope this helps someone.