What should I know when developing interoperable WCF web service?
Asked Answered
P

3

6

I'm starting this Wiki to collect best practices about creating interoperable web services (not clients) in WCF. Please share your experience if you know any feature which is not generally interoperable or which is not interoperable with specific platform.

Philander answered 19/8, 2010 at 18:41 Comment(0)
P
4

Fairly simple:

  • avoid any .NET specifics like Exceptions (turn them into SOAP faults)

  • don't use any binding that start with net like netTcp, netNamedPipes, netMsmq and so forth - use wsHttpBinding for secure WS-* services, and basicHttpBinding for maximum reach / compatibility with even the weirdest client platforms

  • don't use the NetDataContractSerializer

Patellate answered 19/8, 2010 at 18:42 Comment(1)
1) any tips on how to change exceptions to SOAP faults? - I am not sure what that exactly means. 2) regarding not using NetDataContractSerializer: I am using System.Xml.Serialization on my data contracts, is that a better option for interoperability?Inbreed
P
3

General interoperability:

  • Only HTTP and HTTPS transport channels are interoperable
  • Negotiation of security credentials is not interoperable (negotiateServiceCredential in message security). It uses TLSNego or SPNego protocols which are not always supported by other platforms.
  • HTTP streaming can cause troubles as well
  • Binary encoding over HTTP channel is not interoperable
  • OleTransactions are not interoperable
  • Use service security context with care (estabilishSecurityContext in message security). It uses WS-Secure Conversation protocol which is not available on some platforms

Edit:

  • WSDualHttpBinding and CompositeDuplexBindingElement are not interoperable
Philander answered 19/8, 2010 at 18:42 Comment(0)
E
3

I recommend WCF REST exposing multiple serialization formats, definitely xml for starters.

Egest answered 19/8, 2010 at 18:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.