Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rest 将AngularJS应用程序与SoftwareAG webMethods集成服务器集成_Rest_Angularjs_Designer_Angularjs Resource_Webmethods - Fatal编程技术网

Rest 将AngularJS应用程序与SoftwareAG webMethods集成服务器集成

Rest 将AngularJS应用程序与SoftwareAG webMethods集成服务器集成,rest,angularjs,designer,angularjs-resource,webmethods,Rest,Angularjs,Designer,Angularjs Resource,Webmethods,我一直在尝试在后端使用webMethods集成服务器设置一个示例AngularJS应用程序。使用$resource,我可以轻松地提取普通的JSON文件并操作文件中的数据。但是,我的目标是在webMethods Designer中创建服务,并使用$resource从AngularJS调用它们,以在我的应用程序中显示数据。问题是,从AngularJS中,我无法从我在Designer中创建的服务中提取所需的数据。在Designer中,我可以使用(在WMPublic中)documentToJSONStr

我一直在尝试在后端使用webMethods集成服务器设置一个示例AngularJS应用程序。使用$resource,我可以轻松地提取普通的JSON文件并操作文件中的数据。但是,我的目标是在webMethods Designer中创建服务,并使用$resource从AngularJS调用它们,以在我的应用程序中显示数据。问题是,从AngularJS中,我无法从我在Designer中创建的服务中提取所需的数据。在Designer中,我可以使用(在WMPublic中)documentToJSONString,并输出如下内容:

jsonString  {"id":"1", "name":"Dan", "quantity":"3"}
但我无法提取数据,因为这不是一个纯JSON字符串。有人知道如何(1)使用AnularJS提取JSON字符串输出数据或(2)从Designer输出JSON文档吗?我打电话给一个休息服务;大意是

http://localhost:2222/rest/Get/getOrderData 
来自AngularJS中的my services.js文件

这是我的services.js文件:

/*服务*/

var orderServices = angular.module('orderServices', ['ngResource']);

orderServices.factory('Order', ['$resource',
  function($resource){
    return $resource('http://localhost:2222/rest/REST/getOrderData', {}, {
       query: {method:'GET', isArray:true}
  });

}]);

然后,在我的应用程序中,我想使用ng repeat调用{{order.id}、{{order.name}等。有人对webMethods和Angular很在行吗?还是以前这么做过?

要强制执行您想要的响应,我会使用该服务 pub.flow:setResponse将jsonString映射到它的字符串参数,并可能将contentType参数硬编码为“application/json”

您可能还需要使用服务pub.flow:setResponseCode来设置响应代码

它们将是getOrderData中的最后一个服务

我会使用下面的方法调用它(其中命名空间是designer中的文件夹结构)


以上内容适用于IntegrationServerV8,看起来您正在使用V9,因为您提到的一些服务在V8中不存在。这也适用于正常的流服务,而不是特定的REST服务(假设它们存在于V9中)。

您能在浏览器中点击该URL并粘贴您得到的内容吗?
http://localhost:2222/invoke/namespace:getOrderData