SoftwareCentral · Web services

Call a Web Service

Find the address of a web service, copy a sample for your script, and test the call from the browser.

Address and parameters Samples Test tab

1 Find the address

A web service can be called in many ways, from a script or from a third-party tool. Start in the General tab of its Manage window.

Open Settings › Web Services and click Manage next to the web service you want to call.

The General tab of a web service with name, description, samples, HTTP and PowerShell
The General tab of Devices - Clone Computer. The description ends with the parameters you must send.
FieldWhat it holds
Web Service NameThe name, as it is in the list.
DescriptionWhat the web service does. After it comes the list of parameters, each as [type] name.
SamplesA link with the name of the method. It opens a page with samples of SOAP requests and responses and of HTTP (REST) GET and POST requests and responses.
HTTPThe address of the web service and the method, with the parameters you must send.
PowerShellAn example of how to call the web service from a PowerShell script.
VBScriptAn example of how to call the web service from a VBScript.
The samples use your sign-in The examples are built for Windows Authentication. With Basic Authentication, the user name and password must be sent with the request. In SoftwareCentral Cloud the examples include the log in and log out calls, and you must use a user that has access to the cloud. When SoftwareCentral signs users in with Microsoft, the VBScript box is not shown and the PowerShell example gets an access token first (see Call web services using Microsoft Security Tokens).

2 Test the web service

Open the Test tab to run the web service from the browser.

The Test tab with one box per parameter, the Invoke button and the response below
The Test tab. Fill in one value for each parameter and click Invoke.

There is one box for each parameter. Click Invoke to call the web service. The answer is shown in the frame below the button, and the address that was called is shown as a link under it; click the link to open the answer in a new window. The web service runs in your context, with the role you have selected, so the test shows what you are allowed to do.

Methods that take a list The Test tab sends one value for each parameter. A web service that takes a list, such as the ones in Intune web services, is tested with a list of one value here. To send several, use SOAP or JSON, or repeat the parameter in the address.

3 Parameters that are lists

Some web services take lists of values, for example several users and several applications at once. The type in front of the name is then String[]. A web service that is called with SOAP, for example from PowerShell with New-WebServiceProxy, takes a list directly. With JSON, send the list as an array. With HTTP GET or POST, repeat the parameter for each value, for example astrUserPrincipalNames=a@contoso.com&astrUserPrincipalNames=b@contoso.com. See the examples in Intune web services.

4 More examples

5 Best practice

  • Try the call on the Test tab before you script it. Invoke runs the web service in your browser with the values you typed, so the answer shows what you are allowed to do.
  • Open the answer in a new window with the link that appears under Invoke.
  • Use the VBScript example only where it is shown. It is not offered on SoftwareCentral Cloud.

6 Troubleshooting

SymptomCauseWhat to do
No answer under Invoke, and the log holds “Failed to invoke web service.”The request could not be built or sent. The error is written to the log as a critical entry.Open the Log, read the entry, and check that every parameter has a value.
The parameters are missing on the Test tab, and the log holds “Failed to get method parameters from method…”The parameters of the method could not be read.Open the Log, read the entry, and try again.
There is no VBScript box on the General tab.The installation is SoftwareCentral Cloud, where the VBScript example is not offered.Use the PowerShell example, or call the HTTP address with the parameters.