Effacer les filtres
Effacer les filtres

Can multiple vectors of differing data types be used in one object or matrix for a SOAP message

1 vue (au cours des 30 derniers jours)
I am trying to interface with the Metlin SOAP API and have generated the bindings using createClassFromWsdl. However, the input parameter 'SpectrumMatchRequest' should contain 8 different variables, which is the case for similar database SOAP API messages. Is there a way of combining the different variables into one object or array?
For instance MassBank takes:
function xReturn = searchSpectrum(obj,mzs,intensities,unit,tolerance,cutoff,instrumentTypes,ionMode,maxNumResults)
Below is the method I need to use:
function result = SpectrumMatch(obj,SpectrumMatchRequest) %SpectrumMatch(obj,SpectrumMatchRequest) % % Input: % SpectrumMatchRequest = (SpectrumMatchRequest) % % Output: % result = (spectrumLineInfo)
% Build up the argument lists. values = { ... SpectrumMatchRequest, ... }; names = { ... 'SpectrumMatchRequest', ... }; types = { ... 'SpectrumMatchRequest', ... };
% Create the message, make the call, and convert the response into a variable. soapMessage = createSoapMessage( ... 'Metlin', ... 'SpectrumMatch', ... values,names,types,'rpc'); response = callSoapService( ... obj.endpoint, ... 'SOAP/Metlin#SpectrumMatch', ... soapMessage); result = parseSoapResponse(response);

Réponse acceptée

Iain
Iain le 13 Juin 2013
You can certainly have a cell array:
mycell{1} = uint8([4 5 6]);
mycell{2} = double([4 5 6]);
mycell{3} = 'wibble wobble';
mycell{4} = true;
You can have a structure
mystruct.SevenSins.Greed = 1;
mystruct.SevenSins.Gluttony = uint8([1 4 66]);
mystruct.SevenVirtues.Cleanliness = 'is next to godliness';
... etc etc.
You can also define a class, which is really just a structure with some additional features.
  2 commentaires
Philip  Spratt
Philip Spratt le 13 Juin 2013
Thanks for your quick response Iain. I will give the cell array ago, assuming the 'SpectrumMatchRequest' parameter is read-in one cell array at a time.
Regards Phil
Iain
Iain le 13 Juin 2013
I will say I know nothing about using APIs from matlab.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by