Note that there are some explanatory texts on larger screens.

plurals
  1. POThe HTTP request was forbidden with client authentication scheme 'Anonymous'. when attempting to add a service reference
    primarykey
    data
    text
    <p>I've got a WCF service that is configured in the host like this:</p> <pre><code> Uri baseAddress = new Uri("http://10.94.8.27:8989/MyServiceSoap"); // Create the ServiceHost. using (ServiceHost host = new ServiceHost(typeof(MyServiceSoapService), baseAddress)) { // Enable metadata publishing. ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15; host.Description.Behaviors.Add(smb); </code></pre> <p>When the host is on a Win7 machine, I can add a reference to it from a client on the same or another Win7 machine, but not on a Win Server 2008 machine.<br> When the host is on Win Server 2008 machine - exactly the same happens (works for clients on Win7 machines, doesn't work for clients on Win Server 2008 machines).<br> That means, I cannot add a service reference to this service independent on where the host is when the client is on a Win 2008 machine. Anything I can change in the system/service/host configuration?</p> <p>thank you in advance!</p> <p>app config in the service library:</p> <pre><code>&lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true" /&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 name="MyServiceLib.Service1"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress = "http://localhost:8732/Design_Time_Addresses/MyServiceLib/Service1/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;!-- Service Endpoints --&gt; &lt;!-- Unless fully qualified, address is relative to base address supplied above --&gt; &lt;endpoint address="soap" binding="basicHttpBinding" contract="MyServiceLib.IService1"/&gt; &lt;endpoint address ="" binding="wsHttpBinding" contract="MyServiceLib.IService1"&gt; &lt;!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --&gt; &lt;identity&gt; &lt;dns value="localhost"/&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;!-- Metadata Endpoints --&gt; &lt;!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --&gt; &lt;!-- This endpoint does not use a secure binding and should be secured or removed before deployment --&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="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;/system.serviceModel&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