在 wsO2 ESB 上将 SOAP 请求转换为 HTTP 200 return
Converting a SOAP request to a HTTP 200 return on wsO2 ESB
我有一个实例,我需要实现一个代理服务,该服务接收 SOAP 消息,将其转发到内部系统 (SOAP) 并returns 对原始服务器的 HTTP 200 响应。
基本上,响应应该完全没有任何肥皂细节(从技术上讲,我必须实现的 WSDL 中没有输出消息)。
这是我到目前为止所拥有的(它只是接受请求并将其作为响应回显):
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="ExampleHttp200Return"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full" separator=", - inSequence: received - "/>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="SC_ACCEPTED" value="false" scope="axis2"/>
<property name="HTTP_SC" value="200" scope="axis2"/>
<send/>
</inSequence>
</target>
<description/>
</proxy>
如果你想发回一个空的响应,你可以在发送中介之前添加:
<property name="messageType" scope="axis2" value="text/plain"/>
<enrich>
<source type="inline">
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header/>
<soapenv:Body>
<text xmlns="http://ws.apache.org/commons/ns/payload"/>
</soapenv:Body>
</soapenv:Envelope>
</source>
<target type="envelope"/>
</enrich>
我有一个实例,我需要实现一个代理服务,该服务接收 SOAP 消息,将其转发到内部系统 (SOAP) 并returns 对原始服务器的 HTTP 200 响应。
基本上,响应应该完全没有任何肥皂细节(从技术上讲,我必须实现的 WSDL 中没有输出消息)。
这是我到目前为止所拥有的(它只是接受请求并将其作为响应回显):
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="ExampleHttp200Return"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full" separator=", - inSequence: received - "/>
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="SC_ACCEPTED" value="false" scope="axis2"/>
<property name="HTTP_SC" value="200" scope="axis2"/>
<send/>
</inSequence>
</target>
<description/>
</proxy>
如果你想发回一个空的响应,你可以在发送中介之前添加:
<property name="messageType" scope="axis2" value="text/plain"/>
<enrich>
<source type="inline">
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header/>
<soapenv:Body>
<text xmlns="http://ws.apache.org/commons/ns/payload"/>
</soapenv:Body>
</soapenv:Envelope>
</source>
<target type="envelope"/>
</enrich>