如何调用适配器混合应用程序MobileFirst Platform 6.3

时间:2015-03-31 04:31:29

标签: ibm-mobilefirst mobilefirst-adapters

我有一些错误

  

引起:FWLSE0099E:调用过程时发生错误[project EMoney] InquiryAdapters / HttpRequestFWLSE0100E:参数:[project EMoney]   Http请求失败:org.apache.http.conn.HttpHostConnectException:连接到rss.cnn.com:80 [rss.cnn.com/74.125.200.121]失败:连接超时:连接

     

FWLSE0101E:引起:[项目EMoney] org.apache.http.conn.HttpHostConnectException:连接到rss.cnn.com:80 [rss.cnn.com/74.125.200.121]失败:连接超时:connectjava。 lang.RuntimeException:Http请求失败:org.apache.http.conn.HttpHostConnectException:连接到rss.cnn.com:80 [rss.cnn.com/74.125.200.121]失败:连接超时:连接

     

引起:org.apache.http.conn.HttpHostConnectException:连接到rss.cnn.com:80 [rss.cnn.com/74.125.200.121]失败:连接超时:连接

     

引起:java.net.ConnectException:连接超时:连接

inquiryAdapters.xml

<wl:adapter name="InquiryAdapters"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:wl="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">

<displayName>InquiryAdapters</displayName>
<description>InquiryAdapters</description>
<connectivity>
    <connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
        <protocol>http</protocol>
        <domain>rss.cnn.com</domain>
        <port>80</port> 
        <connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
        <socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
        <maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
        <!-- Following properties used by adapter's key manager for choosing specific certificate from key store  
        <sslCertificateAlias></sslCertificateAlias> 
        <sslCertificatePassword></sslCertificatePassword>
        -->     
    </connectionPolicy>
</connectivity>

<procedure name="getStories"/>

<procedure name="getStoriesFiltered"/>

<procedure name="getFeedsFiltered"/>
</wl:adapter>

inquiryAdapters.impl

function getStories(interest) {
path = getPath(interest);

var input = {
    method : 'get',
    returnedContentType : 'xml',
    path : path
};
return WL.Server.invokeHttp(input);}


function getStoriesFiltered(interest) {
path = getPath(interest);

var input = {
    method : 'get',
    returnedContentType : 'xml',
    path : path,
    transformation : {
        type : 'xslFile',
        xslFile : 'filtered.xsl'
    }
};

return WL.Server.invokeHttp(input);}


function getFeedsFiltered() {

var input = {
    method : 'get',
    returnedContentType : 'xml',
    path : "rss.xml",
    transformation : {
        type : 'xslFile',
        xslFile : 'filtered.xsl'
    }
};

return WL.Server.invokeHttp(input);}


function getPath(interest) {
if (interest == undefined || interest == '') {
    interest = '';
}else {
    interest = '_' + interest;
}
return 'rss/edition' + interest + '.rss';}

当我想调用适配器(http适配器)时。

1 个答案:

答案 0 :(得分:1)

如果您已按照后续步骤进行“连接超时”错误,则可能存在与MobileFirst Platform 6.3无关的网络问题:检查阻止您的连接到达CNN.com的所有防火墙

  1. 创建了一个新项目
  2. 创建新的HTTP适配器
  3. 右键单击适配器文件夹&gt;部署MobileFirst适配器
  4. 右键单击适配器文件夹&gt;致电MobileFirst Adapter
  5. 现在应该打开一个响应的浏览器窗口。