我有一个由第三方建立的网络服务。我只是想消耗它。我使用JQuery作为下面这样做。
var dwhServiceUrl = 'http://10.62.210.138/DWHWebService/hubservice.asmx/GetHubDetailUser';
// call segmentation svc
CallAjaxAsync('POST', SegmentSuccess, '', dwhServiceUrl,
{
strWSUserName: 'XXX',
strWSPassword: 'XXX',
strApplicationId: '1',
strCompanyId: '1',
strRole: 'XXX',
strUserID: 'XXX',
strOptionList: 'HIGHLIGHT',
strFieldName: 'POLICY NO',
strFieldValue: '<%=Session["Source_Policy_No"]%>'
});
CallAjaxAsync
定义
function CallAjaxAsync(type, FuncSuccess, FuncError, url, param) {
if (param != '') {
param = JSON.stringify(param)
}
$.ajax({
type: type,
url: url,
data: param,
async: true,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: FuncSuccess,
error: FuncError,
headers: {
"Authorization": "apikey:APIKEY,tokenid:4a5ba979-0c56-468d-87c7-30a22759f7ce",
"Accept-Language": "en-US"
}
});
但我没有收到任何回复。它的状态为Cancelled
以及控制台的“网络”标签上的OPTIONS
中的方法。