Hallo Martin,
danke für die Antwort.
Es laufen beide auf dem Server. Bin das Beispiel jetzt nochmal durchgegangen.
Aber ohne Ergebnis.
Der Connect ist nicht erfolgreich. Der müsste eigentlich beim Button Connect passieren.
Was mir aufgefallen ist:
Im ChatObjectModel Datei ObjectModelImplementation.cs existiert im konstruktor folgendes:
Code: Alles auswählen
m_connector = ConnectorFactory.GetConnector<IProvider>("provider", this);
m_connector.ConnectionOpened += m_connector_ConnectionOpened;
Hier sollte, so wie ich das verstehe, die Verbindung stattfinden.
So passiert einfach nichts. Er laüft durch und beim m_connector ist dann die connected eigenschaft auf false. sollte aber auf true stehen!?
In der SDK steht jetzt zwar nichts von einer änderung. Aber im client wird der Host "chat" aufgerufen.
Hier steht aber als Provider ID "provider". Wenn man das jetzt auf "chat" ändert wird eine Exception geworfen.
Und zwar im Client:
System.InvalidOperationException wurde nicht behandelt.
Message=The InstanceContext provided to the ChannelFactory contains a UserObject that
does not implement the CallbackContractType 'ChatObjectModel.IProviderCallback'.
Source=System.ServiceModel
StackTrace:
at System.ServiceModel.DuplexChannelFactory`1.CreateChannel(InstanceContext callbackInstance, EndpointAddress address, Uri via)
at System.ServiceModel.DuplexChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
at System.ServiceModel.ChannelFactory`1.CreateChannel()
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderRegistryClient.CreateWithCallback[T](ProviderInfo info, Object callback, NetworkCredential credential)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.ProviderConnectionFactory`1.CreateConnection(ProviderInfo provider, Object callback, NetworkCredential credential)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.AsyncConnector`1.Connect(ProviderConnectionInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.ConnectionCanceller`1.Connect(ProviderConnectionInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.InProcInstantiator`1.Connect(ProviderConnectionInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.ConnectionInternals`1.Connect(ProviderConnectionInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderConnector`1.DoConnection()
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderConnector`1.Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.IProviderQueryListener.HandleResult(ProviderInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.AsyncProviderQuery.HandleResult(ProviderInfo info)
at Microsoft.WindowsServerSolutions.Common.ProviderFramework.internal.ConnectorInternals.AsyncProviderQuerySender.DoQuery(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:
Jetzt könnte man in WCF seine eigenen Endpunkte definieren etc.
Aber dann macht der Provider irgendwie keinen Sinn da ich dann ja meinen eigenen WCF Dienst schreiben kann.
Ich weiss jetzt nicht genau nach welchen Fehler ich hier genau suchen muss.
Wäre für Hilfe und Tipps dankbar!