Show Table of Contents
13.3. WSDL extensions
You can specify the basic configuration of the JMS transport by inserting WSDL extension elements into the contract, either at binding scope, service scope, or port scope. The WSDL extensions enable you to specify the properties for bootstrapping a JNDI
InitialContext, which can then be used to look up JMS destinations. You can also set some properties that affect the behavior of the JMS transport layer.
the SOAP/JMS WSDL extensions are defined in the
http://www.w3.org/2010/soapjms/namespace. To use them in your WSDL contracts add the following setting to the
<wsdl:definitions ... xmlns:soapjms="http://www.w3.org/2010/soapjms/" ... >
WSDL extension elements
Table 13.4, “SOAP/JMS WSDL extension elements” shows all of the WSDL extension elements you can use to configure the JMS transport.
Table 13.4. SOAP/JMS WSDL extension elements
| ||Specifies the fully qualified Java class name of the JNDI provider. Equivalent to setting the |
| ||Specifies the URL that initializes the JNDI provider. Equivalent to setting the |
| ||Specifies an additional property for creating the JNDI |
| ||Specifies the JNDI name of the JMS connection factory.|
| || ||Specifies whether to use JMS |
| || |
[Optional] Specifies the reply destination for queue messages. The reply destination appears in the
The value of this property is interpreted according to the variant specified in the JMS URI:
| || ||Specifies the JMS message priority, which ranges from 0 (lowest) to 9 (highest).|
| || ||Time, in milliseconds, after which the JMS provider will discard the message. A value of |
The WSDL elements placement in the WSDL contract effect the scope of the configuration changes on the endpoints defined in the contract. The SOAP/JMS WSDL elements can be placed as children of either the
wsdl:serviceelement, or the
wsdl:portelement. The parent of the SOAP/JMS elements determine which of the following scopes the configuration is placed into.
- Binding scope
- You can configure the JMS transport at the binding scope by placing extension elements inside the
wsdl:bindingelement. Elements in this scope define the default configuration for all endpoints that use this binding. Any settings in the binding scope can be overridden at the service scope or the port scope.
- Service scope
- You can configure the JMS transport at the service scope by placing extension elements inside a
wsdl:serviceelement. Elements in this scope define the default configuration for all endpoints in this service. Any settings in the service scope can be overridden at the port scope.
- Port scope
- You can configure the JMS transport at the port scope by placing extension elements inside a
wsdl:portelement. Elements in the port scope define the configuration for this port. They override the defaults of the same extension elements defined at the service scope or at the binding scope.
Example 13.9, “WSDL contract with SOAP/JMS configuration” shows a WSDL contract for a SOAP/JMS service. It configures the JNDI layer in the binding scope, the message delivery details in the service scope, and the reply destination in the port scope.
Example 13.9. WSDL contract with SOAP/JMS configuration
<wsdl:definitions ... 1 xmlns:soapjms="http://www.w3.org/2010/soapjms/" ... > ... <wsdl:binding name="JMSGreeterPortBinding" type="tns:JMSGreeterPortType"> ... 2 <soapjms:jndiInitialContextFactory> org.apache.activemq.jndi.ActiveMQInitialContextFactory </soapjms:jndiInitialContextFactory> <soapjms:jndiURL>tcp://localhost:61616</soapjms:jndiURL> <soapjms:jndiConnectionFactoryName> ConnectionFactory </soapjms:jndiConnectionFactoryName> ... </wsdl:binding> ... <wsdl:service name="JMSGreeterService"> ... 3 <soapjms:deliveryMode>NON_PERSISTENT</soapjms:deliveryMode> <soapjms:timeToLive>60000</soapjms:timeToLive> ... <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort"> 4 <soap:address location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue" /> 5 <soapjms:replyToName> dynamicQueues/greeterReply.queue </soapjms:replyToName> ... </wsdl:port> ... </wsdl:service> ... </wsdl:definitions>
The WSDL in Example 13.9, “WSDL contract with SOAP/JMS configuration” does the following:
- Declares the namespace for the SOAP/JMS extensions.
- Configures the JNDI connections in the binding scope.
- Sets the JMS delivery style to non-persistent and each message to live for one minute.
- Specifies the target destination.
- Configures the JMS transport so that reply messages are delivered on the