编写使 WSIF 服务能够访问 SOAP over JMS 服务的 WSDL 扩展
您可以编写 Web Service 描述语言 (WSDL) 扩展,从而使 Web Services Invocation Framework (WSIF) 服务能够访问将 Java™ 消息服务 (JMS) 用作传输机制的 SOAP 服务。
开始之前
关于此任务
如果 SOAP 消息只包含 XML,那么在带有 JMS 消息体类型 TextMessage 的 Java 消息服务 (JMS) 传输机制上可以携带此消息。包括 SOAP 包络的 SOAP 消息与 JMS 消息合并在一起并且被放在适当的队列上。容器接收 JMS 消息并移除 SOAP 消息以发送到客户机。
使用以下过程和相关联的代码段来帮助您编写 Web Service 描述语言 (WSDL) 扩展,以允许 WSIF 服务访问 SOAP over JMS 服务。
注: 因为 SOAP over JMS 绑定与 SOAP over HTTP 绑定几乎相同,所以在您为 SOAP over HTTP 编写 WSDL 绑定扩展时,也可以使用本过程作为指南。
过程
定义 SOAP over JMS 绑定的 WSDL 的示例
<!-- Example: SOAP over JMS Text Message -->
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
name="StockQuoteInterfaceDefinitions"
targetNamespace="urn:StockQuoteInterface"
xmlns:tns="urn:StockQuoteInterface"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:jms="http://schemas.xmlsoap.org/wsdl/jms/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:message name="GetQuoteInput">
<part name="symbol" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="GetQuoteOutput">
<part name="value" type="xsd:float"/>
</wsdl:message>
<wsdl:portType name="StockQuoteInterface">
<wsdl:operation name="GetQuote">
<wsdl:input message="tns:GetQuoteInput"/>
<wsdl:output message="tns:GetQuoteOutput"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StockQuoteSoapJMSBinding" type="tns:StockQuoteInterface">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/jms"/>
<wsdl:operation name="GetQuote">
<soap:operation soapAction="urn:StockQuoteInterface#GetQuote"/>
<wsdl:input>
<soap:body use="encoded" namespace="urn:StockQuoteService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:StockQuoteService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StockQuoteService">
<wsdl:port name="StockQuoteServicePort"
binding="sqi:StockQuoteSoapJMSBinding">
<jms:address destinationStyle=“queue”
jndiConnectionFactoryName="myQCF"
jndiDestinationName=“myQ”
initialContextFactory=“com.ibm.NamingFactory”
jndiProviderURL=“iiop://something:900/”>
<jms:propertyValue name=“targetService”
type=“xsd:string”
value=“StockQuoteServicePort”/>
</jms:address>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>