【问题标题】:http adapter for https protocolhttps 协议的 http 适配器
【发布时间】:2016-09-22 00:10:39
【问题描述】:

我想用 http 适配器读取一个 xml 文件,但协议是 https。我认为解决方案将包括像这样进行转换:

 <connectivity>
        <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
            <protocol>https</protocol>
            <domain>greenhouse.lotus.com</domain>
            <port>443</port>
            <authentication>
                <basic/>
                <serverIdentity>
                    <username> ${user} </username>
                    <password> ${password} </password>
                </serverIdentity>
            </authentication>  
        </connectionPolicy>
        <loadConstraints maxConcurrentConnectionsPerNode="2" />
    </connectivity>

如果这是解决方案,请告诉我如何创建 ${user} 和 ${password}。 Else 向我展示其他解决方案。

【问题讨论】:

    标签: https ibm-mobilefirst mobilefirst-adapters


    【解决方案1】:

    问题不是很清楚...
    也不清楚您的 IBM MobileFirst 版本是什么。我会假设它是 7.1...

    您想从此 XML 文件中获取 $user 和 $password,还是尝试使用适配器访问 XML 文件?

    您不能简单地从 XML 文件中读取值并将它们放在适配器配置文件中的元素中(如上所示)。另请注意,您无法在运行时更改此文件。方法是通过 JNDI 属性或通过 worklight.properties 文件中的自定义属性。

    • 在 you-project/server/ 文件夹中找到 worklight.properties 文件。
    • 添加新行,例如:myPassword=test
    • 然后,在 XML 中,使用:&lt;password&gt;${myPassword}&lt;/password&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-13
      • 2020-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多