Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, so there's a number of things. As I said in the comments, the project should work <strong>without</strong> changes just fine out of the box. </p> <p>The main issue in your posted code is that your web.config is not correct - you have the <code>&lt;services&gt;</code> and <code>&lt;behaviors&gt;</code> section outside of the <code>&lt;system.serviceModel&gt;</code> section, which is why you're getting the errors you're seeing. Additionally, the closing tags for your behaviors are in the wrong order.</p> <p>What your config <strong>should</strong> look like is this:</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="MyServiceBinding" /&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service behaviorConfiguration="metadataBehavior" name="WcfService1.Service1"&gt; &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="MyServiceBinding" contract="WcfService1.IService1"/&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="metadataBehavior"&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;protocolMapping&gt; &lt;add binding="basicHttpsBinding" scheme="https" /&gt; &lt;/protocolMapping&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Note that I removed your custom binding and for purposes of illustration used <code>wsHttpBinding</code> and named the configuration <code>MyServiceBinding</code>. This will result in the service using that configuration section for binding information (and since I didn't set any values, it will be the defaults for that binding).</p> <p>You could remove the entire service model section of the config and hit F5, and you will get a service that is exposed over a default <code>basicHttpBinding</code> endpoint.</p> <p><strong>Added</strong></p> <p>WCF is complex and has a steep learning curve. Binding configuration alone is a big subject, and probably one of the biggest causes of problems for developers in WCF. Remember the ABC's of WCF - Address, Binding and Contract. You <strong>must</strong> have all three to have successful running service.</p> <p>With WCF 4.0 Microsoft implemented the concept of default endpoints, bindings, etc to make configuration easier, and they added additional stuff in 4.5. Take a look at <a href="http://msdn.microsoft.com/en-us/library/ee354381.aspx" rel="nofollow">A Developer's Introduction to Windows Communication Foundation 4</a> for a starter.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload