locked
VAIL SDK Creating a Provider Example RRS feed

  • Question

  • Has anyone complete the VAIL SDK Provider Chat Example?

    The project compiles fine, but nothing happens.
    No Exception and no chat functionality..

    Maybe this code snippet in the ObjectModelImplementation.cs is wrong?

    m_connector = ConnectorFactory.GetConnector<IProvider>("provider", this);
    
    m_connector.ConnectionOpened += m_connector_ConnectionOpened;
    
    m_connector.ConnectionClosed += m_connector_ConnectionClosed;
    
    

    There is no call to the m_connector_ConnectionOpened function

    void m_connector_ConnectionOpened(object sender, ProviderConnectionOpenedArgs<IProvider> e)
     {
     }

    and if i change the providerID to "chat"
    m_connector = ConnectorFactory.GetConnector<IProvider>("chat", this);

    i get a System.InvalidOperationException

     Message=The InstanceContext provided to the ChannelFactory contains a UserObject that
    does not implement the CallbackContractType 'ChatObjectModel.IProviderCallback'.
      Source=System.ServiceModel

    But i don´t know why !
    Anyone can help?

    Thursday, June 17, 2010 1:54 PM

Answers

  • Yes in the class ObjectModelImplementation in the ChatObjectModel project change the Connect method as indicated below: Then everything should work correctly!!
    //From this
        public void Connect(string name)
        {
          m_name = name;
          m_connector.Connect(m_name);
        }
    
    //To this
    
        public void Connect(string name)
        {
          m_name = name;
          m_connector.Connect(null);
        }

     It is VERY OBVIOUS from the code above that changes have occurred in the WHS framework since the Sept 2009 build.  It's either that or the sample never worked.  I found this particular error because I spent two days attempting to understand the Provider sample by examining the classes involved using .Net Reflector.  The Provider source code is incorrect and I cannot get the Remote Access Addin sample to work.  HERE IS MY RANT TO MICROSOFT FOR THE DAY.  PLEASE FIX THE SAMPLES. 

    Thanks

     

    • Marked as answer by Pseudocode Thursday, June 24, 2010 1:05 PM
    Wednesday, June 23, 2010 2:45 AM

All replies

  • Yes in the class ObjectModelImplementation in the ChatObjectModel project change the Connect method as indicated below: Then everything should work correctly!!
    //From this
        public void Connect(string name)
        {
          m_name = name;
          m_connector.Connect(m_name);
        }
    
    //To this
    
        public void Connect(string name)
        {
          m_name = name;
          m_connector.Connect(null);
        }

     It is VERY OBVIOUS from the code above that changes have occurred in the WHS framework since the Sept 2009 build.  It's either that or the sample never worked.  I found this particular error because I spent two days attempting to understand the Provider sample by examining the classes involved using .Net Reflector.  The Provider source code is incorrect and I cannot get the Remote Access Addin sample to work.  HERE IS MY RANT TO MICROSOFT FOR THE DAY.  PLEASE FIX THE SAMPLES. 

    Thanks

     

    • Marked as answer by Pseudocode Thursday, June 24, 2010 1:05 PM
    Wednesday, June 23, 2010 2:45 AM
  • Thanks!!

    Thursday, June 24, 2010 1:05 PM