SOAP 1.2 over JMS in Rational Application Developer 8.0.1

People who wrote the SOAP 1.2 spec was very kind and provided a short introduction in SOAP Version 1.2 Part 0: Primer (Second Edition). I had a very pleasant reading and didn’t expect to learn it as easily and quickly. It was just before I was wondering whether to use the SOAP 1.2 or SOAP 1.1 as the Protocol for a new WSDL. I had no longer any doubts to use the former.

I was interested in the latest changes in SOAP/JMS spec, so I spent a few minutes reading SOAP over Java Message Service 1.0. It was a pleasant reading, too.

The SOAP over JMS is supported by the latest IBM WebSphere Application Server V7 as noted in the document Using SOAP over JMS to transport Web services:

“WebSphere® Application Server Version 7.0 introduces support for an emerging industry standard SOAP over JMS protocol.”

The step 3 in the Procedure section of the document above suggests you “Modify your WSDL file so that the ports that are accessible using the SOAP over JMS transport have an endpoint location URL that starts with the jms: prefix.” It’s easy as it reads – just put a URL beginning with jms: prefix in the location attribute of the soap12:address element and Rational Application Developer will take care of the rest when using the Generate Java Bean Skeleton or Generate Client wizards.

If all you do is to create and publish a WSDL for others to work with it, you may also provide the entire URI, i.e. jms:jndi:[destination-jndi-name]?jndiConnectionFactoryName=[factory-jndi-name]&replyToName=[permanent-reply-destination-jndi-name]&targetService=[target-service-name] (note the & in the URI so the WSDL you’re creating is a well-formed XML).

A complete WSDL might look like as follows. This is a WSDL generated by RAD’s Web Services > WSDL wizard with the wsdl:binding and wsdl:service elements changed to use SOAP/JMS.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="all-versions-up"
	targetNamespace="http://www.example.org/all-versions-up/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
	xmlns:tns="http://www.example.org/all-versions-up/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<wsdl:types>
		<xsd:schema targetNamespace="http://www.example.org/all-versions-up/">
			<xsd:element name="NewOperation">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="in" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="NewOperationResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="out" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:schema>
	</wsdl:types>
	<wsdl:message name="NewOperationRequest">
		<wsdl:part element="tns:NewOperation" name="parameters" />
	</wsdl:message>
	<wsdl:message name="NewOperationResponse">
		<wsdl:part element="tns:NewOperationResponse" name="parameters" />
	</wsdl:message>
	<wsdl:portType name="all-versions-up">
		<wsdl:operation name="NewOperation">
			<wsdl:input message="tns:NewOperationRequest" />
			<wsdl:output message="tns:NewOperationResponse" />
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="all-versions-upSOAP12" type="tns:all-versions-up"
		xmlns:soapjms="http://www.w3.org/2010/soapjms/">
		<soap12:binding style="document" transport="http://www.w3.org/2010/soapjms/" />
		<wsdl:operation name="NewOperation">
			<soap12:operation
				soapAction="http://www.example.org/all-versions-up/NewOperation" />
			<wsdl:input>
				<soap12:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap12:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="all-versions-up">
		<wsdl:port binding="tns:all-versions-upSOAP12" name="all-versions-upSOAP12">
			<soap12:address
				location="jms:jndi:jms/myQ?jndiConnectionFactoryName=jms/myQCF&amp;replyToName=jms/myReplyQ&amp;targetService=all-versions-up" />
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
Be Sociable, Share!
This entry was posted in Java EE, WebSphere.

One Response to SOAP 1.2 over JMS in Rational Application Developer 8.0.1

  1. Pingback: Tweets that mention SOAP 1.2 over JMS in Rational Application Developer 8.0.1 | Japila :: verba docent, exempla trahunt -- Topsy.com

Leave a Reply

%d bloggers like this: