Basically a service exposed on JMS should be able to accept and process both SOAP and REST messages. Following configuration is a sample proxy configuration which is capable of doing this. That assume that the REST(POX) messages comes with the Content-Type application/xml. And SOAP messages comes with Content-Type application/soap+xml.
<proxy name="StockQuoteProxy" transports="jms">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
</inSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
<jmsProperty>contentType</jmsProperty>
<default>application/soap+xml</default>
</rules>
</parameter>
</proxy>
The JMS transport try to decide the content type from the message using getStringProperty JMS API of JMS message and if fails try to stick to the default Contnet-Type given in the configuration. The name of the content type property can be given in jmsProperty because content-type not a standard in JMS world.
This is a cool feature if you want to use the same proxy to accept both SOAP and REST messages over JMS.
0 comments:
Post a Comment