Web services 如何在web服务调用中输入凭据(授权对象)?
我听从了这个建议,效果很好。现在,我正在连接到服务器并调用一个名为GetFunctionityTest的方法。它的唯一输入是一个字符串,可以在getFunctionityTest.m文件中看到。到目前为止还不错 然后我尝试调用名为GetSections的实际服务,根据文件GetSections.m,该服务的签名如下Web services 如何在web服务调用中输入凭据(授权对象)?,web-services,matlab,soap,wsdl,Web Services,Matlab,Soap,Wsdl,我听从了这个建议,效果很好。现在,我正在连接到服务器并调用一个名为GetFunctionityTest的方法。它的唯一输入是一个字符串,可以在getFunctionityTest.m文件中看到。到目前为止还不错 然后我尝试调用名为GetSections的实际服务,根据文件GetSections.m,该服务的签名如下 function GetSectionsResult = GetSections(obj,auth) % GetSections(obj,auth) % Input: auth =
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);
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=...>
<soap:Body>
<GetSections xmlns="WSPro.HostingWebservice">
<auth>
<uid>string</uid>
<pw>string</pw>
</auth>
</GetSections>
</soap:Body>
</soap:Envelope>
myAuthorization = ['user', 'pass'];
myAuthorization = {'user', 'pass'};
myAuthorization = ['user' 'pass'];
myAuthorization = {'user' 'pass'};
服务器提供的定义如下所示
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);
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=...>
<soap:Body>
<GetSections xmlns="WSPro.HostingWebservice">
<auth>
<uid>string</uid>
<pw>string</pw>
</auth>
</GetSections>
</soap:Body>
</soap:Envelope>
myAuthorization = ['user', 'pass'];
myAuthorization = {'user', 'pass'};
myAuthorization = ['user' 'pass'];
myAuthorization = {'user' 'pass'};
没有任何帮助。我只是犯了一大堆错误
使用callSoapService时出错(第147行)未指定的错误:SOAP错误:服务器无法处理请求。
--->参数化查询
“(@uid nvarchar(99))从UserData中选择PassW,其中UserId=@”需要未提供的参数“@uid” 我已经浏览了所有为我自动创建的文件,并且没有授权而不是ArrayOfString的定义。我猜这是服务器定义的东西,因为我在MatLab文档中没有找到这些东西
SOAP身份验证通过SOAP标头而不是SOAP正文进行。此链接可能会让您了解在进行身份验证时SOAP XML的外观:
SOAP身份验证通过SOAP头而不是SOAP体进行。此链接可能会让您了解在进行身份验证时SOAP XML的外观:我明白了。但我仍然需要依赖基于WSDL文件为我创建的方法。要输入的第二个参数是授权信息。我需要手工重建方法吗?你能看看wsdl定义吗?WSDL查找-点击服务提供商的URL,后跟“?WSDL”Ex:mydomain:port/?WSDL。我在寻找:问题中引用了通过点击WSDL文件提供的所有内容。没有任何行动。我只省略了信封标签,但这是每个通话的默认设置。我还打了一个电话到另一个地方,通过一个简单的字符串进行授权(比如许可证密钥,而不是名称/通行证的组合),一切都很顺利。因此,基本上,我开始考虑MatLab的SOAP管理的一个限制,即不能处理抽象数据类型(