开发者

Plain HTTP along with WCF - how?

开发者 https://www.devze.com 2023-01-17 12:20 出处:网络
The brand-new WCF-based code needs (in the meanwhile) to provide a service to a legacy code that works in plain HTTP. So that, along with new SOAPed requests, I need to tailor some oldskul-style commu

The brand-new WCF-based code needs (in the meanwhile) to provide a service to a legacy code that works in plain HTTP. So that, along with new SOAPed requests, I need to tailor some oldskul-style communication (on a different port): to be able to receive plain HTTP, analyse the 开发者_运维问答request body and send the plain HTTP with some body in response.

Looked at the System.ServiceModel.ServiceHost API but couldn't find anything appropriate. Any advice will be generously accepted. It is strongly preferred to leave the legacy code as it is, do I have a real choice here? Thanks in advance!


I think the main question is how your service and the body of your messages are defined.

WCF currently has more flexibility allowing for sending and receiving non-SOAP XML messages, JSON, ATOM, ATOMPub, ... but if you are sending plain text or custom format as the body of your messages, WCF is probably not the way to go.

So what is your message body?

UPDATE

WebHttpBinding is the way to go: http://msdn.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx


Your best bet is to attempt to use BasicHttpBinding. It should be interoperable with older web services.

0

精彩评论

暂无评论...
验证码 换一张
取 消