Session expired

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
ToLong
Posts: 4
Joined: Wed Sep 07, 2016 1:24 pm

Session expired

Post by ToLong » Wed Sep 07, 2016 1:33 pm

Hi,

i have hosted the DocuVieware in an asp.net servercontrol, every time i want to start a customcallback (PostCustomServerAction), the viewer shows me an error:

"GdPicture12.WEB.DocuViewareCore.Requests.CustomActionRequestCtx: session expired."

Can anybody help me?

Here's the code of my servercontrol:

Code: Select all

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports GdPicture12.WEB
Imports DevExpress.Web

<ToolboxData("<{0}:DocumentEditorWeb runat=server></{0}:DocumentEditorWeb>")>
Public Class DocumentEditorWeb
    Inherits WebControl
    Implements INamingContainer

    Public Event CustomAction(sender As Object, e As CustomActionEventArgs)

    Private WithEvents mcDocuVieware As DocuVieware
    Private mcGlobalEvents As ASPxGlobalEvents
    Private mcDocumentEditManager As DocumentEditManager

    Property ClientInstanceName As String

    Public ReadOnly Property DocumentEditManager As DocumentEditManager
        Get
            If mcDocumentEditManager Is Nothing Then
                mcDocumentEditManager = New DocumentEditManager(Me)
            End If

            Return mcDocumentEditManager
        End Get
    End Property

    Protected Overrides Sub CreateChildControls()
        Controls.Clear()
        CreateControlHierarchy()
        ClearChildViewState()
    End Sub

    Protected Overridable Sub CreateControlHierarchy()
        mcDocuVieware = New DocuVieware
        mcDocuVieware.ID = "DocuVieware1"

        mcDocuVieware.Style.Add("width", "100%")
        mcDocuVieware.Style.Add("height", "100%")

        mcDocuVieware.ShowAnnotationsSnapIn = False
        mcDocuVieware.ShowBookmarksSnapIn = False
        mcDocuVieware.ShowSnapInButtonStrip = False
        mcDocuVieware.ShowSnapInCollapseButton = False
        mcDocuVieware.ShowSnapInPanelHeader = False
        mcDocuVieware.ShowTextSearchSnapIn = False
        mcDocuVieware.ShowThumbnailsSnapIn = False
        mcDocuVieware.ShowToolbar = False

        Controls.Add(mcGlobalEvents)
        Controls.Add(mcDocuVieware)
    End Sub

    Public ReadOnly Property Viewer As DocuVieware
        Get
            EnsureChildControls()

            Return mcDocuVieware
        End Get
    End Property

    Protected Overrides Sub OnPreRender(e As EventArgs)
        MyBase.OnPreRender(e)

        Page.ClientScript.RegisterClientScriptResource(GetType(DocumentEdit.DocumentEditorWeb), "DocumentEdit.DocumentEditorWeb.js")
    End Sub

    Private Sub DocumentEditorWeb_Init(sender As Object, e As EventArgs) Handles Me.Init
        If Not [String].IsNullOrEmpty(_ClientInstanceName) Then
            Dim serializer = New System.Web.Script.Serialization.JavaScriptSerializer()
            Dim script As String = [String].Format("var {0} = new DocumentEditorWebClient({1});", _ClientInstanceName, serializer.Serialize(Me.ClientID))

            Dim sb As New System.Text.StringBuilder()
            sb.Append("<script language='javascript'>")
            sb.Append(script)
            sb.Append("</script>")

            ScriptManager.RegisterStartupScript(Me.Page, GetType(Page), "RegisterClientInstanceForUserControl_" + _ClientInstanceName, sb.ToString(), False)
        End If
    End Sub

    Private Sub mcDocuVieware_CustomAction(sender As Object, e As CustomActionEventArgs) Handles mcDocuVieware.CustomAction
        RaiseEvent CustomAction(sender, e)
    End Sub
End Class

Thank you!

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Session expired

Post by Loïc » Fri Sep 09, 2016 1:09 pm

Hi,

This means the DocuVieware session timeout has been reached. You can specify a value through the TimeOut property of the control. IE a value of 20 means a timeout of 20 minutes.

Please let us know if you need further information.

With best regards,

ToLong
Posts: 4
Joined: Wed Sep 07, 2016 1:24 pm

Re: Session expired

Post by ToLong » Fri Sep 09, 2016 2:06 pm

Thanks for you're answer - But the error occurs everytime

I'v tested value -1 and 20 without success.

I'm starting the website with visual studio, once it's running, i want start the callback -> Error occurs.

best regards

daniel

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Session expired

Post by Loïc » Fri Sep 09, 2016 2:36 pm

This is quite strange. Are you on the latest release?

If yes, are you able to reproduce the issue in a standalone application that you can share with our team? Please send it through http://support.orpalis.com

With best regards,

Loïc

ToLong
Posts: 4
Joined: Wed Sep 07, 2016 1:24 pm

Re: Session expired

Post by ToLong » Mon Sep 12, 2016 7:18 pm

okay i solved the Problem - i had different Versionnumbers of gdpicture in web.config and asp file. :roll:

but the Problem is not solved at all

take the following Code, add it to a Project, then add the created Control on a webform and try to post a custom Action with a button on the form

With:
DocuVieware.PostCustomServerAction('DocuVieware1', true, 'test','');

The server-side Event in the Control never gets called - i only get System.NotSupportedException in the Visual Studio Output.

Code: Select all

Imports GdPicture12.WEB

<ToolboxData("<{0}:DocAnnotator runat=server></{0}:DocAnnotator>")>
Public Class DocAnnotator
    Inherits WebControl

    Public Event CustomAction(sender As Object, e As CustomActionEventArgs)

    Private WithEvents mcDocuVieware As New DocuVieware
    Property ClientInstanceName As String

    Protected Overrides Sub CreateChildControls()
        mcDocuVieware.ID = "DocuVieware1"
        mcDocuVieware.Timeout = -1

        mcDocuVieware.Style.Add("width", "100%")
        mcDocuVieware.Style.Add("height", "100%")

        mcDocuVieware.ShowAnnotationsSnapIn = False
        mcDocuVieware.ShowBookmarksSnapIn = False
        mcDocuVieware.ShowSnapInButtonStrip = False
        mcDocuVieware.ShowSnapInCollapseButton = False
        mcDocuVieware.ShowSnapInPanelHeader = False
        mcDocuVieware.ShowTextSearchSnapIn = False
        mcDocuVieware.ShowThumbnailsSnapIn = False
        mcDocuVieware.ShowToolbar = False
        mcDocuVieware.EnableViewState = False

        Controls.Add(mcDocuVieware)
    End Sub

    Protected Overrides Sub OnPreRender(e As EventArgs)
        MyBase.OnPreRender(e)

    End Sub

    Private Sub mcDocuVieware_CustomAction(sender As Object, e As CustomActionEventArgs) Handles mcDocuVieware.CustomAction
        'Doesnt work...

        Debug.Assert(False)
    End Sub
End Class

ToLong
Posts: 4
Joined: Wed Sep 07, 2016 1:24 pm

Re: Session expired

Post by ToLong » Tue Sep 13, 2016 8:13 am

I've send you the project in Ticket #131009

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest