Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

WCF: MessageSecurityException when hosting on an IIS

 
 
Thread Tools Display Modes
Old 03-26-2007   #1 (permalink)
gifa
Guest


 

WCF: MessageSecurityException when hosting on an IIS

Hello

When i try to call a WCF Service trough IIS i get the following
Exception:

The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was
'Negotiate,NTLM'.

Windows Authentication is enabled on the web-app.


Here My Code and my configs:

client code:

private void button1_Click(object sender, EventArgs e)
{
StringClient client = new StringClient();

string inverse = client.Inverse("test");

MessageBox.Show(inverse);
}


app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IString" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/UsefulServicesWeb/
StringServiceWeb.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IString"
contract="IString" name="WSHttpBinding_IString">
<identity>
<userPrincipalName value="OIZE314399\ASPNET" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>


web.config

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
v2.0">
<system.serviceModel>
<services>
<!-- Before deployment, you should remove the returnFaults behavior
configuration to avoid disclosing information in exception messages --
>

<service name="UsefulServicesWeb.StringServiceWeb"
behaviorConfiguration="returnFaults">
<endpoint contract="UsefulServices.IString"
binding="wsHttpBinding"/>
<endpoint contract="IMetadataExchange"
binding="mexHttpBinding" address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="returnFaults">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>

Old 04-10-2007   #2 (permalink)
Dwight@QuickLearn
Guest


 

RE: WCF: MessageSecurityException when hosting on an IIS

It sounds like IIS Web application in question has its security settings set
to only allow Integrated Users.

This is set inside the IIS MMC snap-in. It doesn't have anything to do with
WCF.

hth


"gifa" wrote:

> Hello
>
> When i try to call a WCF Service trough IIS i get the following
> Exception:
>
> The HTTP request is unauthorized with client authentication scheme
> 'Anonymous'. The authentication header received from the server was
> 'Negotiate,NTLM'.
>
> Windows Authentication is enabled on the web-app.
>
>
> Here My Code and my configs:
>
> client code:
>
> private void button1_Click(object sender, EventArgs e)
> {
> StringClient client = new StringClient();
>
> string inverse = client.Inverse("test");
>
> MessageBox.Show(inverse);
> }
>
>
> app.config
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <configSections>
> </configSections>
> <system.serviceModel>
> <bindings>
> <wsHttpBinding>
> <binding name="WSHttpBinding_IString" closeTimeout="00:01:00"
> openTimeout="00:01:00" receiveTimeout="00:10:00"
> sendTimeout="00:01:00"
> bypassProxyOnLocal="false" transactionFlow="false"
> hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
> messageEncoding="Text" textEncoding="utf-8"
> useDefaultWebProxy="true"
> allowCookies="false">
> <readerQuotas maxDepth="32" maxStringContentLength="8192"
> maxArrayLength="16384"
> maxBytesPerRead="4096" maxNameTableCharCount="16384" />
> <reliableSession ordered="true" inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Message">
> <transport clientCredentialType="Windows"
> proxyCredentialType="None"
> realm="" />
> <message clientCredentialType="Windows"
> negotiateServiceCredential="true"
> algorithmSuite="Default"
> establishSecurityContext="true" />
> </security>
> </binding>
> </wsHttpBinding>
> </bindings>
> <client>
> <endpoint address="http://localhost/UsefulServicesWeb/
> StringServiceWeb.svc"
> binding="wsHttpBinding"
> bindingConfiguration="WSHttpBinding_IString"
> contract="IString" name="WSHttpBinding_IString">
> <identity>
> <userPrincipalName value="OIZE314399\ASPNET" />
> </identity>
> </endpoint>
> </client>
> </system.serviceModel>
> </configuration>
>
>
> web.config
>
> <?xml version="1.0"?>
> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
> v2.0">
> <system.serviceModel>
> <services>
> <!-- Before deployment, you should remove the returnFaults behavior
> configuration to avoid disclosing information in exception messages --
> >

> <service name="UsefulServicesWeb.StringServiceWeb"
> behaviorConfiguration="returnFaults">
> <endpoint contract="UsefulServices.IString"
> binding="wsHttpBinding"/>
> <endpoint contract="IMetadataExchange"
> binding="mexHttpBinding" address="mex" />
> </service>
> </services>
> <behaviors>
> <serviceBehaviors>
> <behavior name="returnFaults">
> <serviceDebug includeExceptionDetailInFaults="true" />
> <serviceMetadata httpGetEnabled="true" />
> </behavior>
> </serviceBehaviors>
> </behaviors>
> </system.serviceModel>
> </configuration>
>
>

 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
bug in the PS hosting API... graycats PowerShell 4 06-16-2008 10:57 AM
Need Hosting? - Best selling hosting providers listed here HostingFreakzz@gmail.com Avalon 0 08-17-2006 01:04 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50