Several weeks ago, I provided a quick and dirty MID Server Background script that allows you to pull a WSDL from a remote location behind a customer’s firewall.
This works just fine unless you have a complex WSDL that uses “Import” statements. When this is the case, other important parts of the WSDL are located separate files and they need to all be read in order to bring in all of the important information on the Web Service.
The following update set will allow you to load remote WSDL’s, flatten them, and generate SOAP Message Functions all from a convenient UI Action on the SOAP Message form.
When this UI Action is clicked, we issue a request on the MID Server to load a MID Server Script Include and get the WSDL from the remote location, parse it, grab all import urls and embed them into the WSDL, and finally generate the SOAP Message Functions based off of the remote URL’s.
By default the utility will query the first Active MID Server it can find to attempt to retrieve the WSDL. If you have MID Servers in different networks, you can force the tool to use a specific MID Server by setting the following property:
“com.snc.integration.soap.defaultMidServer”
Give it the MID Server name that you want it to use.
I did it this way so that we don’t modify the SOAP Message form out of the box. This way, if ServiceNow makes additional changes to the SOAP Message UI in the future, you can get them automatically without any conflicts.
Would you believe me if I said that I was trying to do that at the exact moment you published this?
Thank you very much!!
@Rik – lol….glad I could be of assistance!
John,
I tried to upload the xml into the UI Actions but it is not visible in UI action nor in the Soap Message record.
PS: I am using Calgary version and have logged in with Admin and elevated my privileges to Security admin
Please help !!
@Mohan, Please make sure you preview the update set and then commit the update set after it is loaded. For instructions on how to do this, please refer to: How to install an update set.
Hello John,
Thanks a lot for the quick response!! and yes i was able to import the XML
Now when i click on the Generate sample Messages via Mid server – I get the below error
Unable to load WSDL: java.lang.RuntimeException: java.net.NoRouteToHostException: No route to host:java.net.NoRouteToHostException: No route to host
PS:The Mid server is shown as UP in Service-Now
Awaiting for your inputs:)
John,
I’m having the same issue as Mohan when trying to implement this in my instance.
Hoping you can help out.
Sean
This error tells me that the MID Server executing the code cannot reach the WSDL URL provided. You need to make sure the MID Server has access to that URL. Also, if you have more than one MID Server in your instance, the code will pick one automatically and try it. Maybe the one it is picking is not one that has the access to the URL. You can force this to go to a particular MID server by setting the property: “com.snc.integration.soap.defaultMidServer†as described in this blog post. Give that a try and hopefully this solves your issue.
Hi John:
I am on Dublin.
I installed the update set
When I clicked on
Generate Sample Messages via MID Server
I get an error message Unable to load WSDL: com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException:null.
Also how do I check the property com.snc.integration.soap.defaultMidServer if is set. I can not find it in the sys_properties table.
Thanks
Harvey
@Harvey…unfortunately, there are a lot of factors that go into a WSDL for us to read. WSDLs can contain references to XSDs or import statements that may not be valid or reachable. Any of these issues may cause this error. I would have to see the instance, etc to troubleshoot further. You may wish to just ask for someone to send you a copy of the WSDL and just paste it right into your SOAP Message definition rather than try to fight this WSDL error.
John:
At least I know now it is going through the mid server.
I am trying to reach a Team Foundation server. that is behind my client’s firewall. The LDAP and SCCM 2012 import are working, why does the SOAP message not use the mid server OOB?
Thanks
Harvey
I was able to get a copy of the WSDL and I pasted it in and was able to generate the soap message functions. I am using wsASGProjectSoap12.SaveSupportTicketToTFS and it is set up to run on the mid server. I entered some soap parameters and tried a Test and the results came back as the following:
what could this error indicate?
results error=”java.lang.NullPointerException
Hi John – unsure if you are still working with this solution, but I just downloaded this from share.servicenow.com and trying to use it in our Istanbul environment. Unfortunately it doesn’t looking like it’s working. I’m receiving variable scoping errors in the MID Server Script Include, and the following message when executing the ‘Generate Sample Messages via MID Server’ from the SOAP Message definition:
Unable to load WSDL: com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException:null
Thanks.