WCF SoapExtensionReflector

How do I apply a SoapExtensionReflector at runtime to a WCF selfhosted service without config files.

Do I use ServiceHost.Extensions.Add or one of the AddServiceEndpoint params

I don't see anyway to do this..




Answer this question

WCF SoapExtensionReflector

  • Orens

    SoapExtensionReflector is ASMX's way of manipulating the WSDL description of a service. It's a part of the ASMX programming model, not the WCF programming model.

    The WCF equivalent is IWsdlImporter/IWsdlExporter.



  • Zeddys

    Hello,

    The IWsdlExporter interface (now called IWsdlExportExtension) exposes two methods that let you modify the exported WSDL for a service. See http://windowssdk.msdn.microsoft.com/library/en-us/cpref20/html/T_System_ServiceModel_Description_IWsdlExportExtension.asp. You generally implement the IWsdlExportExtension interface on a contract or endpoint behavior that you then add to your service in config or programmatically. The IWsdlExportExtension interface acts as a marker interface so that you can add metadata export functionality to your service extensions.

    Daniel Roth



  • dinesh_jedhe

    thanks Steve, I would have never found that.

    There is next to no information about IWsdlImporter/IWsdlExporter.

    Do you have any sample code to show syntax you could share

    I'm trying to change how the wsdl gets generated, when I have the service behind a firewall.

    xsd:schema, wsdl:import, soap:address locations in the wsdl reflect the internal addresses and urls but I want to change them to reflect external for public access address.  I do realize I can create a new endpoint for soap address but the other two wsdl:import and xsd:schema locations are still incorrect.

    ps.  I have seen some xsd:schema and wsdl:import urls around that use relative paths, but for the life of me I don't see any way to do that.



  • WCF SoapExtensionReflector