In the enterprise world developing simple SOAP based web services are not enough and they have to deal with binary data like Imgae, PDF, Word, Xls and other documents. We will see simple SOAP client for streaming binary data.
Base64 Problem
The most popular way of sending the binary attachments to SOAP service is to encode the content as Base64. This method may well work for smaller size of attachments as the Base64 encoding is memory intensive operation. The entire content needs to loaded into memory and encoded using Base64. The encoded data needs to embedded within the SOAP body XML.
Also the encoded data size is roughly 37% more than the raw binary data. To make it work for large files you need to upgrade your JVM memory.
Streaming of Attachments (SOAP with attachments)
The memory intensive operation can be avoided using SOAP with attachments. The idea of SOAP with attachments is sames attaching the document to email. The SOAP Body contains only the reference to the binary file and binary file will be streamed outside of SOAP Envelope.
The following example shows the SOAP message and the attachments. This example is for Oracle UCM's CheckInUniversal operation.
The SOAP message package is constructed using the
Base64 Problem
The most popular way of sending the binary attachments to SOAP service is to encode the content as Base64. This method may well work for smaller size of attachments as the Base64 encoding is memory intensive operation. The entire content needs to loaded into memory and encoded using Base64. The encoded data needs to embedded within the SOAP body XML.
Also the encoded data size is roughly 37% more than the raw binary data. To make it work for large files you need to upgrade your JVM memory.
Streaming of Attachments (SOAP with attachments)
The memory intensive operation can be avoided using SOAP with attachments. The idea of SOAP with attachments is sames attaching the document to email. The SOAP Body contains only the reference to the binary file and binary file will be streamed outside of SOAP Envelope.
The following example shows the SOAP message and the attachments. This example is for Oracle UCM's CheckInUniversal operation.
The SOAP message package is constructed using the
Multipart/Related
media type. The rules for the construction of SOAP message packages are as follows:- The primary SOAP message must be carried in the root body part of the Multipart/Related structure. Consequently the type parameter of the
Multipart/Related
media header will always equal theContent-Type
header for the primary SOAP 1.1 message, i.e.,text/xml.
- Referenced MIME parts must contain either a
Content-ID
MIME header.
Content-Type: multipart/related; type="text/xml"; start="<test@example.com>"; boundary="----=_Part_12_21424854.1424891476173"
SOAPAction: "http://www.stellent.com/CheckIn/"
Content-Length: 1818
------=_Part_12_21424854.1424891476173
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <test@example.com>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:chec="http://www.stellent.com/CheckIn/">
<soapenv:Header/>
<soapenv:Body>
<chec:CheckInUniversal>
<chec:dDocName/>
<chec:dDocTitle>TestStreaming-large</chec:dDocTitle>
<chec:dDocType>Records</chec:dDocType>
<chec:dDocAuthor>username</chec:dDocAuthor>
<chec:dSecurityGroup>group</chec:dSecurityGroup>
<chec:dDocAccount/>
<chec:CustomDocMetaData>
<chec:property>
<chec:name>xLibrary</chec:name>
<chec:value>library</chec:value>
</chec:property>
<chec:property>
<chec:name>xesd_proj_name</chec:name>
<chec:value>Test</chec:value>
</chec:property>
</chec:CustomDocMetaData>
<chec:primaryFile>
<chec:fileName>TestUCM-large</chec:fileName>
</chec:primaryFile>
</chec:CheckInUniversal>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_12_21424854.1424891476173
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Content-ID: <primaryFile>
Hello
------=_Part_12_21424854.1424891476173--
The oracle UCM service expects the Content-ID of the attachment to be 'primaryFile' SOAP Part. The attachment file content is "Hello"
UploadStream Client
|
MimeMessageRequestEntity.java
|
RequestXmlDataSource.java
|
AttachmentDataSource.java
|
Java Web Services Training in Chennai Java Web Services Training in Chennai Java Web Services Online Training Java Web Services Training in Chennai
ReplyDeleteIEEE Final Year projects Project Center in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteJavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, project projects for cseAngular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
ReplyDeleteAndroid Training in Bangalore
I found a lot of interesting information here. A really good post man, very thankful and hopeful that you will write many more posts like this one.
ReplyDeletekajal agarwal hot
TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
ReplyDeleteCheck out the best
Mattress
entertainment unit
Established in 2016 SSDWebHosting.net is providing top quality domain and hosting services worldwide to
ReplyDeleteour valued customers and trying to play a little role in their success.We offer about 500 distinctive gTlds and ccTlds
to look over which includes old master class gTlds like .com, .net and .org, in addition this we also offer newly launched Tlds
like .xyz, .online, .master, .office, .on, .top and .club. We can assist you with choosing the best fitting name. Let's bring your
thought or business on the web. visit this site https://SSDWebHosting.net/ to know more.
Do you wanna buy SSD Web Hosting visit here.
Find best Cheap Web Hosting here.
ReplyDeleteنجار ابواب بالرياض نجار ابواب بالرياض
تركيب ستائر بالرياض افضل شركة تركيب ستائر بالرياض
تنظيف مكيفات بالرياض شركة غسيل مكيفات بالرياض
شركة تنظيف افران الغاز بالرياض تنظيف افران بالرياض
Inyteresting.ڈپلیکیٹ برانڈڈ گھڑیاں آن لائن
ReplyDeleteAmazing Article, Really useful information to all So, I hope you will share more information to be check and share here.
ReplyDeleteinplant training
inplant training chennai
inplant training in chennai
inplant training at chennai
inplant training
inplant training chennai
inplant training in chennai
inplant training at chennai
inplant training
Inplant Training for cse
The ability it provides for businesses and its users to create their own customized Salesforce tools in the cloud with its PaaS solution has strengthened the position of Salesforce in the CRM market. Salesforce also offers more flexibility for the users as they can construct modules as well as modify Salesforce to perform accurately for a specific industry or according to the company's specific requirements. Salesforce training in Hyderabad
ReplyDeleteYou've decided to take your pet along on vacation. It will be more fun, and you won't have to worry about leaving a member of your family behind in an unfamiliar kennel.
ReplyDeleteEntertainmentBee
TheMoviesBio
PetRefine
ThePetsAbout