Document Literal vs. RPC Encoding is the big endian-little endian of connected systems. There has been a lot said about the differences (see reference section for details) however this post is about how elegant it looks in WCF. Traditionally we had two ways to represent them;
As a web method
Or as a SoapDocumentMethod
[SoapDocumentMethod( "http://www.dotnetsmith.com/DocumentEncoded", RequestNamespace="http://www.dotnetsmith.com", ResponseNamespace="http://www.dotnetsmith.com", Use=SoapBindingUse.Encoded)] public string DocumentEncoded(Address address, bool useZipPlus4) {
With WCF's seperation of Data and Service Contracts, it has become much more cleaner and clear.
[ServiceContract] [XmlSerializerFormat(Style=OperationFormatStyle.Document, Use=OperationFormatUse.Literal)] //Or Encoded public interface IOrderEntry {...}
and the one way attribute as an operation contract.
public interface IOrderEntry { [OperationContract(IsOneWay = true)] void PlaceOrder(PurchaseOrder order); }
Remember that RPC/encoded is not WS-I compliant!
Following is difference in the output from the two different
References
Remember Me
Powered by: newtelligence dasBlog 1.8.5223.2
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts