我是 worklight 的新手,并使用 http 适配器将 xml 发布到 web 服务,以便我可以获得结果。但我无法做到这一点,它会给出一些错误。我的代码在 adapter.js 中
function getStories(interest) {
path = getPath(interest);
var input = {
method : 'post',
returnedContentType : 'xml',
path : path
parameters : '<HOME><REQUEST><USERID>701692</USERID><SECURE_KEY>B6F86B1B11E9EAFC</SECURE_KEY><EMPLOYEE_ID>000000000000035B</REQUEST></HOME>'
};
return WL.Server.invokeHttp(input);
}
它给出这样的输出
{ "errors": ["Premature end of file.", "Failed to parse the payload from backend (procedure: HttpRequest)" ], "info": [ ], "isSuccessful": false,
"responseHeaders": { "Cache -Control”:“private”,“Content-Length”:“0”,“Date”:“星期一,2012 年 10 月 15 日 10:29:01 GMT”,“服务器”:“Microsoft-IIS/6.0”,“X -AspNet-Version”:“2.0.50727”,“X-Powered-By”:“ASP.NET”},“statusCode”:200,“statusReason”:“OK”,“警告”:[]}
我想在 worklight 中实现这段代码(如下所示),我该怎么做。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<form name="f1" id="fi" action="http://mydoman.aspx" method="post">
<input TYPE="hidden" name="xml" value="<HOME><REQUEST><USERID>701692</USERID><SECURE_KEY>B6F86B1B11E9EAFC17F5844EE9B16669</SECURE_KEY></REQUEST></HOME>"/>
<input type="submit" value="submit"/>
</form>
</BODY>
</HTML>