0

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 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.

buhtla
  • 2,819
  • 4
  • 25
  • 38

1 Answers1

2

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.

Community
  • 1
  • 1
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • Hey Ladislav, 10x for response. Only reason for this is because my WS will be used by some Java systems which can have problems because of this tag. I'll keep your remark in mind and ty to keep this tag as part of my wsdl definition. One related question, can I use externalMetadataLocation attribute to define path to XSD definitions, or is it only for wsdl? – buhtla Nov 24 '10 at 11:23
  • XSDs are referenced from WSDL so you don't need to specify their path in configuration. You will specify it in WSDL. – Ladislav Mrnka Nov 24 '10 at 13:22
  • interesting (concerning) that its now 2015 and I still have Java consumers with issues because of this tag. If this isn't usable by such a large number of customers I really wish MS would provide a way to remove it. – hal9000 Aug 12 '15 at 18:41