WCF XP nie dziala, Win7 dziala super

0

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.SecurityChannelFactory1.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.SecuritySessionClientSettings1.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);

0

Fragmenty kodu i większe komunikaty wstawiaj w znaczniki < code >, bo tak to jest zupełnie nieczytelne.

0

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.IssuanceTokenProviderBase`1.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.ClientSecurityChannel`1.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" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="">
                            <extendedProtectionPolicy policyEnforcement="Never" />
                        </transport>
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="" binding="wsHttpBinding"
                bindingConfiguration="WSHttpBinding_IHost" contract="ServiceReference1.IHost"
                name="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); 

nie wiem czy to zwiekszylo czytelność

0

Autoryzacja Windows? Certyfikaty na XP zainstalowane i skofigurowane? Aha, i lepiej by bylo gdybyś nie miał polskiej nakładki na .NET - przynajmniej można by było zrozumieć treść wyjątku.

0

A czy to ma byc jakis konkretny certyfikat? co to w ogóle dokladnie te certyfikaty ? nic takiego nie instalowalem , w ogóle co mam zainstalowć , czy np jak zainstaluje VS 2008 to to cos pomoze czy zostana zainstalowane te certyfikaty? tworzylem to pod vs 2008 .net 3.5 ,

0

Dodam jeszcze ze mam czysty Xp tylko mam zainstalowany framwork 3.5 i nic więcej

1 użytkowników online, w tym zalogowanych: 0, gości: 1