我正在爲基於HTTP soap的調用製作一個適配器,調用代碼如下,同時調用適配器,出現如下錯誤:「Can not read property」Body 「來自未定義」。Soap Adder Isssue:無法從undefined讀取屬性「Body」:WORKLIGHT
SOAPAdapter.xml是:
<wl:adapter xmlns:wl="http://www.worklight.com/integration" xmlns:http="http://www.worklight.com/integration/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="SOAPAdapter">
<displayName>SOAPAdapter</displayName>
<description>SOAPAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>*.*.com</domain>
<port>80</port>
</connectionPolicy>
<loadConstraints maxConcurrentConnectionsPerNode="2"/>
</connectivity>
<procedure name="get_soap_req_list"/>
SOAPAdapter-impl.js是:
功能get_soap_req_list(){
var request =
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
+'<soap:Body>'
+'<AddList xmlns="http://schemas.microsoft.com/sharepoint/soap/">'
+'<listName>tiu</listName>'
+'<description>uyt</description>'
+'<templateID>6</templateID>'
+'</AddList>'
+'</soap:Body>'
+'</soap:Envelope>';
WL.Logger.debug("@@@"+request);
var input = {
method : 'post',
returnedContentType : 'xml',
path : '/_vti_bin/Lists.asmx',
body : {
content: request.toString(),
contentType: 'text/xml; charset=utf-8'
}
};
**27** var result = WL.Server.invokeHttp(input);
**28** return result;
}
控制檯錯誤是:
E:發生錯誤而調用程序SOAPAdapter/get_soap_req_listFWLSE0100E:參數:{ 「ARR」:[] } 類型錯誤:無法讀取屬性 「正文」 從不確定的(d %3A%5CWorklightworkSpace%5Cmodule_05_2_HTTP_Adapter%5Cadapters%5CSOAPAdapter/SOAPAdapter- impl.js#42) FWLSE0101E:空
結果輸出:
致{ 「錯誤」: ], 「信息」: ], 「isSuccessful」:真實, 「responseHeaders響應」:{ 「內容長度」: 「0」, 「日期」:「星期四,2013年六月20日11時08分03秒「, 」MicrosoftSharePointTeamServices「:」14.0.0.6123「, 」SPRequestGuid「:」7a89adce-9ede-4197-bfc4-aff18e85e763「, 」Server「:」Microsoft-IIS/7.5「, 」WWW-Authenticate「:」NTLM「, 」X-MS-InvokeApp「:」1; RequireReadOnly」, 「X供電,經」: 「ASP.NET」 }, 「RESPONSETIME」:156, 「的StatusCode」:401, 「statusReason」: 「未授權」, 「文」: 「」 , 「TOTALTIME」:172, 「警告」: ] }
請看看這個問題的回答可以幫助你? http://stackoverflow.com/questions/15428615/worklight-adapter-invoke-web-ser副錯誤 - 不能讀取屬性體 –