开发者

Does the message contract provide interoperability across different languages?

I am reading about WCF services. I am new to the WCF services. I read that WCF provides interoperability. I want to know in which context it provides the interoperability. Is it providing the interoperability in the context of consuming the .net wcf web services from any other language (e.g. php) or for any different purpose. I have read the following article.

http://blogs.msdn.com/b/drnick/archive/2006/11/27/mixing-message-contract-attributes.aspx

In this way if we provide the OperationContract for all the methods in wcf web service by passing or returning MessageContract for some method and DataContract for some method then what will happen in php or any other language ? *Whether the method having DataContract as parameter or return type are available in php or any other language ? or Whether the method having MessageContract as parameter or return type are available in php or any other langua开发者_如何学运维ge ? or Both are available in php or any other language *


Is it providing the interoperability in the context of consuming the .net wcf web services from any other language (e.g. php) or for any different purpose.

Interoperability means being able to call your WCF service from a non-.NET platform, as long as the client uses the same web service protocol as your service. Note that you can use many type of bindings for your WCF service, but only BasicHttpBinding, WSHttpBinding and WSDualHttpBinding support interoperability. For more information, refer to the MSDN article Web Services Protocols Supported by System-Provided Interoperability Bindings.

Whether the method having DataContract as parameter or return type are available in php or any other language ? or Whether the method having MessageContract as parameter or return type are available in php or any other language ? or Both are available in php or any other language

The short answer is yes. If you use BasicHttpBinding for example, it all becomes XML, and it's up to the libraries available to that language to convert the XML to something native to the language. For example, the PHP SoapClient translates a DataContract return type to the built-in stdClass object (see Echo xml result from wcf service in php?).


At least messagecontract should provide a workable solution consuming with PHP, according to https://github.com/geersch/WcfServicesWithPhp5.

And I can find a similar post for DataContracts at http://www.rizalalmashoor.com/blog/calling-a-wcf-service-from-php/.

And comparing the way these two contract types are consumed from PHP, I think it would not give a problem combining the two in the same WCF service.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜