11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 13 ■ IMPLEMENTING SOA INTEROPERABILITY 409ramrameshreddy.blog.comAs you can see in Listing 13-6, the implementation details are not abstracted from theservice implementation. The service developer is now forced to understand the implicationsand requirements of transferring binary or large objects through the service tier. A more naturalmethod signature would be just to return the binary data as a stream or an array of bytes.Microsoft realized the transitional status of DIME, and when WSE 3.0 (for .NET 2.0) wasreleased, Microsoft terminated the support of DIME. The technology that replaced it is calledMessage Transmission Optimization Mechanism (MTOM). Listing 13-7 is a similar interfacebut implemented with MTOM-expected support as part of WSE 3.0.Listing 13-7. Using MTOM in WSE 3.0[WebMethod]public byte[] GetFile(string fileName){byte[] response;String filePath = AppDomain.CurrentDomain.BaseDirectory +@"App_Data\" + fileName;response = File.ReadAllBytes(filePath);return response;}As you’ll soon see, the transition from the WSE 3.0 implementation of MTOM to the WCFimplementation of MTOM is nearly seamless given the more natural way of implementingservice interfaces without implementation-dependant details. Also, the WSE 3.0 MTOM iswire-level compatible with WCF’s initial release.Message Transmission Optimization Mechanism (MTOM)With the limitations of the attachment-oriented approaches, industry participants developed anew specification that alleviated many of the issues of past specifications while ensuring compatibilitywith the emerging WS-* standards. Along with MTOM, XML-binary OptimizationPackaging (XOP) is managed by the WCF encoding class MtomMessageEncodingBindingElement.This is controlled by setting the messageEncoding attribute on the binding with alternatives ofText or Binary. Listing 13-8 is an example of an application configuration that establishesthrough the declarative model that MTOM encoding should be used.Listing 13-8. Using MTOM Through Configurationramrameshreddyramrameshreddy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!