| By Ujval Mysore, Deepti Parachuri | Article Rating: |
|
| February 8, 2008 01:00 PM EST | Reads: |
4,035 |
Web Services existed before the principles of SOA were defined but they came into the limelight after it was realized that they were ideal for implementing services and hence form the building blocks of SOA.
SOAP and the Need for Attachments
SOAP is a specification that details how to encode the information to be exchanged in a Web Service. It's become a standard messaging protocol for Web Services. Since it's an XML-based, it's lightweight and stateless. SOAP can be used over various protocols like HTTP, HTTPS, SMTP, and FTP, but it's mostly used over HTTP. In the early days of Web Services and SOAP, because of the XML nature of SOAP, it wasn't possible to exchange non-XML data in a standard and efficient way. As the use of SOAP messages increased in organizations for exchanging information, the need to send non-text information (binary data) has also become important.
Use Cases
Let's take a look at a couple of use cases in which attachments are useful. In the banking domain, banks and financial institutions exchange paper-based financial instruments for clearing. In a few countries, to eliminate the overhead involved in exchanging physical checks, the banks have been mandated to move to an image-based solution, where the financial instruments must be digitized. In this new solution, banks have to transfer images of the checks along with the supplementary data. The supplementary data being small can go as XML content and the images of checks can be sent as attachments to the SOAP messages.
It's also a common requirement for sending binary data in the insurance domain. A Web Service application processing insurance claims requires images of the vehicle that met with an accident along with the claim document. In this case too images of the vehicle can be sent as attachments to the SOAP message, while the claim document itself can be sent as XML content in the SOAP message.
Since XML is a text-based format, it's difficult to include binary data in it. One solution is to embed the binary data as text using base 64 encoding. But the drawback to this method is that the performance degrades as the size of the attachment increases. The base 64 adds an extra 30% to the size of the original binary format because of the 4(characters):3(binary bytes) ratio, incurring a greater bandwidth over the network. And there's also overhead in encoding and decoding. However, it's certainly a good option for smaller attachments and has excellent interoperability but it's not an option for larger attachments. So a need arose for a better way to handle binary data.
Technologies Used for Attachments in SOAP
MIME (Multi-purpose/Multimedia Internet Mail Extensions)
One solution that emerged as a standard to send attachments in SOAP is MIME, in which binary information is sent as an attachment outside the SOAP message. MIME was originally devised for sending attachments in e-mail. MIME is streaming-friendly and so can handle bulky payloads smoothly.
Limitation: The limitation in MIME is due to the use of text strings in a MIME package to delineate boundaries between parts. To find a boundary, the whole message has to be scanned for that string. If a part, by coincidence, contains that delimiter string, boundaries of the parts can't be detected correctly.
DIME (Direct Internet Message Encapsulation)
To overcome the limitation in MIME, DIME was proposed as an alternative standard, which uses offset values as a delimiter instead of a string. Though less flexible than MIME, DIME describes a simpler message format, which in turn provides for faster and more efficient message processing.
XOP (XML-binary Optimized Packaging)
XOP defines how to serialize SOAP messages with binary contents, preserving the XML Infoset. It's a generalized concept and also used for SOAP.
Standards for Attachments in SOAP
SwA (SOAP Messages with Attachments)
SwA was the first standard that tried to address the problem of sending attachments with SOAP. SwA is a W3C standard for attaching binary data along with SOAP envelope using SOAP 1.1 and MIME. SwA uses the HREF attribute and Content-ID MIME header to relate attachments to SOAP message parts. B2B standards such as ebXML, RosettaNet, AS2, and the BizTalk Framework use SwA as the messaging layer for its flexibility.
Limitations: SwA doesn't well define how to clearly describe an attachment in WSDL. An attachment by way of SwA meant two data models in one message and these two data models don't operate with existing XML technology, i.e., fail to provide a common logical view. And all the limitations of MIME hold true for SwA as well.
WS-Attachments
WS-Attachments use DIME for SOAP attachments. But, since most enterprises had already started using SwA and since the shortcomings in SwA, because of its use of MIME, weren't that severe, WS-Attachments with DIME didn't get adopted as a standard. It didn't gain much momentum due to the lukewarm response from industry practitioners. Refer to Listing 1 for a sample SOAP message for WS-Attachments.
Limitations: All the limitations of SwA also hold true for WS-Attachment except for the limitation of MIME, which was overcome by using DIME.
Attachment Profile 1.0
Though SwA was widely used, there were still two main concerns with SwA. First, there is no mechanism to identify from WSDL 1.1 that binary data is attached in the SOAP message. And second, there is no way to map MIME parts to corresponding WSDL message parts. SwARef introduced by Attachment Profile 1.0 solved these problems. Refer to Listing 2 for a sample SOAP message for SwARef.
PASwA (Proposed Infoset Addendum to SOAP Messages with Attachments)
PASwA emerged to address some of the shortcomings of SwA. PASwA aims at providing a common logical view to SOAP messages with attachments by using XML infoset. It defines a set of constructs to create a relationship between the SOAP message and its attachments. The principles of PASwA got grouped into four categories in W3C: (i) XML-binary Optimized Packaging (XOP); (ii) SOAP Message Transmission Optimization Mechanism (MTOM); (iii) SOAP Resource Representation Header; and (iv) Assigning Media Types to Binary Data in XML.
Published February 8, 2008 Reads 4,035
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Ujval Mysore
Ujval Mysore is a member of the Web Services COE (Center of Excellence) for Infosys Tehcnologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies. Dr. Srinivas Padmanabhuni heads the Web Services COE.
More Stories By Deepti Parachuri
Deepti Parachuri is a junior research associate at SOA/Web Services Centre of Excellence at SETLabs, the research arm of Infosys Technologies Ltd., and holds an MS degree from IIT-Madras, India. She is experienced in the field of vision, especially recognition and video tracking, while she has been actively involved in various publications and conferences. Today, her major research area includes semantic Web scaling RDF, OWL, OWL-S and Agent technologies, in addition, analyzed XML schema compression methodologies for SOA-based application.
- The Top 150 Players in Cloud Computing
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- Industry Experts Discuss the State of Cloud Computing
- Cloud Expo New York Call for Papers Now Open
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- US Federal Government is Major Cloud Computing Innovator
- Google Wave
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Adaptivity & Cloud Computing: Exclusive Q&A with CEO Tony Bishop
- 4th International Cloud Expo: Photo Album
- The Top 150 Players in Cloud Computing
- SYS-CON.TV: Cloud Computing Expo Power Panel
- Commercial vs Federal Cloud Computing
- Why IBM’s Server Chief Got Busted
- 1st Annual GovIT Expo: Letter from the Technical Chair
- Industry Experts Discuss the State of Cloud Computing
- Deputy CIO of the CIA to Keynote 1st Annual GovIT Expo
- SOA World Power Panel on SYS-CON.TV
- CIA was Headed to an Enterprise Cloud All Along: Jill Tummler Singer
- Cloud Expo New York Call for Papers Now Open
- 1st Annual Government IT Conference & Expo: Themes & Topics
- Stock in Focus: Dragon Capital
- The i-Technology Right Stuff
- Who Are The All-Time Heroes of i-Technology?
- Get the Message
- Where Are RIA Technologies Headed in 2008?
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- Five Reasons Why Web 2.0 Matters
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- SOA World Conference & Expo SYS-CON.TV Power Panel Live From Times Square









Cloud computing is a game changer. The cloud ...




















