soap security negotiation failed

I am working through the Windows Communications Foundation samples. I am currently working with the sample titled "Addressing".

When I build the sample, client and server, and run them both on the same PC, the application works fine. However, when I move the client to another PC, I get the error: "soap security negotiation ... failed ". This is using the wsHttpBinding as the sample is delivered. If I change the binding to basicHttpBinding, the application works correctly.

I am using the February CTP, winfxsetup.exe dated February 23, 2006.

My network is setup as a peer-to-peer network where both PCs have the same username with the same password and my user is part of the Administration group on both PCs.

Does anyone know why I am getting this error

Thank you for your help,

Steve



Answer this question

soap security negotiation failed

  • Kalagara

    I am getting the exact with the client on the same machine as on the service
  • Bogdan Trcek

    We would like to use security.

    Following is the full stack trace and error message.

    Thank you for your help,

    Steve

    System.ServiceModel.Security.SecurityNegotiationException was unhandled
    Message="Soap security negotiation to 'http://sgvista:8000/servicemodelsamples/service' failed. Please see inner exception for more details."
    Source="mscorlib"
    StackTrace:
    Server stack trace:
    at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
    at System.ServiceModel.Security.IssuanceTokenProviderBase`1.GetTokenCore(TimeSpan timeout)
    at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
    at System.ServiceModel.Security.SecurityProtocol.GetToken(SecurityTokenProvider provider, EndpointAddress target, TimeSpan timeout)
    at System.ServiceModel.Security.MessageSecurityProtocol.GetTokenAndEnsureOutgoingIdentity(SecurityTokenProvider provider, Boolean isEncryptionOn, TimeSpan timeout, SecurityTokenAuthenticator authenticator)
    at System.ServiceModel.Security.SymmetricSecurityProtocol.TryGetTokenSynchronouslyForOutgoingSecurity(Message message, SecurityProtocolCorrelationState correlationState, Boolean isBlockingCall, TimeSpan timeout, SecurityToken& token, SecurityTokenParameters& tokenParameters, SecurityToken& prerequisiteWrappingToken, IList`1& supportingTokens, SecurityProtocolCorrelationState& newCorrelationState)
    at System.ServiceModel.Security.SymmetricSecurityProtocol.SecureOutgoingMessageCore(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
    at System.ServiceModel.Security.MessageSecurityProtocol.SecureOutgoingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
    at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
    at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
    at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
    at System.ServiceModel.Channels.CommunicationObject.Open()
    at System.ServiceModel.Channels.DatagramAdapter.DatagramAdapterChannelBase`1.GetChannel()
    at System.ServiceModel.Channels.DatagramAdapter.RequestDatagramAdapterChannel.Request(Message request, TimeSpan timeout)
    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at ICalculator.Add(Double n1, Double n2)
    at CalculatorProxy.Add(Double n1, Double n2) in C:\Documents and Settings\sgraber.STEVEG\My Documents\Visual Studio 2005\Projects\WCF Samples\Basic\Addressing\client\generatedProxy.cs:line 53
    at Microsoft.ServiceModel.Samples.Client.Main() in C:\Documents and Settings\sgraber.STEVEG\My Documents\Visual Studio 2005\Projects\WCF Samples\Basic\Addressing\client\client.cs:line 26
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()


  • Matthew Feng

    By default wsHttpBinding used message level security and basicHttpBinding is not secure. If you disable security on your wsHttpBinding application, I'm sure that it will work.

    If you want to use security, however, we'll have to do some more troubleshooting. Please send the full stack trace and error message and we'll go from there.

    Thanks!

    Scott



  • eglasius

    Ok. This wasn't enough data to tshoot the problem so would you be willing to add tracing to your application

    Put this inside your config files to get additional data:


    <configuration>
    <system.diagnostics>
    <sources>
    <source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    <source name="System.ServiceModel" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    <source name="System.Runtime.Serialization" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    <source name="System.Security.Authorization" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    <source name="Microsoft.Transactions.Bridge" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    <source name="System.Transactions.Indigo" switchValue="Verbose">
    <listeners>
    <add name="_listener0" />
    </listeners>
    </source>
    </sources>
    <sharedListeners>
    <add name="_listener0" type="System.Diagnostics.XmlWriterTraceListener"
    initializeData="Client.exe.e2e" />
    </sharedListeners>
    <trace autoflush="true" />
    </system.diagnostics>

    <system.serviceModel>
    <diagnostics>
    <messageLogging logEntireMessage="true" logMalformedMessages="false" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="true" maxMessagesToLog="3000" />
    </diagnostics>
    </system.serviceModel>
    </configuration>

    Once you have it please email me at smason@microsoft.com.

    Thanks!

    Scott



  • soap security negotiation failed