title: WCF fails to generate configuration from WSDL after migrating from JAX-RPC to JAX-WSL (weblogic upgrade)
body: <p>For security reasons as all of this concerns an important production Platform, all urls/sensistive data are anonymized in the samples.</p>
  
  <p>I'm using WCF to consume a custom JD Edwards web service. This has been working untill an upgrade of the platform that required switching to TLS 1.2 (easily done from the WCF client) but also changed the WSDL. I was told the previous web service was exposed through JAX-RPC and that was no longer supported in the newly deployed version of weblogic.</p>
  
  <p>Here is most of the target WSDL. The actual proxy gets generated fine by the wsdl importer and i get all the same methods as before the upgrade, only the configuration file web service section generation fails.</p>
  
  <p>For brievty i omited all the operations except one, and for security i removed the server/port/bssv number/service names. Everything else is as is on the Platform:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --&gt;
  &lt;!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.11-b150616.1732 svn-revision#a247ba216861f2c0baac9a3657c5690bce0c744d. --&gt;
  -&lt;definitions xmlns="http://schemas.xmlsoap.org/wsdl/" name="ServiceNameService" targetNamespace="http://oracle.e1.bssv.BSSVServiceNumber/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://oracle.e1.bssv.BSSVServiceNumber/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wssutil="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
    &lt;wsp:UsingPolicy wssutil:Required="true"/&gt;
    -&lt;wsp1_2:Policy wssutil:Id="bssvpolicy"&gt;
      -&lt;ns1:TransportBinding xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"&gt;
        -&lt;wsp1_2:Policy&gt;
          -&lt;ns1:TransportToken&gt;
            -&lt;wsp1_2:Policy&gt;
              &lt;ns1:HttpsToken/&gt;
            &lt;/wsp1_2:Policy&gt;
          &lt;/ns1:TransportToken&gt;
          -&lt;ns1:AlgorithmSuite&gt;
            -&lt;wsp1_2:Policy&gt;
              &lt;ns1:Basic256/&gt;
            &lt;/wsp1_2:Policy&gt;
          &lt;/ns1:AlgorithmSuite&gt;
          -&lt;ns1:Layout&gt;
            -&lt;wsp1_2:Policy&gt;
              &lt;ns1:Lax/&gt;
            &lt;/wsp1_2:Policy&gt;
          &lt;/ns1:Layout&gt;
        &lt;/wsp1_2:Policy&gt;
      &lt;/ns1:TransportBinding&gt;
      -&lt;ns2:SupportingTokens xmlns:ns2="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"&gt;
        -&lt;wsp1_2:Policy&gt;
          -&lt;ns2:UsernameToken ns2:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"&gt;
            -&lt;wsp1_2:Policy&gt;
              &lt;ns2:WssUsernameToken10/&gt;
            &lt;/wsp1_2:Policy&gt;
          &lt;/ns2:UsernameToken&gt;
        &lt;/wsp1_2:Policy&gt;
      &lt;/ns2:SupportingTokens&gt;
    &lt;/wsp1_2:Policy&gt;
    -&lt;types&gt;
      -&lt;xsd:schema&gt;
        &lt;xsd:import schemaLocation="https://ServerName:ServerPort/Platform/ServiceName?xsd=1" namespace="http://oracle.e1.bssv.BSSVServiceNumber/"/&gt;
      &lt;/xsd:schema&gt;
    &lt;/types&gt;
    -&lt;message name="FirstOperation"&gt;
      &lt;part name="FirstOperation" element="tns:FirstOperation"/&gt;
    &lt;/message&gt;
    -&lt;message name="FirstOperationResponse"&gt;
      &lt;part name="FirstOperationResponse" element="tns:FirstOperationResponse"/&gt;
    &lt;/message&gt;
    -&lt;message name="BusinessServiceException"&gt;
      &lt;part name="fault" element="tns:BusinessServiceException"/&gt;
    &lt;/message&gt;
    -&lt;portType name="ServiceName"&gt;
      -&lt;operation name="FirstOperation"&gt;
        &lt;input message="tns:FirstOperation" wsam:Action="http://oracle.e1.bssv.BSSVServiceNumber/ServiceName/FirstOperationRequest"/&gt;
        &lt;output message="tns:FirstOperationResponse" wsam:Action="http://oracle.e1.bssv.BSSVServiceNumber/ServiceName/FirstOperationResponse"/&gt;
        &lt;fault name="BusinessServiceException" message="tns:BusinessServiceException" wsam:Action="http://oracle.e1.bssv.BSSVServiceNumber/ServiceName/FirstOperation/Fault/BusinessServiceException"/&gt;
      &lt;/operation&gt;
    &lt;/portType&gt;
    -&lt;binding type="tns:ServiceName" name="ServiceNamePortBinding"&gt;
      &lt;wsp:PolicyReference URI="#bssvpolicy"/&gt;
      &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      -&lt;operation name="FirstOperation"&gt;
        &lt;soap:operation soapAction=""/&gt;
        -&lt;input&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/input&gt;
        -&lt;output&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/output&gt;
        -&lt;fault name="BusinessServiceException"&gt;
          &lt;soap:fault name="BusinessServiceException" use="literal"/&gt;
        &lt;/fault&gt;
      &lt;/operation&gt;
    &lt;/binding&gt;
    -&lt;service name="ServiceNameService"&gt;
      -&lt;port name="ServiceNamePort" binding="tns:ServiceNamePortBinding"&gt;
        &lt;soap:address location="https://ServerName:ServerPort/Platform/ServiceName"/&gt;
      &lt;/port&gt;
    &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>The issue arises before running any code as the WSDL importer (called from add service reference in visual studio) immediately complains about the WSDL in the generated configuration file, here is the full configuration file : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
      &lt;startup&gt; 
          &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /&gt;
      &lt;/startup&gt;
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;customBinding&gt;
                  &lt;binding name="ServiceNamePortBinding"&gt;
                      &lt;!--    WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://oracle.e1.bssv.BSSVServiceNumber/':    --&gt;
                      &lt;!--    &lt;wsdl:binding name='ServiceNamePortBinding'&gt;    --&gt;
                      &lt;!--        &lt;ns2:SupportingTokens xmlns:ns2="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"&gt;..&lt;/ns2:SupportingTokens&gt;    --&gt;
                      &lt;textMessageEncoding messageVersion="Soap11" /&gt;
                      &lt;httpsTransport /&gt;
                  &lt;/binding&gt;
              &lt;/customBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="https://ServerName:ServerPort/Platform/ServiceName"
                  binding="customBinding" bindingConfiguration="ServiceNamePortBinding"
                  contract="ServiceReference1.ServiceName" name="ServiceNamePort" /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Now i never had to dig into soap as every single service i encountered in the past 10 years simply got generated nicely by WSDL, so i'm at loss at what i should do, trying to use the customhttpbinding as such results in </p>
  
  <pre><code>System.ServiceModel.FaultException: 'Error on verifying message against security policy Error code:1000'
  </code></pre>
  
  <p>With a null InnerException.</p>
  
  <p>I'm not doing anything special on the console project i'm using to test it, i'm calling it exactly as i did before the change (the first line to limit to TLS 1.2 was added in hopes it was related, but changed Nothing to the error) : </p>
  
  <pre><code>static void Main(string[] args)
  {
      System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
      var srv = new ServiceReference1.ServiceNameClient();
      srv.ClientCredentials.UserName.UserName = "USERNAME";
      srv.ClientCredentials.UserName.Password = "PASSWORD";
      foreach (var item in srv.FirstMethod("").keyValuePairList1) // Exception thrown on the FirstMethod call.
      {
          Console.WriteLine(item.key + " : " + item.value);
      }
  }
  </code></pre>
  
  <p>Google didn't help as the mix of keyword leads mostly to unrelated results (exposing WCF services to be consumed by JDE etc).</p>
  
  <p>The few results that do were related didn't help, notably one hinting at how to configure the custombinding that worked for the person who asked (but i guess the configuration can wildly differ depending on the server config?).</p>
  
  <p>So on to the actual question as this bulky message may make the question unclear : what would be an appropriate configuration file, based on the WSDL provided, to connect to the service? Should i stick to the custombinding and if so how can i figure out how to configure it?</p>
  
  <p>Note that people are consuming it from java without issues as well as from SoapUI.</p>
  
  <p>The project is targeting .NET 4.6</p>