The Now Platform® Washington DC release is live. Watch now!
Here's a quick test—do you know how to avoid this scenario? You're building a web services integration to a ServiceNow table. The integration seems to be working fine during testing, so you pull the trigger on implementation and—BOOM—it blows up (not literally - figuratively). The blowing up part is bad enough, but you can't even figure out why it's suddenly not working.
So do you know the answer? In this eighth installment of our best practices series, we look at why web service integrations can fail, and how to set them up so that you can figure out what went wrong.
Networks, by their very nature, experience issues now and then. Network outages, changes in firewall configurations, and servers going down are just a few of the things that can result in web service requests or responses not being received.
Planning for the unexpected is important because things often work fine when you're building the integration, but issues can occur after implementation. And if you haven't incorporated error handling, when an issue occurs, the integration blows up instead of gracefully handling the situation and notifying administrators.
When building your integration, ensure that you know whether or not your requests are successful—and if they're not successful, you know why, so that you can troubleshoot.
Here are some tips for handling network failures when interacting with a remote system via HTTP—for example, SOAPMessage, RESTMessage, and GlideHTTPRequest:
You can test this out yourself. Just follow these steps:
When consuming web services, don't automatically assume the request will succeed. Instead, expect the unexpected—such as occasional network failures or timeouts—and plan for these situations in your code.
--
Behind the scenes here at ServiceNow, the Knowledge Management and Multimedia teams work closely with subject matter experts to disseminate critical information to our customers. We've found that certain topics come up frequently, in the form of best practices that can help you keep your ServiceNow instances running smoothly. This series aims to target those topics so that you and your organization can benefit from our collective expertise. If you have a best practices topic you'd like us to cover in this series, please let us know in the comments below.
See Annotate scripts and customizations with comments for the first installment on script comments.
See Limit the number of users with the Admin role for the second installment on user roles.
See Where to avoid linking to a reference field when configuring a list for the third installment on list configuration.
See Developing on your production instance for the fourth installment on development.
See When to create a new table vs. when to extend for the fifth installment on application development.
See How to clone to a target instance that has in-development applications for the sixth installment on cloning.
See Why you should never use external iFrames - and the one exception to this rule for the seventh installment on using iFrames.
To access all of the blog posts in this series, search for "nowsupport best practices series."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.