簡體   English   中英

wso2高速緩存介體響應以二進制形式(應為XML)

[英]wso2 cache mediator response in binary (it should be XML)

我正在學習wso2 ESB 4.6.0。 我正在研究調解員。 我實現了緩存中介器,如下所示。

<proxy xmlns="http://ws.apache.org/ns/synapse" name="cacheProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <cache id="myCache" scope="per-mediator" collector="false" hashGenerator="org.wso2.caching.digest.DOMHASHGenerator" timeout="3" maxMessageSize="1000">
            <implementation type="memory" maxSize="1000"/>
         </cache>
         <send>
            <endpoint>
               <address uri="http://localhost:44444/ws/MediatorsWS"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <cache id="myCache" scope="per-mediator" collector="true"/>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="http://localhost:44444/ws/MediatorsWS"/>
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost:44444/ws/MediatorsWS?wsdl"/>
   <description></description>
</proxy>

它重定向到使用接收SOAP 1.1的JAX-WS實現的Web服務。 這是wsdl:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://clone.ws.wso2lessons/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://clone.ws.wso2lessons/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
<xsd:import namespace="http://clone.ws.wso2lessons/" schemaLocation="cacheProxy?xsd=http://localhost:44444/ws/MediatorsWS?xsd=1.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="receiveMessage">
<wsdl:part name="parameters" element="tns:receiveMessage"/>
</wsdl:message>
<wsdl:message name="receiveMessageResponse">
<wsdl:part name="parameters" element="tns:receiveMessageResponse"/>
</wsdl:message>
<wsdl:message name="replyMessage">
<wsdl:part name="parameters" element="tns:replyMessage"/>
</wsdl:message>
<wsdl:message name="replyMessageResponse">
<wsdl:part name="parameters" element="tns:replyMessageResponse"/>
</wsdl:message>
<wsdl:portType name="cacheProxyPortType">
<wsdl:operation name="receiveMessage">
<wsdl:input message="tns:receiveMessage" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/receiveMessageRequest"/>
<wsdl:output message="tns:receiveMessageResponse" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/receiveMessageResponse"/>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<wsdl:input message="tns:replyMessage" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/replyMessageRequest"/>
<wsdl:output message="tns:replyMessageResponse" wsaw:Action="http://clone.ws.wso2lessons/MediatorsWS/replyMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="cacheProxySoap11Binding" type="tns:cacheProxyPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="receiveMessage">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="cacheProxySoap12Binding" type="tns:cacheProxyPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="receiveMessage">
<soap12:operation soapAction="" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<soap12:operation soapAction="" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="cacheProxyHttpBinding" type="tns:cacheProxyPortType">
<http:binding verb="POST"/>
<wsdl:operation name="receiveMessage">
<http:operation location="receiveMessage"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replyMessage">
<http:operation location="replyMessage"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="cacheProxy">
<wsdl:port name="cacheProxyHttpSoap11Endpoint" binding="tns:cacheProxySoap11Binding">
<soap:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpSoap11Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsSoap11Endpoint" binding="tns:cacheProxySoap11Binding">
<soap:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsSoap11Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsSoap12Endpoint" binding="tns:cacheProxySoap12Binding">
<soap12:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsSoap12Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpSoap12Endpoint" binding="tns:cacheProxySoap12Binding">
<soap12:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpSoap12Endpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpsEndpoint" binding="tns:cacheProxyHttpBinding">
<http:address location="https://PCPPTCERTDEV01:8243/services/cacheProxy.cacheProxyHttpsEndpoint"/>
</wsdl:port>
<wsdl:port name="cacheProxyHttpEndpoint" binding="tns:cacheProxyHttpBinding">
<http:address location="http://PCPPTCERTDEV01:8280/services/cacheProxy.cacheProxyHttpEndpoint"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

當我向操作ReplyMessage發送消息時,響應消息被成功緩存(java方法上有System.out.println(),在緩存時間范圍內未調用它)。 但是,我得到的返回消息是這樣的:

<axis2ns27:binary xmlns:axis2ns27="http://ws.apache.org/commons/ns/payload">PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxTOkVudmVsb3BlIHhtbG5zOlM9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3NvYXAvZW52ZWxvcGUvIj48UzpCb2R5PjxuczI6cmVwbHlNZXNzYWdlUmVzcG9uc2UgeG1sbnM6bnMyPSJodHRwOi8vY2xvbmUud3Mud3NvMmxlc3NvbnMvIj48cmV0dXJuPmhlbGxvIHRoZXJlIHJlc3BvbmRpZGEuPC9yZXR1cm4+PC9uczI6cmVwbHlNZXNzYWdlUmVzcG9uc2U+PC9TOkJvZHk+PC9TOkVudmVsb3BlPg==</axis2ns27:binary>

如果我不使用此介體,則會正確返回消息。 我在這里想念什么?

我們使用直通傳輸,它不會生成消息。您可以切換回NIO傳輸並進行檢查嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM