Firewwallw wylaczone, Hosta i port podajemy z palca , na dwoch win7 dziala ale na Xp nie :/ jaka moze byc przyczyna na necie nic nie znalazlem co by pomogla, tak wyglada blad, Gdy odpalam serwer na jednym Win7 a klienta na drugim to wszystko dziala ale na xp juz nie, POMOCY
System.ServiceModel.Security.SecurityNegotiationException: Procedura wywołująca nie została uwierzytelniona przez usługę. ---> System.ServiceModel.FaultException: Nie można spełnić żądania tokenu zabezpieczeń, ponieważ uwierzytelnienie nie powiodło się.
w System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
w System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
--- Koniec śladu stosu wyjątków wewnętrznych ---
Server stack trace:
w System.ServiceModel.Security.IssuanceTokenProviderBase1.DoNegotiation(TimeSpan timeout) w System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) w System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) w System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) w System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout) w System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) w System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout) w System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) w System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) w System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) w System.ServiceModel.Security.SecurityProtocol.Open(TimeSpan timeout) w System.ServiceModel.Channels.SecurityChannelFactory
1.ClientSecurityChannel1.OnOpen(TimeSpan timeout) w System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) w System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) w System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout) w System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout) w System.ServiceModel.Security.SecuritySessionClientSettings
1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
w System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
w System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
w System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
w System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
w System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
w System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
w System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
w System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
w System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
w System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
a tak wygladaja pliki config servera
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <services> <service name="Lib.Host" behaviorconfiguration="MathServiceMEXBehavior"> <!-- Enable the MEX endpoint -->
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<!-- Need to add this so MEX knows the address of our service -->
<host>
<baseAddresses>
<add baseAddress ="http://localhost:8080/Host"/>
</baseAddresses>
</host>
</service>
</services>
<!-- A behavior definition for MEX -->
<behaviors>
<serviceBehaviors>
<behavior name="MathServiceMEXBehavior" >
<serviceMetadata httpGetEnabled="true" />
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="None" revocationMode="NoCheck" />
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
dotego kod .cs myHost = new ServiceHost(typeof(Host));
// The A,B,Cs in code!
Uri address = new Uri("http://localhost:8080/Host");
WSHttpBinding binding = new WSHttpBinding();
Type contract = typeof(IHost);
// Add this endpoint.
myHost.AddServiceEndpoint(contract, binding, address);
myHost.Open();
a tak wyglada config Klienta
<configuration> <system.servicemodel> <bindings> <wshttpbinding> <binding name="WSHttpBinding_IHost" 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" enabled="false" inactivitytimeout="00:10:00" /> <security mode="Message"> <transport realm="" clientcredentialtype="Windows" proxycredentialtype="None"> <extendedprotectionpolicy policyenforcement="Never" /> </transport> <message clientcredentialtype="Windows" negotiateservicecredential="true" algorithmsuite="Default" establishsecuritycontext="true" /> </security> </binding> </wshttpbinding> </bindings> <client> <endpoint address="" binding="wsHttpBinding" contract="ServiceReference1.IHost" name="WSHttpBinding_IHost" bindingconfiguration="WSHttpBinding_IHost"> </endpoint>
</client>
</system.serviceModel>
</configuration>
no i kod
public string url;
public string grupa = "";
public WSHttpBinding bind;
public EndpointAddress adres;
public HostClient x;
...
bind = new WSHttpBinding();
adres = new EndpointAddress(url);
x = new HostClient(bind,adres);
x.Endpoint.Address = new EndpointAddress(url);