Implementing a POX HTTP service
WCF services by default use SOAP as the message format of service operations, which means each message transferred between the client and service is wrapped in a SOAP envelope that contains one SOAP body and some SoapHeaders. However, sometimes our WCF service will need to work with some legacy POX (Plain Old XML) clients or our WCF-based client will need to talk to some POX-style service. In such cases, it is necessary to let our WCF client or service generate arbitrary XML messages without strictly obeying the SOAP standard.
How to do it...
We will use a CustomBinding to build a POX-enabled WCF service and consume it with a POX-enabled WCF client program. Let’s have a look at the complete steps:
The first thing to do is to make our
ServiceContract
POX ready. The following code shows a sample operation that is ready for exchanging POX-style messages.[OperationContract(Action=”*”,ReplyAction=”*”)] Message SayHello(Message reqMsg);
Compared with normal...