PureConnect

 View Only

Discussion Thread View
  • 1.  Error when trying to get IceLib session from Add-in

    Posted 09-22-2011 07:30
    Hi, trying to get the current session from add-in using the following statement: _session = _serviceProvider.GetService(typeof(Session)) as Session; The _session object is null. And in trace file I see the following message:
    AddInServiceProvider.GetService : An AddIn requested a type (ININ.IceLib.Connection.Session) that was not allowed
    I have my addin published in the add-in folder running fine together with ic client. I also have all icelib-files in the same folder. Am I missing something here?


  • 2.  RE: Error when trying to get IceLib session from Add-in

    This message was posted by a user wishing to remain anonymous
    Posted 09-22-2011 15:11
    Hi Mari- Retrieving the session out of the service provider is only allowed if the IC server has the IceLib SDK license installed. Additionally, there are some potential problems that can be encountered by using the client's session directly, which is why this isn't well documented -- it's a "discouraged" practice in an add-in. But if absolutely necessary, you can retrieve it if the proper licenses are in place. Also, 2 more things: Only copy your add-in specific binaries into the "addins" subfolder. If there are binaries that the Interaction Client already has in it's install directory, then do not copy duplicates. If you don't mind, could you give details about what you're trying to do? We want to expand the add-in API to encompass user-specific scenarios, so any details you can give will help us prioritize and design the appropriate APIs. :) Thanks! Aaron


  • 3.  RE: Error when trying to get IceLib session from Add-in

    Posted 09-23-2011 06:34
    Hi, Thank you for your update(s). It was really helpful. I fixed it yesterday, and the error occured because I had IceLib.dll in my AddIns directory. Took me a while to figure out that, since the file is copied over when I do debugging. What I was trying to do: - Capture key pressed, ie "L" (L for Ledig, which means Available in norwegian:-)) - Get the current Session - Get the logged in user - Call a handler, and change the status in handler _Session = _serviceProvider.GetService(typeof(Session)) as Session; sUserId = _Session.UserId; string[] sArray = new string[] {sUserId}; CustomMessageHeader header = new CustomMessageHeader (CustomMessageType.ServerNotification, "Status_Objekt", "Status"); CustomRequest request = new CustomRequest(header); request.Write(sArray); CustNotify = new CustomNotification(_Session); CustNotify.SendServerRequestNoResponse(request); Works fine now, after removing the Icelib.dll from Addins folder. But I havent testet it enough to find if it causes other errors or suspect behaviours in the system.


  • 4.  RE: Error when trying to get IceLib session from Add-in

    This message was posted by a user wishing to remain anonymous
    Posted 09-23-2011 14:04
    Thanks for the additional information- What you're doing should be fine, sending custom notifications has no side effects on the rest of the client. The only thing you might change is that you're sending the notification on the User Interface thread which can hang the GUI for users. Consider using a background thread to send the notification instead, and free up the UI thread. As for IceLib being in the "addins" folder, in your Visual Studio project select any referenced assembly that already exists in the client install directory and change "Copy Local" to false. This will prevent them from being copied to the bin/Debug or bin/Release folder, and then you won't have to worry about accidentally deploying them.


Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources