java - SOAP 到 REST 转换的代理服务期间的 WSO2 问题
问题描述
我是 WSO2 的新手,对于一个大型项目,我们使用的是 EI 6.1.1。
我们的目标之一是创建一些必须替代一些遗留 SOAP 服务的 REST 服务:为此,我们正在开发 Spring Boot REST,我们的想法是以 SOAP 方式公开这些服务,并使用与遗留服务相同的 WSDL。
我们正在 WSO2 上创建代理服务,并且我们能够在后端调用其余服务,但是,即使 REST 日志记录向我们显示一切正常,SOAP 调用也永远不会发回响应,并且会因读取超时而“死亡” .
我们怎样才能解决这个问题?我将向您发布 proxyService 配置:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="VerificaAmbitiSET_SOAP_AWS"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<filter xmlns:ver="http://XXXXXX.XXXXXX.XXXXXX"
xpath="//ver:getAmbitiSet">
<then>
<property expression="//ver:getAmbitiSet/ver:codiceFiscale"
name="REST_URL_POSTFIX"
scope="axis2"
type="STRING"/>
<property name="HTTP_METHOD" scope="axis2" type="STRING" value="GET"/>
</then>
<else/>
</filter>
<header name="Accept" scope="transport" value="*/*"/>
<send>
<endpoint>
<address format="rest"
uri="http://localhost:8280/services/A_SERVICE/ambitiSet"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL key="conf:/wsdl/A_WSDL.wsdl"/>
<description/>
</proxy>
这是 REST 控制器标志:
@GetMapping(value = "/ambitiSet/{codiceFiscale}")
public List<Ambito> getAmbitiSET(@PathVariable("codiceFiscale") String codiceFiscale)
最后,我的 SOAP 请求如下所示:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ver="http://XXXX.XXXXX.XXXXXX">
<soapenv:Header/>
<soapenv:Body>
<ver:getAmbitiSet>
<ver:codiceFiscale>XXZXZXZXZ</ver:codiceFiscale>
</ver:getAmbitiSet>
</soapenv:Body>
</soapenv:Envelope>
问候。
解决方案
您可以通过启用线路日志来测试响应被丢弃的位置。请关注博客https://medium.com/@tharika/how-to-read-and-understand-wire-logs-in-wso2-products-c384af0b8ea5
推荐阅读
- java - 休眠 - 线程“主”java.lang.IndexOutOfBoundsException 中的异常:索引:0,大小:0
- spring-cloud-stream - Spring cloud sleuth with Spring 云流
- listview - ListView 中的 WebView 未分配其尺寸
- timezone - 难以从片刻中减去时间
- mysql - MySQL join 查询只有一行与引用表
- android - FirestorePagingAdapter 是否一次获取页面中的文档或所有文档然后应用分页?
- c++ - C++:setw() 只在第一行工作,在循环中
- jquery - Jquery:基于行跨长度的新类添加问题
- java - 将 onTouch 事件中文本的背景颜色更改为相应的标签
- ios - UICollectionViewCell 在 UICollectionViewReusableView 宽度之后开始