title: How do I get WSDL file from a running service?
body: <p>Here's how I start my web service:</p>
  
  <pre><code>try
  {
      //load the shedluer static constructor
      ServiceHost svh = new ServiceHost(typeof(OrderExecutor));
  
      var tcpbinding = new NetTcpBinding(SecurityMode.None);
  
      //remove limits on the max array size
      var httpLocation = "http://" + address + ":1234";
  
      svh.AddServiceEndpoint(typeof(IOrderExecutor), new WSHttpBinding(SecurityMode.None), httpLocation);
  
      ServiceMetadataBehavior smb = svh.Description.Behaviors.Find&lt;ServiceMetadataBehavior&gt;();
  
      if (smb == null)
          smb = new ServiceMetadataBehavior();
  
      smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
      svh.Description.Behaviors.Add(smb);
  
      // Add MEX endpoint
  
      svh.AddServiceEndpoint(
                  ServiceMetadataBehavior.MexContractName,
                  MetadataExchangeBindings.CreateMexHttpBinding(),
                  httpLocation + "/mex"
                  );
  
  
      svh.Open();
      Console.WriteLine("Service mounted at {0}", httpLocation);
      Console.WriteLine("Press Ctrl+c to exit");
  
      var re = new ManualResetEvent(false);
      re.WaitOne();
      svh.Close();
  }
  catch (Exception e)
  {
      Console.WriteLine("Exception");
      Console.WriteLine(e);
  } 
  </code></pre>
  
  <p>The service starts and works ok, Visual studio can connect to it and create a working client.</p>
  
  <p>But, I need a WSDL file to make it inter-operate with PHP.</p>
  
  <p>I've tried</p>
  
  <pre><code>http://localhost:1234?wsdl
  http://localhost:1234/IOrderExecutor?wsdl
  http://localhost:1234/IOrderExecutor.wsdl
  </code></pre>
  
  <p>without any success.</p>
  
  <p>I've also tried</p>
  
  <pre><code>svcutil /serviceName:IOrderExecutor order-executor.exe
  </code></pre>
  
  <p>With following result:</p>
  
  <pre><code>Warning: Unable to load a service with configName 'IOrderExecutor'. To export
   a service provide both the assembly containing the service type and an executab
  le with configuration for this service.
      Details:Either none of the assemblies passed were executables with configura
  tion files or none of the configuration files contained services with the config
   name 'IOrderExecutor'.
  
  Warning: No metadata files were generated. No service contracts were exported.
   To export a service, use the /serviceName option. To export data contracts, spe
  cify the /dataContractOnly option. This can sometimes occur in certain security
  contexts, such as when the assembly is loaded over a UNC network file share. If
  this is the case, try copying the assembly into a trusted environment and runnin
  g it.
  </code></pre>
  
  <p>How do I get a WSDL file from a running WCF service?</p>