title: WSP0075: Policy assertion "TransportBinding" was evaluated as "UNKNOWN". Why?
body: <p>I am a client to a SOAP service I do not control (implemented in .NET). The service provides a WSDL. I use Apache CXF to generate the java client from the WSDL (specifically, I am using the cxf-codegen-plugin for Maven, which uses wsdl2java under the hood).</p>
  
  <p>However, when I instantiate the generated service class, the following warnings are logged:</p>
  
  <pre><code>Sep 04, 2014 5:18:00 PM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
  WARNING: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}TransportBinding" was evaluated as "UNKNOWN".
  Sep 04, 2014 5:18:00 PM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
  WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
  </code></pre>
  
  <p>However the client works correctly--I don't have any problem using the service. However, I am puzzled by these errors.</p>
  
  <p>The error is about this security policy in the WSDL, which I think it says it cannot understand:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;wsp:Policy wsu:Id="soap11_policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"&gt;
    &lt;wsp:ExactlyOne&gt;
      &lt;wsp:All&gt;
        &lt;sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"&gt;
          &lt;wsp:Policy&gt;
            &lt;sp:TransportToken&gt;
              &lt;wsp:Policy&gt;
                &lt;sp:HttpsToken RequireClientCertificate="false"/&gt;
              &lt;/wsp:Policy&gt;
            &lt;/sp:TransportToken&gt;
            &lt;sp:AlgorithmSuite&gt;
              &lt;wsp:Policy&gt;
                &lt;sp:Basic256/&gt;
              &lt;/wsp:Policy&gt;
            &lt;/sp:AlgorithmSuite&gt;
            &lt;sp:Layout&gt;
              &lt;wsp:Policy&gt;
                &lt;sp:Strict/&gt;
              &lt;/wsp:Policy&gt;
            &lt;/sp:Layout&gt;
          &lt;/wsp:Policy&gt;
        &lt;/sp:TransportBinding&gt;
      &lt;/wsp:All&gt;
    &lt;/wsp:ExactlyOne&gt;
  &lt;/wsp:Policy&gt;
  </code></pre>
  
  <p>However as far as I can tell this is a perfectly ordinary policy with nothing unusual about it. Surely it should be understood? How can I fix this warning?</p>
  
  <p>For the record, here is how wsdl2java is being invoked (excerpt from pom.xml).</p>
  
  <p>The <code>-exsh true</code> arg and <code>cxf-rt-bindings-soap</code> dependency are because the WSDL uses some implicit soap headers in its arguments, and I need this so they are included properly in the generated service class methods.</p>
  
  <p>I added the <code>cxf-rt-ws-security</code> and <code>cxf-rt-ws-policy</code> dependencies to try and fix this warning, thinking that maybe the security and policy information were not included. However, this did not fix anything (didn't break anything either, though).</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
    &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
    &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
    &lt;version&gt;3.0.1&lt;/version&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;rh-soap-client-ssi&lt;/id&gt;
        &lt;phase&gt;generate-sources&lt;/phase&gt;
        &lt;configuration&gt;
          &lt;sourceRoot&gt;${project.build.directory}/generated/cxf&lt;/sourceRoot&gt;
          &lt;wsdlOptions&gt;
            &lt;wsdlOption&gt;
              &lt;wsdl&gt;https://example.org/ssi?wsdl&lt;/wsdl&gt;
              &lt;extraargs&gt;
                &lt;extraarg&gt;-verbose&lt;/extraarg&gt;
                &lt;extraarg&gt;-client&lt;/extraarg&gt;
                &lt;extraarg&gt;-mark-generated&lt;/extraarg&gt;
                &lt;extraarg&gt;-exsh&lt;/extraarg&gt;
                &lt;extraarg&gt;true&lt;/extraarg&gt;
                &lt;extraarg&gt;-autoNameResolution&lt;/extraarg&gt;
              &lt;/extraargs&gt;
            &lt;/wsdlOption&gt;
          &lt;/wsdlOptions&gt;
        &lt;/configuration&gt;
        &lt;goals&gt;
          &lt;goal&gt;wsdl2java&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
        &lt;artifactId&gt;cxf-rt-bindings-soap&lt;/artifactId&gt;
        &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
        &lt;artifactId&gt;cxf-rt-ws-security&lt;/artifactId&gt;
        &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
        &lt;artifactId&gt;cxf-rt-ws-policy&lt;/artifactId&gt;
        &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/plugin&gt;
  </code></pre>