Call a Web Service Defined by a WSDL File

The Web Services Description Language (WSDL) document contains all the relevant information about the Web Service procedure, including the location of the service and the operations (or methods) the service exposes. Declaring a web services via the WebDescription action or method is considered high-level and easy-to-use. If you wish to declare Web services in a more specific and low-level manner, then use WebDeclare.

It is assumed that when the WebDescription method is used, that the parameters and return arguments are known by the user, because they are in the WSDL file. It is therefore the user's responsibility to pass the right number of arguments and return values of the correct type to the subsequent WebCall method.

TIP

If you want to use User-Defined types within a web service, then you must use WebDeclare. WebDescription does not support user-defined types.

Using a script to call a web service

  1. Within Newlook Developer open the Web Services Description window by selecting Tools | Web Services Description from the main menu.
  2. Type the URL of the web service WSDL file in the Address entry field (such as http://www.webservicex.net/ConvertTemperature.asmx?WSDL).
  3. Click the GO button to retrieve the details of the Web Service.
  4. Within the resulting WSDL document note the SOAP operation name and expand this item to see details of the Input and Output parameters it uses.
  5. Close this window.
  6. Open a new script by selecting Logic | Scripts () from the Developer Bar, click New.
  7. In the properties pane give your script a relevant name and select your preferred scripting language.
  8. Within the Script Editor use the WebDescription and WebCall methods to define and execute the script respectively. The Web Services Description window that we opened in step 4 can be used to determine both the procedure (or operation name) and any arguments that the service takes.

Using a macro to call a web service

  1. Within Newlook Developer open the Web Services Description window by selecting Tools | Web Services Description from the main menu.
  2. Type the URL of the web service WSDL file in the Address entry field (such as http://www.webservicex.net/ConvertTemperature.asmx?WSDL).
  3. Click the GO button to retrieve the details of the Web Service.
  4. Within the resulting WSDL document note the SOAP operation name and expand this item to see details of the Input and Output parameters it uses.
  5. Close this window.
  6. Create a new macro by selecting Logic | Macros () from the Developer Bar.
  7. Assign a relevant name to your macro.
  8. Add a WebDescription action to define the Web Service details.
  9. Set the WSDL argument to the URL of the WSDL file for the Web Service (for example http://www.webservicex.net/ConvertTemperature.asmx?WSDL).
  10. Set the Procedure argument to the name of the Web Service operation that was obtained in step 4 (for example ConvertTemp).
  11. Leave the Alias argument blank or set it to an alternate name that you would like to use for this Web Service.
  12. Add a WebCall action to the macro to call the Web Service.
  13. Set the Procedure name to the Procedure or Alias specified in the WebDescription action.
  14. Set the Arguments parameter to the values that you want to pass to the Web Service (for example "10", "degreeCelsius","degreeFahrenheit").
  15. Set the Returns parameter to the name of a variable the will received the return value from the Web Service (for example varTempFahr).

See Also

Web Services Walkthroughs | WebDescription method | WebCall method | Calling a web service that has been manually defined | WebDescription action | WebCall action