2016-09-22 142 views
-1

我想用http適配器讀取xml文件,但協議是https。我認爲解決方案將包括這樣的轉變:http協議的http適配器

<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> 

如果這個解決方案,請你能告訴我如何創建$ {用戶}和$ {}密碼。否則讓我看看其他解決方案。

回答

0

這個問題不是很清楚......
你的IBM MobileFirst版本是什麼也不清楚。我將假設它是7.1 ...

是否希望從此XML文件獲取$ user和$ password,或者是否想要使用適配器嘗試訪問XML文件?

您不能簡單地從XML文件讀取值,並將它們放入適配器配置文件中的元素中(如上所示)。另外請注意,您在運行時期間無法更改此文件。實現它的方法是通過JNDI屬性或通過worklight.properties文件中的自定義屬性。

  • 在you-project/server /文件夾中找到worklight.properties文件。
  • 添加新行,例如:myPassword=test
  • 然後,在XML中使用:<password>${myPassword}</password>