Quantcast

Documentation Center

  • Trial Software
  • Product Updates

createClassFromWsdl

Create MATLAB class based on WSDL document

Syntax

createClassFromWsdl(source)

Description

createClassFromWsdl(source) creates a MATLAB® class, servicename, based on a service name defined in source. The source argument is a string that specifies a URL, full path, or relative path to a Web Services Description Language (WSDL) document located on a server. createClassFromWsdl creates a class folder, @servicename, in the current folder. The class folder contains a method file for each Web service operation, and the display method (display.m) and constructor (servicename.m) for the class.

Examples

Get the methods from the myWebService WSDL document, which specifies two methods. The example does not use an actual WSDL document; therefore, you cannot run it. The example only illustrates how to use the function.

Create the class:

createClassFromWsdl('pathto_myWebService')

MATLAB creates the following in the current folder:

@myWebService
@myWebService/method1.m
@myWebService/method2.m
@myWebService/display.m
@myWebService/myWebService.m
 

Retrieve a student name, given the WSDL document for TestScoreWebService, at http://examplestandardtests.com/scoreswebservice?WSDL. The example does not use an actual WSDL document; therefore, you cannot run it. The example only illustrates how to use the function.

url = 'http://examplestandardtests.com/scoreswebservice?WSDL';
createClassFromWsdl(url);
obj = TestScoreWebService;
% Show the methods
methods(obj)
% Retrieve the first student name
students = StudentNames(obj);
students.StudentInfo(1)

MATLAB returns

StudentNameLast: 'Benjamin'
StudentNameFirst: 'Ali'
 

Display the endpoint and WSDL document location:

display('TestScoreWebService')

MATLAB returns

endpoint: 'http://examplestandardtests.com/scoreswebservice'
    wsdl: 'http://examplestandardtests.com/scoreswebservice?WSDL'

See Also

| | |

Was this topic helpful?