Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Service response "HTTP/1.1 400 Bad Request" on shared hosting <aka Blank Page, XML Parsing Error, Invalid Address, Webpage cannot be found>
    primarykey
    data
    text
    <p>This is both information to those experiencing the issue and a question.</p> <p><strong>edit: The question is why does dropping "www." from the URL cause this error when a website running at the same address can be referenced without "www.".</strong></p> <p>I recently reproduced this problem using a trivial WCF service (the one from endpoint.tv) after resolving the usual config issues one faces moving a service from local IIS to shared hosting.</p> <p><strong>The problem was the following response (from fiddler) upon checking the url in browser.</strong> In searching the web for posts on the topic I found a number of unresolved issues pointing to the same problem in addition to the posts where the usual shared hosting config issues fix them up.</p> <p><strong>HTTP/1.1 400 Bad Request</strong> Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET Date: Tue, 17 Aug 2010 00:27:52 GMT Content-Length: 0</p> <p>In Safari/Chrome this manifests as a blank page.</p> <p>In IE you get "The webpage cannot be found".</p> <p>In FF you get "XML Parsing Error: no element found Location: http://................ Line Number 1, Column 1:" (which I saw in numerous unresolved posts on the web - feel free to backlink a possible solution)</p> <p>In Opera you get "Invalid Address"</p> <p>I was scratching my head regarding this for a while, then I thought to try <strong>putting in the "www." which I was previously omitting</strong> from my url for no particular reason.</p> <p><strong>Problem solved.</strong></p> <p>I can now see the normal output in the browser and interact with the service via WCF Test Client.</p> <p><strong><em>So the question is:</em></strong></p> <p><strong>Why does this make a difference to the hosted WCF service</strong> when I know it does not make a difference for browsing to the website hosted at the same address? <em>With or without the "www." I can browse to the website at the same domain, hosted on the same account.</em></p> <p>So far I've tested this repro on a GoDaddy service. I may try some others later.</p> <p>Also, if you happen to know - I'd be interested to know what features are likely to make my WCF services need full trust rather than medium trust. And any thoughts you have on whether it is a good idea to utilise such features (in context of least priv ideology).</p> <p>For reference this is the web.config, including an additional endpoint suggested by Mike to try and resolve this.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;customErrors mode="Off"/&gt; &lt;compilation&gt;&lt;!--debug="true"--&gt; &lt;buildProviders&gt; &lt;remove extension=".svc"/&gt; &lt;add extension=".svc" type="System.ServiceModel.Activation.ServiceBuildProvider,System.ServiceModel, Version=3.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089"/&gt; &lt;/buildProviders&gt; &lt;/compilation&gt; &lt;/system.web&gt; &lt;!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service behaviorConfiguration="blah" name="WCFServ.EvalService"&gt; &lt;endpoint address="http://www.abcdomain.com/WCFServ/WCFServ.EvalService.svc" binding="basicHttpBinding" contract="WCFServ.IEvalService" /&gt; &lt;endpoint address="http://abcdomain.com/WCFServ/WCFServ.EvalService.svc" binding="basicHttpBinding" contract="WCFServ.IEvalService" /&gt; &lt;!--&lt;endpoint address="" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;--&gt; &lt;!--&lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://abcdomain.com/WCFServ/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt;--&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="blah"&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment&gt; &lt;baseAddressPrefixFilters&gt; &lt;add prefix="http://www.abcdomain.com/WCFServ/"/&gt; &lt;/baseAddressPrefixFilters&gt; &lt;/serviceHostingEnvironment&gt; &lt;/system.serviceModel&gt; &lt;!--http://localhost/WCFServ/WCFServ.EvalService.svc--&gt; &lt;startup&gt;&lt;supportedRuntime version="v2.0.50727"/&gt;&lt;/startup&gt;&lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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