SOAP security negotiation error when using WCF (please help!)

R

Ronald S. Cook

Hi,

Some users on our domain can run our WCF application no problem. Some get
an unhandled exception error re: SOAP security negotiation. I'm wanting the
service to not be secure.. I just want anyone logged into our company domain
to be able to run the app. Can someone please tell me what tag I need added
to which of these files to make this error go away?

Thanks very much in advance,
Ron

P.S. Below are what my current config files look like. Thanks.


********** App.config on the client (windows app) looks like this:
**********

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<client>
<endpoint
address="http://localhost/COWFeedyardService/Services/Country.svc"
binding="wsHttpBinding" contract="ICountry" />
<endpoint
address="http://localhost/COWFeedyardService/Services/State.svc"
binding="wsHttpBinding" contract="IState" />
<endpoint address="http://localhost/COWFeedyardService/Services/Pen.svc"
binding="wsHttpBinding" contract="IPen" />
</client>
</system.serviceModel>
</configuration>


********** App.config on the server (running under IIS) looks like this:
**********

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="FRC.COW.Feedyard.Business.My.MySettings.cnnSQL"
connectionString="Data Source=JOSHUA\SQL2005;Initial
Catalog=COWFeedyard;Integrated Security=true" />
</connectionStrings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME
with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>


********** Web.config on the server looks like this: **********

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<!-- Country -->
<service
name="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.Country"
behaviorConfiguration="CountryBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.ICountry"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="mex" />
</service>
<!-- State -->
<service name="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.State"
behaviorConfiguration="StateBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.IState"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="mex" />
</service>
<!-- Pen -->
<service name="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.Pen"
behaviorConfiguration="PenBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="FRC.COW.Feedyard.Business.FRC.COW.Feedyard.Business.IPen"/>
<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<!-- Country -->
<behavior name="CountryBehavior" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
<!-- State -->
<behavior name="StateBehavior" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
<!-- Pen -->
<behavior name="PenBehavior" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
 
N

Nicholas Paldino [.NET/C# MVP]

Ronald,

I don't see anything on the client side or the server side config files
indicating that you want authentication or authorization.

You will need to configure a <bindings> section to set the configuration
parameters on your wsHttpBinding that you are using.

Now, given that you are hosting in IIS, you are probably going to have
to indicate that you want IIS to pick up the security details (using
transport security) and not WCF.

Hope this helps.
 
J

james

Security is enabled by default. Even worse I think it uses Windows
Authentication by default. You need to disable it.

<configuration>
<system.serviceModel>
<services>
<service name = "MyNamespace.MyService">
<endpoint
address = "http://localhost:8001/MyService"
binding = "wsHttpBinding"
bindingConfiguration = "NoSecurity"
contract = "MyNamespace.IMyContract"
/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name = "NoSecurity">
<security mode = "None">
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top