Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>All right, this one really caused me a hard time resolving, which I will spare others for. The challenge was in the fact, that I used the <code>&lt;%@ ServiceHost Factory="System.ServiceModel.Activation.WebServiceHostFactory" Service="fullyQualifiedClassName" %&gt;</code>, which is a nice and easy factory implementation approach.</p> <p>However, this approach has it drawbacks; since no configuration is needed in the web.config file, the WebServiceHostFactory class by design does not ever read from the web.config file. I know; I could inherit from this class, and make the appropriate changes so it may indeed read from the config file, but this seemed a little out of scope.</p> <p>My solution was to go back to the more traditional way of implementing the WCF; <code>&lt;%@ ServiceHost Service="fullyQualifiedClassName" CodeBehind="~/App_Code/Catalogue.cs" %&gt;</code>, and then use my already configured values in the web.config file.</p> <p>Here is my modified web.config file (with respect to Maddox headache):</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;webHttpBinding&gt; &lt;binding name="XmlMessageBinding" maxReceivedMessageSize="5000000" maxBufferPoolSize="5000000" maxBufferSize="5000000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00"&gt; &lt;readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" maxBytesPerRead="5000000" /&gt; &lt;security mode="None"/&gt; &lt;/binding&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service name="fullyQualifiedClassName" behaviorConfiguration="DevelopmentBehavior"&gt; &lt;endpoint name="REST" address="" binding="webHttpBinding" contract="fullyQualifiedInterfaceName" behaviorConfiguration="RestEndpointBehavior" bindingConfiguration="XmlMessageBinding" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="RestEndpointBehavior"&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="DevelopmentBehavior"&gt; &lt;serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true"/&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;/behavior&gt; &lt;behavior name="ProductionBehavior"&gt; &lt;serviceDebug httpHelpPageEnabled="false" includeExceptionDetailInFaults="false"/&gt; &lt;serviceMetadata httpGetEnabled="false"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Another benefit of this change is, that you can now reference your WCF-rest service directly from .NET; this cannot be done using the Factory model and my implementation of XmlElement through out the solution.</p> <p>I hope this can help others with similar issues ...</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.
    3. 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