Documentation Center

  • Trial Software
  • Product Updates

How You Can Use Web Services with MATLAB

What Are Web Services in MATLAB?

Web services allow applications running on disparate computers, operating systems, and development environments to communicate with each other. Using Web services technologies, client workstations can access and execute APIs residing on a remote server. The client and server communicate via XML-formatted messages, following the W3C® SOAP protocol, and typically via the HTTP protocol.

MATLAB® acts as a Web service client, providing functions you can use to access existing Web services on a server. The functions facilitate communication with the server, relieving you of the need to work with XML, complex SOAP messages, and special Web services tools. Through these functions, you can use Web services in your normal MATLAB environment, such as in the Command Window and in MATLAB programs you write.

Diagram Showing Web Services in MATLAB

An organization that wants to make APIs available to disparate clients creates the APIs and related Web service facilities for the server, using tools from Apache Axis, for example. Organizations can choose to make the Web services available only to local clients via the organization's intranet, or can offer them to the general public via the Web.

What You Need to Use Web Services with MATLAB

You need to find out from your own organization and the organizations you work with if they provide Web services of interest to you. There are publicly available Web services, some for free and some provided for a fee. For links to some of these Web services, see Where to Get Information About Web Services.

Functions for MATLAB Web services work with Web services that comply with the Basic Profile 1 to SOAP Binding specification. To find out more about the SOAP standards, see the links in Where to Get Information About Web Services.

You need to know basic information about the Web services you want to use.

You need access to the server from the workstation where you use MATLAB. If there is a proxy server, you need to provide settings for it to MATLAB using Web preferences. To do so, on the Home tab, in the Environment section, click Preferences > Web. For more information, click the Help button in the Preferences dialog box.

Typical Applications Using Web Services with MATLAB

Accessing Data from a Server

You are creating new climate models using MATLAB, and you want to use climate data from a database housed at a government weather bureau. The bureau's server provides access to the database via Web services so that anyone who has Web service client technologies can retrieve the data, regardless of their operating system or development tools. You use functions for MATLAB Web services to get the data from the server, and then you use the data in MATLAB to develop your models.

Running Computations on a Server

A weather bureau provides Web services that allow you to run complex models on their systems, using your data and parameters. You use functions for MATLAB Web services to specify your input, run the models on the bureau's server, and get back the results for your use in MATLAB.

Updating a Database on a Server

A weather bureau provides a Web service for researchers involved in a widespread climate study to submit their results. Researchers use a variety of systems and tools, but they need to provide their results using the server's Web service facilities. As one of the researchers, you use MATLAB to generate the results for the study, and you use functions for MATLAB Web services to submit your results to the server.

Activating MATLAB License

If you have activated MATLAB, you used a Web service. After you install MATLAB, you activate your installation by getting a license file from a server at MathWorks. To get the file for your installation, MATLAB uses a Web service provided on a MathWorks server. With the activation Web service, you provide information to MathWorks, and in return, the server provides a license file to your MATLAB installation. MATLAB provides a user interface for the activation that makes you unaware you are using a Web service.

Was this topic helpful?