title: Modify wsdl port name
body: <p>I'm trying to modify a port name for a web service I made, but I can't figure out what I'm doing wrong.</p>
  
  <p>I found this post that gives an example of how to do it: <a href="https://stackoverflow.com/questions/4704148/wsdl-first-approach-how-to-specify-different-names-for-wsdlport-and-wsdlbindi">WSDL-first approach: How to specify different names for wsdl:port and wsdl:binding?</a></p>
  
  <p>I've made a simple web service for testing the suggested solution in the above post, but the port name is not updated.</p>
  
  <p>Here is a snippet from the wsdl, where two port names are defined. I'd like to modify port name helloSoap12 to something else.     </p>
  
  <pre><code>&lt;wsdl:service name="hello"&gt;
      &lt;wsdl:port name="helloSoap" binding="tns:helloSoap"&gt;
          &lt;soap:address location="http://someaddress/Hello.asmx" /&gt; 
      &lt;/wsdl:port&gt;
      &lt;wsdl:port name="helloSoap12" binding="tns:helloSoap12"&gt;
          &lt;soap12:address location="http://someaddress/Hello.asmx" /&gt; 
      &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  </code></pre>
  
  <p>Here is how the web config looks like:</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation debug="true" targetFramework="4.5" /&gt;
    &lt;httpRuntime targetFramework="4.5" /&gt;
  &lt;/system.web&gt;
  
  &lt;system.serviceModel&gt;
  &lt;extensions&gt;
    &lt;behaviorExtensions&gt;
      &lt;add name="portName" type="CustomWsdlExtension.PortNameWsdlBehaviorExtension, CustomWsdlExtension" /&gt;
    &lt;/behaviorExtensions&gt;
  &lt;/extensions&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior&gt;
        &lt;serviceMetadata httpGetEnabled="true"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="customPortName"&gt;
        &lt;portName name="myCustomName" /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;services&gt;
    &lt;service name="CustomWsdlExtension.helloSoap12"&gt;
      &lt;endpoint address="" binding="basicHttpBinding" contract="CustomWsdlExtension.helloSoap12"
                behaviorConfiguration="customPortName" /&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  &lt;/system.serviceModel&gt;
  &lt;configuration&gt;
  </code></pre>
  
  <p>As you might have figured out, I'm new to this and all input is highly appreciated</p>