Hi,
The following codes are used to define a web method which returns a crystal
report document in a file named "Service1.asmx". When I right-click on "View
in Browser" I got the error
---------------------------------------------------------------------------------
Cannot serialize member System.ComponentModel.Component.Site of type
System.ComponentModel.ISite because it is an interface.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.NotSupportedException: Cannot serialize member
System.ComponentModel.Component.Site of type System.ComponentModel.ISite
because it is an interface.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
---------------------------------------------------------------------------------------
Anybody could give some suggestions on this issue?
thanks in advance
Service1.asmx:
Imports System.Web.Services
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource
<System.Web.Services.WebService(Namespace :=
"http://tempuri.org/xmlWebSrv/Service1")> _
Public Class Service1
Inherits System.Web.Services.WebService
#Region " Web Services Designer Generated Code "
Public Sub New()
MyBase.New()
'This call is required by the Web Services Designer.
InitializeComponent()
'Add your own initialization code after the InitializeComponent() call
End Sub
'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
#End Region
<WebMethod()> Public Function GetReportDoc() As
CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Dim crReportDocument As
CrystalDecisions.CrystalReports.Engine.ReportDocum ent
Return crReportDocument
End Function
End Class