| Contents | Index |
message = createSoapMessage(namespace,method,values,names,types,style)
message = createSoapMessage(namespace,method,values,names,types,style) creates a SOAP message based on the values you provide for the arguments. message is a Sun Java document object model (DOM). To send message to the Web service, use it with callSoapService.
| Argument | Description |
|---|---|
| namespace | Location of the Web service in the form of a valid Uniform Resource Identifier (URI). |
| method | Name of the Web service operation you want to run. |
| values | Cell array of input you need to provide for the method. |
| names | Cell array of parameters for method. |
| types | Cell array defining the XML data types for values. Specifying style is optional; when you do not include the argument, MATLAB uses unspecified. |
| style | Style for structuring the SOAP message, either 'document' or 'rpc'. Specifying style is optional; when you do not include the argument, MATLAB uses rpc. Use a style supported by the service you specified in namespace. |
This example uses createSoapMessage in conjunction with other SOAP functions to retrieve information about books from a library database, specifically, the author's name for a given book title.
Note The example is not based on an actual endpoint; therefore, you cannot run it. The example only illustrates how to use the SOAP functions. |
% Create the message:
message = createSoapMessage(...
'urn:LibraryCatalog',...
'getAuthor',...
{'In the Fall'},...
{'nameToLookUp'},...
{'{http://www.w3.org/2001/XMLSchema}string'},...
'rpc');
%
% Send the message to the service and get the response:
response = callSoapService(...
'http://test/soap/services/LibraryCatalog',...
'urn:LibraryCatalog#getAuthor',...
message)
%
% Extract MATLAB data from the response
author = parseSoapResponse(response)MATLAB returns:
author = Kate Alvin
where author is a char class (type).
callSoapService | createClassFromWsdl | parseSoapResponse | urlread | xmlread

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |