1.SOAP到REST协议转换

打开policystudio,加入一个policy Container.

Oracle API Gateway SOAP到REST协议转换

Oracle API Gateway SOAP到REST协议转换

 

搜索extract rest

Oracle API Gateway SOAP到REST协议转换

 

Oracle API Gateway SOAP到REST协议转换

 

Oracle API Gateway SOAP到REST协议转换

设置成为start

Oracle API Gateway SOAP到REST协议转换

搜索set message,将url中的变量设置回需要的xml里面

Oracle API Gateway SOAP到REST协议转换

注意content-type和message body里面的内容需要和soap ui里面的调用保持一致.

Oracle API Gateway SOAP到REST协议转换

 

Oracle API Gateway SOAP到REST协议转换

选择set http verb,设置成POST模式

Oracle API Gateway SOAP到REST协议转换

选择Connect to URL设置URL为最终提供服务的URL(业务服务)

Oracle API Gateway SOAP到REST协议转换

完成后最后的策略如下,同时选择匹配的路径.

Oracle API Gateway SOAP到REST协议转换

设置外部REST服务的路径

Oracle API Gateway SOAP到REST协议转换

测试,发现调用成功,返回XML.

Oracle API Gateway SOAP到REST协议转换

2.将XML转换成JSON

在原有的流上继续修改,选择retrive from message.

Oracle API Gateway SOAP到REST协议转换

添加Xpath

Oracle API Gateway SOAP到REST协议转换

通过APIExpoler将xpath的路径选择出来.

Oracle API Gateway SOAP到REST协议转换

 

Oracle API Gateway SOAP到REST协议转换

然后选择XML to JSON

Oracle API Gateway SOAP到REST协议转换

 

Oracle API Gateway SOAP到REST协议转换

然后测试.成功!

Oracle API Gateway SOAP到REST协议转换

 

相关文章: