Syntax to specify authorization credentials for a SOAP/WSDL web service

2 views (last 30 days)
There's a SOAP service and I've used its WSDL to automatically create a bunch of methods. When I called a test service, I got the reply as supposed to. However, When I call a service method that requires authorization I only get an error.
Error using callSoapService (line 147) Unspecified Fault: SOAP Fault: Server was unable to process request. ---> The parameterized query '(@uid nvarchar(99)) SELECT PassW FROM UserData WHERE UserId = @' expects the parameter '@uid', which was not supplied.
I understand it's because I've specified the credentials using incorrect syntax. I've tried this (amongst a lot of other stuff).
myAuthorization = ['user', 'pass'];
myAuthorization = {'user', 'pass'};
myAuthorization = ['user' 'pass'];
myAuthorization = {'user' 'pass'};
The I believe that the problem is that the WSDL file keeps user name and password tags as subtags to the authorization tag. This is what the XML look like, followed by the mapping that Matlab has created for me.
function GetSectionsResult = GetSections(obj,auth)
% GetSections(obj,auth)
% Input: auth = (Authorize)
% Output: GetSectionsResult = (ArrayOfString)
values = { auth, };
names = { 'auth', };
types = { '{WSPro.HostingWebservice}Authorize', };
soapMessage = createSoapMessage( ...
'WSPro.HostingWebservice', ...
'GetSections', values,names,types,'document');
response = callSoapService( obj.endpoint, ...
'WSPro.HostingWebservice/GetSections', soapMessage);
GetSectionsResult = parseSoapResponse(response);
And this is the service info I get when I browse to it.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=...>
<GetSections xmlns="WSPro.HostingWebservice">
<auth>
<uid>string</uid>
<pw>string</pw>
</auth>
</GetSections>
</soap:Envelope>
*How should I specify the information? *
I've browsed all the files automatically created for me and there's no definition of Authorize not ArrayOfString. I'm guessing it's something that the server defines, since I get no hits on those in MatLab documentation.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!