Documentation Center

  • Trial Software
  • Product Updates

Ways of Using Web Services in MATLAB

Two Basic Ways to Access Web Services from MATLAB

There are two primary ways for using Web services in MATLAB®, using the createClassFromWsdl function, or using the SOAP functions. When the Web service you want to use provides a Web Services Description Language (WSDL) document, use the MATLAB createClassFromWsdl function because it provides a more convenient way to work with the service. The createClassFromWsdl function actually uses the SOAP functions, but with it, you do not need to know how to use the SOAP protocol. When the Web service does not provide a WSDL document, use the MATLAB SOAP functions: createSoapMessage, callSoapService, and parseSoapResponse.

If you want to perform similar tasks with different Web services that provide WSDL documents, you might be able to create and use less code by using the SOAP functions instead of the createClassFromWsdl function.

How MATLAB Accesses Web Services

Both the createClassFromWsdl function and the SOAP functions access Web services in the same basic way:

  1. You initiate interaction with the server by sending a request via MATLAB Web service functions. You provide input about the location of the Web service, the operation you want to perform, and any necessary parameters.

  2. From your input, MATLAB constructs the SOAP message and sends it to the server.

  3. When the server receives the request, it performs the processing and sends a SOAP response back to MATLAB.

  4. MATLAB handles the response from the server, extracting data from the SOAP message and converting it for use in MATLAB.

Was this topic helpful?