External Interfaces Previous page   Next Page

What Are Web Services in MATLAB?

The term Web service encompasses a set of XML-based technologies for making remote procedure calls over a network. The network can be a local intranet within an organization or a remote server on the other side of the globe. In short, Web services are designed to let applications running on disparate operating systems and development platforms communicate with each other.

MATLAB acts as a Web service client by sending requests to a server and handling the responses. MATLAB implements the following Web service technologies:

SOAP defines a standard for making XML-based exchanges between clients and servers. The client/server interaction, which usually takes place over HTTP, is initiated by the client. When the server receives the request, which includes the operation to be performed and any necessary parameters, it sends back a response.

The following example shows a simple HTTP-based SOAP request for retrieving the local temperature by zip code:

The SOAP protocol defines an envelope, and inside the envelope, defines a message body. Also, inside the message body, the SOAP method is specified, getTemp, as well as the zipcode parameter.

In the response sent by the server, notice that the SOAP message structure is similar:

In the code, SOAP defines the envelope and message body as well as the response (return).

Most SOAP implementations use WSDL, an XML-based language, to describe and locate available services. The following example shows the message and service definitions of the WSDL file for the temperature service from the previous examples:

In the code, the request and response message actions (getTempRequest and getTempResponse) and the service name (TemperatureService) are defined.


Previous page  Web Services in MATLAB Understanding Data Type Conversions Next page

© 1994-2005 The MathWorks, Inc.