Adpater正在工作,從調用Adapter選項進行檢查。 但從Javascript調用沒有響應變得 通過獲取值說123456, 但沒有得到迴應,沒有sucsesess,沒有失敗。工作燈適配器未從javascript調用
POST.xml
<displayName>POST</displayName>
<description>POST</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>164.100.222.200</domain>
<port>80</port>
<connectionTimeoutInMilliseconds>60000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>60000</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="trackerLogin" />
<procedure name="setTrackerLocation" />
<procedure name="getTrackerLocation" />
<procedure name="updateStatus" />
</wl:adapter>
// POST-impl.js
function trackerLogin() {
var input = {
method : 'get',
returnedContentType : 'json',
path : '/WomenSafety/api/TrackerLogin/123456789?Password=123456'
};return WL.Server.invokeHttp(input);
}
// Main.js
function login(pass)
{
busyIndicator.show();
//var imei='123456789';
if(pass!=='')
{
var invocationData = {
adapter : "POST",
procedure : "trackerLogin",
parameters : []
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : function(resp) {
alert('1111');
},
onFailure : function(resp) {
alert('2222');
},
});
/* var ONE_MINUTE = 60 * 1000;
var options = {
onSuccess : loginSuccess,
onFailure : loginFailure,
timeout : ONE_MINUTE
};
var invocationData = {
adapter : 'POST',
procedure : 'trackerLogin',
parameters : [imei,pass]
};*/
// WL.Client.invokeProcedure(invocationData, options);
alert('@@-'+pass);
}
else
{
alert('Enter Password');
}
busyIndicator.hide();
}
function loginSuccess(result)
{
//var status=result.statusCode;
alert('1111');
if(status==200)
{
alert('Login');
}
else
{alert('Network Error');}
}
function loginFailure(result)
{alert('Server Error');}
我想這裏有什麼錯誤:'路徑:'/ WomenSafety/api/TrackerLogin/123456789?Password = 123456'',你怎麼知道這是正確的? –
@IdanAdar我運行適配器,RightClick-> RunAs-> CallMobileFirstAdapter響應顯示在瀏覽器中,但相同的功能不能通過js調用運行,我需要sol.today,是ant的http適配器示例,pat是URL而不是xml – Shivam
請用正確的英文書寫......如果您今天「需要解決方案」,請不要在堆棧溢出問題上提出問題。打開PMR。 –