| Contents | Index |
| On this page… |
|---|
MATLAB SOAP functions automatically convert XML data types used in SOAP messages to MATLAB types (classes), and vice-versa. The following table contains the XML type and the corresponding MATLAB type.
| XML Data Type | MATLAB Type (Class) |
|---|---|
string | char array |
boolean | logical scalar |
decimal | double scalar |
float | double scalar |
double | double scalar |
duration | double scalar |
time | double scalar |
date | double scalar |
gYearMonth | char array |
gYear | char array |
gMonthDay | char array |
hexbinary | double array |
base64Binary | double array |
anyURI | char array |
QName | char array |
When creating MATLAB files that rely on Web services, consider the following:
If the Web service you want to use is on the Internet, your application performance could be unpredictable because it depends in part on Internet performance.
Conventions and established procedures for Web services and related technologies, like WSDL and SOAP, are still evolving. You could find inconsistencies or unexpected behavior when using Web services.
A Web service could change over time, which can impact its usage and results in MATLAB.
Use common program control and error-handling routines to minimize the risks, such as:
Use Try - Catch statements to catch errors that result from method calls or from the createClassFromWsdl function.
Use If statements to determine if expressions or statements are true or false. For example, if you have a valid URL for a WSDL document, you can determine whether or not you have a local copy of the WSDL document. If you do not, you can achieve better performance if you create a local copy and use the local copy instead of the version at the URL:
wsdlUrl = ['http://www.xmethods.net/sd/2001' ...
'/CurrencyExchangeService.wsdl'];
wsdlFile = 'CurrencyExchangeService.wsdl';the following if statement stores the WSDL locally, if it does not already exist:
if ~(exist(wsdlFile,'file') == 2)
urlwrite(wsdlUrl,wsdlFile);
end
Use error functions to report specific errors. The following example shows an error function used in an try - catch statement:
try
students = studentNames(obj);
catch
error('Could not return name.');
end
For more information about program control and error-handling statements, see Error Reporting in a MATLAB Application.
![]() | Accessing Web Services Using MATLAB SOAP Functions | Where to Get Information About Web Services | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |