1

在使用 Worklight Application Framework 编辑器测试由“从服务创建数据对象”生成的 HTTP 适配器过程代码时,它会生成以下错误:

无法处理没有有效操作参数的请求。请提供有效的肥皂动作。

这是 Web 服务 URL:http ://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

过程调用结果:

{
   "Envelope": {
      "Body": {
         "Fault": {
            "Code": {
               "Value": "soap:Sender"
            },
            "Detail": "",
            "Reason": {
               "Text": {
                  "CDATA": "Unable to handle request without a valid action parameter. Please supply a valid soap action.",
                  "lang": "en"
               }
            }
         }
      },
      "soap": "http:\/\/www.w3.org\/2003\/05\/soap-envelope",
      "xsd": "http:\/\/www.w3.org\/2001\/XMLSchema",
      "xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance"
   },
   "errors": [
   ],
   "info": [
   ],
   "isSuccessful": true,
   "responseHeaders": {
      "Cache-Control": "private",
      "Content-Length": "500",
      "Content-Type": "application\/soap+xml; charset=utf-8",
      "Date": "Mon, 28 Apr 2014 07:56:34 GMT",
      "Server": "Microsoft-IIS\/7.5",
      "X-AspNet-Version": "2.0.50727",
      "X-Powered-By": "ASP.NET"
   },
   "responseTime": 1476,
   "statusCode": 500,
   "statusReason": "Internal Server Error",
   "totalTime": 1477,
   "warnings": [
   ]
}
4

1 回答 1

1

正在考虑在未来的 Worklight 版本中支持 HTTP 标头中的 SOAP 操作。

如果您希望在 Worklight Studio v6.1 中调用生成的适配器,则必须修改生成的 SOAP 适配器并手动添加操作头。

例如,为了调用GetWeatherInformation操作,您可以打开生成的适配器 JS 文件并添加以下行:

headers = headers || {};
headers.SOAPAction = 'http://ws.cdyne.com/WeatherWS/GetWeatherInformation';

Weather_GetWeatherInformation函数,就在此函数结束时调用invokeWebService之前。

于 2014-04-30T12:57:24.373 回答