none
how to remove wsp: Policy RRS feed

  • Question

  • Hello everyone.

    I am building a WCF service with BasicHttpBinding, for interoperability.

    However, i need to use HTTPS to secure the transport of the messages.

    I follow the tutorial below and everything was going fine. But after that i changed my binding to secure="transport",i noted that was inserted the wsp:Policy to my WSDL.

    [Tutorial]

    I am afraid that can bring me problems about interoperability.

    So, what exactly is the wsp:policy? 

    Is possible to remove that from WSDL?

    My configuration:

    <binding name="BASIC_HTTP_BINDING_HTTPS"
            receiveTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00"  openTimeout="00:10:00"  >
              <security mode="Transport"  >
                <!--https://msdn.microsoft.com/en-us/library/ms752256(v=vs.110).aspx-->
                <transport clientCredentialType="None"  >                  
                </transport>
              </security>
            </binding>

    WSP:Policy inserted into my WSDL:

    <wsp:Policy wsu:Id="SolicitacaoProcedimento_Binding_policy">
    <wsp:ExactlyOne>
    <wsp:All>
    <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    <wsp:Policy>
    <sp:TransportToken>
    <wsp:Policy>
    <sp:HttpsToken RequireClientCertificate="false"/>
    </wsp:Policy>
    </sp:TransportToken>
    <sp:AlgorithmSuite>
    <wsp:Policy>
    <sp:Basic256/>
    </wsp:Policy>
    </sp:AlgorithmSuite>
    <sp:Layout>
    <wsp:Policy>
    <sp:Strict/>
    </wsp:Policy>
    </sp:Layout>
    </wsp:Policy>
    </sp:TransportBinding>
    </wsp:All>
    </wsp:ExactlyOne>
    </wsp:Policy>

    Thanks

    []s

    Monday, November 9, 2015 9:31 PM

Answers

  • Hi Max Daniel Campos Cancino,

    According to this  case, the ws-policy elements in the metadata document

    is due to the security setting (transport https + windows auth).

    Because WCF uses WS-POLICY protocol for adding security related description

    info (together with the WSDL for service endpoints and operations) in metadata document.

    For more information, please refer to the following article:

    1.Understanding Web Services Policy

    There does exists some case 3rd party tools might not correctly work with such

    ws-policy or other ws-* protocols:#wsdl.exe does not support ws-policy.

    So,you can consider using .NET svcutil.exe tool to download the metadata of your

    WCF service to a local file and modify it to your expected format

    (without ws-policy sections) and let the 3rd party tools generate proxy agains

    the modified local metadata file:

    2.How to: Use Svcutil.exe to Download Metadata Documents

    For how to remove that, please refer to the following link:

    3.How to remove the wsp:Policy wsu:Id from wsdl generated by my wcf service

    I hope that will be helpful to you.

    Best Regards,

    Grady

    Tuesday, November 10, 2015 1:56 AM
    Moderator