login
说明
login(
提示输入登录凭证并使用生命周期协作开放服务 (OSLC) 服务器对 myClient
)myClient
进行身份验证。
注意
如果 login
函数对您的服务提供商不起作用,请尝试使用 setHttpOptions
和 setHttpHeader
向您的 OSLC 服务提供商验证 oslc.Client
实例。login
函数可能不适用于某些 OSLC 服务提供商。
示例
为需求管理域创建并配置 OSLC 客户端
此示例显示如何在 MATLAB® 中创建 OSLC 客户端并配置该客户端以连接到需求管理域的 OSLC 服务提供商。
创建 OSLC 客户端。
myClient = oslc.Client;
为您的服务提供商设置用户和服务器 URL。然后设置需求管理域的服务根和目录路径以及配置查询路径。
setUser(myClient,'jdoe'); setServer(myClient,'https://localhost:9443'); setServiceRoot(myClient,'rm'); setCatalogPath(myClient,'/oslc_rm/catalog'); setConfigurationQueryPath(myClient,'gc/oslc-query/configurations'); myClient
登录客户端并在提示时输入您的凭据。
login(myClient);
获取指定目录路径和服务根目录中可用的服务提供商。将 OSLC 客户端设置为所需的服务提供商。
providers = getServiceProviderNames(myClient)
providers = 4×1 cell array {'OSLC Plugin' } {'Model Based Design with OSLC' } {'OSLC4RM' } {'Interactive Testing (Requirements Management)'}
setServiceProvider(myClient,'OSLC Plugin');
如果适用,获取可用的配置上下文。将 OSLC 客户端设置为所需的配置上下文。
configurations = getConfigurationContextNames(myClient)
configurations = 2×1 cell array {'Initial Development'} {'Initial Baseline' }
setConfigurationContext(myClient,'Initial Development');
检查客户端属性。
myClient
myClient = Client with properties: ServiceProvider: 'OSLC Plugin' ConfigurationContext: 'Initial Development' CatalogUrl: 'https://localhost:9443/rm/oslc_rm/catalog'
输入参数
myClient
— OSLC 客户端
oslc.Client
对象
OSLC 客户端,指定为 oslc.Client
对象。
版本历史记录
在 R2021a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)