How to Use a JavaScript Program to Call a Web Service

Developers can access web services directly through JavaScript programs. This ability enables web programmers and system administrators to invoke methods remotely through DHTML or Windows Scripting Host. The ability to call web services through client-side scripting gives web developers greater flexibility to create dynamic web sites. To use a JavaScript program to call each web service, use the sample files described in this section as a model, as follows:

  1. Review the following files in the directory named %USM_HOME%\ view\webapps\usm\admin:
  2. Open the soapTest_index.html file in your browser.
  3. Complete the fields and run the file.

Because HTTP connections can be dropped and because of the unpredictable nature of the internet, the sample files support both synchronous and asynchronous method calls. When asynchronous calls are used, the web browser will not lock up during calls and will still respond to user input. The sample files provide a sample HTML web page that gets the list of all accounts for a business unit, using the synchronous method calling. After the call returns, the page dynamically creates an HTML table with the list of accounts.

How to Add Attachments to Requests using Web Services

The addRequestAttachmentWithPath web service replaces the earlier addRequestAttachment web service. The new web service provides new and improved methods for adding attachments to requests.

The addRequestAttachmentWithPath web service provides an automated, efficient, consistent, and reliable mechanism for adding attachments to requests, especially when compared to doing so manually. You can use each of the following methods to add attachments to requests with the addRequestAttachmentWithPath web service:

Important! Wherever applicable, replace instances of the old web service (addRequestAttachment) with the new web service (addRequestAttachmentWithPath).

For details, see the sections that follow.