Note that there are some explanatory texts on larger screens.

plurals
  1. PO404 BadRequest exposing WCF service through external IP using IIS host headers
    text
    copied!<p>We host a WCF webservice on Windows Server 2003. This server only has 2 internal IP's. We want to expose the service externally. This is done through the firewall that maps an external IP to the service.</p> <p>So, I would need to modify the service to display that external IP for the internal links. This is not an issue since it should only be used externally.</p> <p>Changing the Host Header value in IIS gives a 'Bad Request (Invalid Hostname)' response from IIS. I also added an 'address' value to the endpoint entry in the web.config ... but it sill just points to the internal machine name. Any ideas?</p> <p>edit: I can verify that IIS7 has the exact same behaviour. Address didn't work. Different hostname gave Invalid Hostname error. Is there seriously no way to present a different (fictive) IP? :/</p> <p>edit2:</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="BasicAnonymous"&gt; &lt;security mode="None"/&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="Extended"&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;diagnostics&gt; &lt;messageLogging logEntireMessage="true" logMalformedMessages="false" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="true" maxMessagesToLog="3000"/&gt; &lt;/diagnostics&gt; &lt;services&gt; &lt;service behaviorConfiguration="Extended" name="AnCWCFWebService.ProductInfoProvider"&gt; &lt;endpoint address="" binding="basicHttpBinding" name="ASMX" bindingConfiguration="BasicAnonymous" contract="AnCWCFWebService.Interfaces.IProductInfoProvider"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;/system.serviceModel&gt; </code></pre>
 

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