WCF – WSDL or pre-compiled Proxy

wcf

this is B2B scenario, one client (at least for now).

Server environment:
WCF service, IIS6, .NET v3.5

Client environment:
dev shop is .NET 2.0/VS2005. Will be calling my WCF service.

Question: should i
(a) open WSDL gen for the client(not desirable for security reasons)
(b) send a WSDL file(s) to the client
(c) pre-compile Proxy into dll (on my side) and send it to the client
(d) ???
?

Any suggestions on what would be the best practice for this scenario, any pros/cons?

Thanks in advance,
Igor

Best Answer

Why is a publicly available WSDL not desirable for security reasons?

I may be willing to admit that publishing an API (which is basically what you are doing with WSDL) makes you a bit more vulnerable than if you didn't, but it would be wrong to assume that hiding the WSDL constitutes any kind of security. This is ironically called security by obscurity, and it will be broken by any determined attacker.

The web service should be secure in itself. WCF offers many security features, but that is perpendicular to your question.

I'd prefer publishing the WSDL. If you don't want to do that, or if there is a policy in place that says that you can't do that, then send the WSDL to the client team so they can use it as they wish.

Precompiling the proxy will only enforce your coding conventions on the client team, and they may not appreciate that - for example, I often prefer my proxies to be generated with the /i switch that makes the generated classes internal. I also like to be able to specify the .NET namespaces so that they fit the rest of my code. That would not be possible if I got a precompiled assembly (I would be able to use it anyway, but it would just annoy me).