WCF, wsHttpBinding and wsp:policy
I'm using .NET 4.0, WCF and wshttp binding to create some ws methods. Reason for using wsHttp binding is that I need support开发者_JAVA百科 for auth., encryption and signing.
When I create such a service and look into wsdl, I see there is wsp:policy tag there. Is there a way to somehow influence WCF configuration and remove this tag?
As I understand it is possible to have encryption and signing without this tag.
You can replace generated WSDL by your own WSDL (serviceMetadata - externalMetadataLocation). This is the only way where I'm sure you can achieve what you want because you will write WSDL from scratch. There are extensibility points for modification of generated WSDL and policies - IWsdlExportExtension and IPolicyExportExtension but I think you will only be able to add new items to WSDL but not removing items added by API features (build-in security, etc.).
Btw. IMHO it is very bad idea to remove policies because WSDL should describe the service and it should be the only description developer need to have to create client application. If you remove policies your WSDL will cover only partial information about your service and it will become useless. Definitely you will brake compatibility with proxy generation tools. I had related question about this topic.
精彩评论