A few months ago I wrote a couple of articles (WCF-ORA, ORA-WCF) about Message Transmission Optimization Mechanism (MTOM) interoperability between Oracle Application Server and Microsoft Windows Communication Foundation (WCF). Most of the feedback I got from those posts was related with MTOM interoperability scenarios using other Web Service technologies toolkits. Based on that, I decided to post a few more demos that reflect MTOM interoperability scenarios for different vendors. Specifically, this paper shows how to achieve MTOM interoperability between Oracle App Server and Sun Web Service Interoperability Technology (WSIT - Project Tango). Believe it or not, I am sorry .NET developers; there is no .NET code in this paper.
This post does not intend to provide a formal introduction to MTOM. Suffice to say that after a few years and three predecessors' specifications, MTOM has become the preferred Standard for SOAP-encoded binary messaging optimization. MTOM relies on the XML Optimized Processing (XOP) Standard as the serialization mechanism to represent binary data as a MIME/Multipart Related package. If you are interested in the importance of MTOM interoperability you might want to read my previous paper or this post by John Evdemon.
Sun WSIT and MTOM
WSIT is part of Project Metro which is the Web Services stack from Sun Microsystems. Specifically, WSIT is the component of Project Metro that implements some of the most important WS-* protocols emphasizing in interoperability with Microsoft WCF. Needless to say, that WSIT also interoperates really well with other Web Services technologies including Oracle App Server. At the moment WSIT implements some of the most important WS-* protocols for areas such as Security, Reliability, Transactions and messaging optimization (a.k.a MTOM). The typical scenarios for applying MTOM are Web Services that handles binary data like byte[] as part of their contract. The following code illustrates a WSIT Service that can be highly optimized with the use of MTOM.
@WebService() |
Now we need to configure the service policy in order to optimize the message exchange using MTOM. The trick here, in order to achieve interoperability with Oracle App Server, is to remove the default WSIT WS-Addressing settings. This is due to the fact that Oracle App Server and Sun WSIT implement different versions of WS-Addressing. The change is not required if the client side supports MTOM with WS-Addressing 1.0 like WCF does. Also, If you are using a development IDE such as NetBeans there is no need to manually configure the policy except for removing the use of WS-Addressing; instead you can the Web Service configuration editor which provides a nice interface for configuring the different WS-* protocols for a particular service.
<definitions |
Now we are ready to deploy the service, for the purposes of this demo we used Sun Glassfish.
Oracle App Server and MTOM
Now it's time to implement an Oracle client for the WSIT service created on the previous section. The first natural step is to generate the proxy using the Web Service Proxy Wizard included in JDeveloper or the corresponding command-line tool. In order to interface with WCF using MTOM, the client code should set the MTOM_SUPPORT property to "True" either programmatically or using the configuration file. The following code shows a sample client that interacts with the WCF service created in the previous section
public static void Test() |
Messages Messages
After hosting the WSIT service in Sun Glassfish and running the Oracle client the following message sequence is produced
POST /MtomServices/FileWSService HTTP/1.1 |
SOAP request produced by the Oracle client
Content-Id: <rootpart*[email protected]> |
SOAP response produced by the Sun WSIT service
You can notice that the byte[] in the request message its been optimized using MTOM and XOP.
In the next weeks I will be posting more demos about WS-* protocols interoperability between some of the top Web Services technologies in the market.