SOAP 웹 서비스에서 일부 데이터를 가져 오기 위해 JavaScript HTTP 어댑터를 사용하려고합니다. 이를 위해 Type8과 함께 MFP8과 Ionic을 사용하고 있습니다. MobileFirst 8 용 JS HTTP 어댑터에 메서드 추가
나는 다음과 같은 어댑터 구현 파일, 여기function getFeed(params) {
var sr =
"<soapenv:Envelope " +
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:len=\"targetNamespace HERE" >" +
"<soapenv:Header/>"+
"<soapenv:Body>" +
"<len:authentication>" +
"<username>"+params[0]+"</username>"+
"<password>"+params[1]+"</password>"+
"</authentication></soapenv:Body></soapenv:Envelope>";
var input = {
method : 'post',
returnedContentType : 'xml',
path : 'PATH HERE',
body: {
content: sr,
contentType: 'text/xml; charset=utf-8',
},
};
return MFP.Server.invokeHttp(input);
}
그리고는 adapter.xml이다가,
<mfp:adapter name="http"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mfp="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>http</displayName>
<description>http</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>DOMAIN NAME HERE</domain>
<port>PORT NO HERE</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="getFeed"/>
</mfp:adapter>
그래서, API 문서를 다음, 나는 내 어댑터를 호출하려면 다음을했다 내 이온 공급자,
var resourceRequest = new WLResourceRequest("adapters/http/getFeed", WLResourceRequest.GET);
resourceRequest.setQueryParameter("params", "['username', 'password']");
resourceRequest.send().then(
function(response) {
alert('response '+JSON.stringify(response.responseText));
},
function(response) {
alert("HTTP Failure "+JSON.stringify(response));
}
);
SOAP 서비스에서 특정 데이터를 가져와야하기 때문에 이자형. 이를 위해서는 매개 변수와 메서드를 전달해야합니다.
지식 센터에서 필자는 쿼리 문자열을 사용하여 매개 변수를 호출하는 방법을 찾았습니다. 매개 변수를 전달할 수 있습니다.
내 요구 사항은 메서드 이름도 전달하는 것입니다.
누구든지 메소드 이름을 전달하는 방법을 알려 줄 수 있습니까?
아무도 감사드립니다.
나는 그걸 시도했습니다. 나는 방법을 얻을 수 없습니다 –
예! 이제 작동 중입니다. 고맙습니다. –