Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2007, 01:49 PM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to generate a temporary class (result=1). e

Hi,

We are getting the following error when we try to launch our asp.net 1.1 application which was developed using VS.NE2003, we use .net XML webservices to obtain the data from Oracle databases. We keep our web services on one server and frontend code behind page on another server.

Server Error in '/auth/SalPlan' Application.
--------------------------------------------------------------------------------

Unable to generate a temporary class (result=1). error CS0122: 'salPlan.WSReference' is inaccessible due to its protection level
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.InvalidOperationException: Unable to generate a temporary class (result=1). error CS0122: 'salPlan.WSReference' is inaccessible due to its protection level

Source Error:


Line 94:
Line 95: Public Sub New()
Line 96: MyBase.New()
Line 97: Dim urlSetting As String = System.Configuration.ConfigurationSettings.AppSett ings("salPlan.WSPS.WSPS")
Line 98: If (Not (urlSetting) Is Nothing) Then


Source File: c:\inetpub\wwwroot\auth\salPlan\class\WSReference. vb Line: 96

Stack Trace:


[InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0122: 'salPlan.WSReference' is inaccessible due to its protection level
]
   System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence) +919
   System.Xml.Serialization.TempAssembly.GenerateAsse mbly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies) +2146
   System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) +136
   System.Xml.Serialization.XmlSerializer.FromMapping s(XmlMapping[] mappings, Type type) +193
   System.Web.Services.Protocols.SoapClientType..ctor (Type type) +310
   System.Web.Services.Protocols.SoapHttpClientProtoc ol..ctor() +151
   salPlan.WSPS.wsPS..ctor() in c:\inetpub\wwwroot\auth\salPlan\Web References\WSPS\Reference.vb:35
   salPlan.WSPSRef..ctor() in c:\inetpub\wwwroot\auth\salPlan\class\WSReference. vb:96
   salPlan.Employee..ctor(String salaryPlanCode, String employeeId) in c:\inetpub\wwwroot\auth\salPlan\class\Employee.vb: 141
   salPlan.Base.get_CurrentSupervisor() in c:\inetpub\wwwroot\auth\salPlan\aspx\Base.aspx.vb: 74
   salPlan.Base.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\auth\salPlan\aspx\Base.aspx.vb: 213
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300



Any help in this regard is appreciated.

Thank You,
Rao

 
Old March 31st, 2007, 04:22 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not sure you mean by "We keep our web services on one server and frontend code behind page on another server."

This error is usually seen when you have a class that is marked as "protected" or "private". The framework is recognizing that the class exists, but you are making an illegal request asking to instantiate it because it's not "public". Check your code for this.

-Peter
 
Old April 2nd, 2007, 08:21 AM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Peter,
Thank you very much for your help on this. I have looked at the web service code none of the declarations or methods seems to be private. Here is what I have:

Imports System.Data.OracleClient
Imports System.Configuration.ConfigurationSettings
Imports System.Net
Imports System.Web.Services
Imports System.xml
Imports System.Reflection

<System.Web.Services.WebService(Namespace:="http ://tempuri.org/salPlan/WSPS")> _
  Public Class wsPS
  Inherits WSBase

  'web methods
#Region "methods"

  'update dataset
  <WebMethod()> Public Sub updateDataSet(ByRef ds As DataSet)
    '----------------------------------------------------------------------------------
    ' method: updateDataSet
    '----------------------------------------------------------------------------------
    ' purpose: update a dataset
    ' returns: nothing
    '----------------------------------------------------------------------------------
    ' parameters:
    ' ds dataset containing update data
    '----------------------------------------------------------------------------------

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForUpdate()

    'update the dataset
    o.updateDataSet(ds)

  End Sub


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getReports")> Public Function fillDataSetReports(ByVal planCode As String, ByVal salAdminPlan As String, ByVal emplId As String, ByVal userId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId supervisor id
    ' salAdminPlan salary admin plan code (ICP, NUC)
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS(userId)

    'initialize data adapter for updates
    o.initializeDataAdapterForSelectReports(planCode, salAdminPlan, emplId)

    'retrieve the dataset
    ds = o.fillDataSet(planCode, salAdminPlan, emplId)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getReportNames")> Public Function fillDataSetReportNames(ByVal planCode As String, ByVal salAdminPlan As String, ByVal emplId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId supervisor id
    ' salAdminPlan salary admin plan code (ICP, NUC)
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForReportNames(planCode, salAdminPlan, emplId)

    'retrieve the dataset
    ds = o.fillDataSet(planCode, salAdminPlan, emplId)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getAllReports")> Public Function getAllReports(ByVal planCode As String, ByVal salAdminPlan As String, ByVal emplId As String, ByVal userId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId supervisor id
    ' salAdminPlan salary admin plan code (ICP, NUC)
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS(userId)

    'initialize data adapter for updates
    o.initializeDataAdapterForAllReports(planCode, salAdminPlan, emplId)


    'retrieve the dataset
    ds = o.fillDataSetAllReports(planCode, emplId, salAdminPlan)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getOneRec")> Public Function fillDataSet(ByVal planCode As String, ByVal salAdminPlan As String, ByVal emplId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForSelect(planCode, salAdminPlan, emplId)

    'retrieve the dataset
    ds = o.fillDataSet(planCode, salAdminPlan, emplId)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="fillDataSetEmpl")> Public Function fillDataSetEmplId(ByVal planCode As String, ByVal emplId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'retrieve the dataset
    ds = o.fillDataSetEmplId(planCode, emplId)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="fillDataSetEmplId")> Public Function fillDataSetEmplId(ByVal planCode As String, ByVal adminPlan As String, ByVal emplId As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' adminPlan salary admin plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'retrieve the dataset
    ds = o.fillDataSetEmplId(planCode, adminPlan, emplId)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getAllRecs")> Public Function fillDataSet(ByVal planCode As String, ByVal salAdminPlan As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForSelect(planCode, salAdminPlan)

    'retrieve the dataset
    ds = o.fillDataSet(planCode, salAdminPlan)

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="selectByExpression")> Public Function fillDataSetExpr(ByVal planCode As String, ByVal expr As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForSelectExpr(planCode, expr)

    'retrieve the dataset
    ds = o.fillDataSet()

    'return the dataset
    Return ds

  End Function


  'retrieve data into the dataset using search parameter
  <WebMethod(MessageName:="getCEORec")> Public Function getCEORec(ByVal planCode As String) As DataSet
    '----------------------------------------------------------------------------------
    ' method: fillDataSet
    '----------------------------------------------------------------------------------
    ' purpose: retrieve a dataset from database - one record per employee id
    ' returns: dataset containing retrieved data
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    ' emplId employee id
    '----------------------------------------------------------------------------------
    Dim ds As New DataSet

    'create the data service object
    Dim o As New DSPS

    'initialize data adapter for updates
    o.initializeDataAdapterForSelectCEO(planCode)

    'retrieve the dataset
    ds = o.fillDataSet

    'return the dataset
    Return ds

  End Function


  'rebuild hierarchy tree table
  <WebMethod(MessageName:="buildHierarchy")> Public Sub buildHierarchy(ByVal planCode As String, ByVal userId As String)
    '----------------------------------------------------------------------------------
    ' method: buildHierarchy
    '----------------------------------------------------------------------------------
    ' purpose: rebuild the hierarchy tree table
    ' returns: nothing
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    '----------------------------------------------------------------------------------

    'create the data service object
    Dim o As New DSPS(userId)

    'run the method of the service object
    o.buildHierarchy(planCode)

  End Sub

  'rebuild hierarchy tree table
  <WebMethod(MessageName:="fillDataSetUpdateAvgSalar y")> Public Sub fillDataSetUpdateAvgSalary(ByVal planCode As String)
    '----------------------------------------------------------------------------------
    ' method: buildHierarchy
    '----------------------------------------------------------------------------------
    ' purpose: rebuild the hierarchy tree table
    ' returns: nothing
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    '----------------------------------------------------------------------------------

    'create the data service object
    Dim o As New DSPS

    'run the method of the service object
    o.fillDataSetUpdateAvgSalary(planCode)

  End Sub


  'rebuild hierarchy tree table
  <WebMethod(MessageName:="fillDataSetLoadEarnData") > Public Sub fillDataSetLoadEarnData(ByVal planCode As String)
    '----------------------------------------------------------------------------------
    ' method: buildHierarchy
    '----------------------------------------------------------------------------------
    ' purpose: rebuild the hierarchy tree table
    ' returns: nothing
    '----------------------------------------------------------------------------------
    ' parameters:
    ' planCode salary plan code
    '----------------------------------------------------------------------------------

    'create the data service object
    Dim o As New DSPS

    'run the method of the service object
    o.fillDataSetLoadEarnData(planCode)

    End Sub


    'rebuild hierarchy tree table
    <WebMethod(MessageName:="fillDataSetLoadJobDeptDat a")> Public Sub fillDataSetLoadJobDeptData(ByVal planCode As String)
        '----------------------------------------------------------------------------------
        ' method: buildHierarchy
        '----------------------------------------------------------------------------------
        ' purpose: rebuild the hierarchy tree table
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        '----------------------------------------------------------------------------------

        'create the data service object
        Dim o As New DSPS

        'run the method of the service object
        o.fillDataSetLoadJobDeptData(planCode)

    End Sub

    'retrieve hierarchy tree
    <WebMethod(MessageName:="getHierarchy")> Public Function getHierarchy(ByVal planCode As String, ByVal supervisorId As String, ByVal userId As String) As XmlDocument
        '----------------------------------------------------------------------------------
        ' method: get hierarchy file
        '----------------------------------------------------------------------------------
        ' purpose: build and return the hierarchy file
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' supervisorId id of the supervisor
        '----------------------------------------------------------------------------------

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        Return o.buildHierarchyFile(planCode, supervisorId)

    End Function


    'HRMS refresh
    <WebMethod(MessageName:="hrmsRefresh")> Public Sub hrmsRefresh(ByVal planCode As String, ByVal userId As String)
        '----------------------------------------------------------------------------------
        ' method: hrmsRefresh
        '----------------------------------------------------------------------------------
        ' purpose: refresh the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        '----------------------------------------------------------------------------------

        'create the data service object
        Dim o As New DSPS(userId)

        'run the method of the service object
        o.hrmsRefresh(planCode)

    End Sub


    'history load
    <WebMethod(MessageName:="loadHistory")> Public Sub loadHistory(ByVal planCode As String)
        '----------------------------------------------------------------------------------
        ' method: loadHistory
        '----------------------------------------------------------------------------------
        ' purpose: refresh the database with history data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        '----------------------------------------------------------------------------------

        'create the data service object
        Dim o As New DSPS

        'run the method of the service object
        o.loadHistory(planCode)

    End Sub

    'EMPLOYEE DATA load
    'Raichur 01/18/2006
    <WebMethod(MessageName:="GetempData")> Public Function GetempData(ByVal planCode As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: Employee Admin data
        '----------------------------------------------------------------------------------
        ' purpose: get employee data for one of the admin reports
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        '----------------------------------------------------------------------------------
        Dim ds As DataSet

        'create the data service object
        Dim o As New DSPS

        'run the method of the service object
        ds = o.fillDataSetEmpData(planCode)

        Return ds

    End Function

    'HRMS export
    <WebMethod(MessageName:="hrmsExport")> Public Function hrmsExport(ByVal planCode As String, ByVal salAdminPlan As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: hrmsExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan admin plan (%, ICP% or NUC%)
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.hrmsExport(planCode, salAdminPlan)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function


    'PRB export
    <WebMethod(MessageName:="prbExport")> Public Function prbExport(ByVal planCode As String, ByVal salAdminPlan As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: prbExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan admin plan (%, ICP% or NUC%)
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.prbExport(planCode, salAdminPlan)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function


    'HRMS export
    <WebMethod(MessageName:="hrmsExportICP")> Public Function hrmsExportICP(ByVal planCode As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: hrmsExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.hrmsExportICP(planCode, SAL_ADMIN_PLAN_ICP + "%")

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function


    'HRMS export
    <WebMethod(MessageName:="hrmsExportLSM")> Public Function hrmsExportLSM(ByVal planCode As String, ByVal salAdminPlan As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: hrmsExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan admin plan (%, ICP% or NUC%)
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.hrmsExportLSM(planCode, salAdminPlan)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function


    'HRMS export
    <WebMethod(MessageName:="hrmsExportFreq")> Public Function hrmsExport(ByVal planCode As String, ByVal salAdminPlan As String, ByVal freq As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: hrmsExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan admin plan (%, ICP% or NUC%)
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.hrmsExport(planCode, salAdminPlan, freq)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function



    'HRMS export
    <WebMethod(MessageName:="hrmsExportFreqLSM")> Public Function hrmsExportLSM(ByVal planCode As String, ByVal salAdminPlan As String, ByVal freq As String, ByVal userId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: hrmsExport
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan admin plan (%, ICP% or NUC%)
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS(userId)

        'initialize data adapter for updates
        o.hrmsExportLSM(planCode, salAdminPlan, freq)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function




    'get supervisor list
    <WebMethod(MessageName:="getSupervisors")> Public Function getSupervisors(ByVal planCode As String, ByVal emplId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: getSupervisors
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' emplid employee id
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS

        'initialize data adapter for select
        o.getSupervisors(planCode, emplId)

        'retrieve the dataset
        ds = o.fillDataSet

        'return the dataset
        Return ds

    End Function



    'test the update dataset method
    <WebMethod()> Public Function test(ByVal input As String) As String
        Return testr()
    End Function


    Public Function testr() As String

        ' remember that this string is case-sensitive, so be careful
        Dim t As Type ' = Type.GetType("WSPS.wsPSRef")
        t = Me.GetType
        Dim w As New WSSalary

        t = w.GetType

        ' check to see if we have a valid value. If our object is null, the type does not exist...
        If t Is Nothing Then
            ' Don't assume that it is a SYSTEM datatype...
            Console.WriteLine("Please ensure you specify only valid types in the type field.")
            Console.WriteLine("REMEMBER: The Case matters (Byte is not the same as byte).")

            Exit Function ' don't continue processing

        End If

        ' declare and populate the arrays to hold the information...
        Dim fi() As FieldInfo = t.GetFields(BindingFlags.Static Or BindingFlags.NonPublic Or BindingFlags.Public) ' fields

        Dim mi() As MethodInfo = t.GetMethods(BindingFlags.Static Or BindingFlags.NonPublic Or BindingFlags.Public) ' methods
        Dim o() As Object
        o = t.GetMembers

        Dim m As MethodInfo
        Dim f As FieldInfo

        Dim s As String
        Dim r As String
        ' iterate through all the method members...
        Dim x As MethodInfo
        Dim pl() As ParameterInfo
        Dim p As ParameterInfo
        Try

            For Each x In o
                If x.MemberType <> MemberTypes.Method Then Exit Function

                s += x.Name & vbCrLf
                r += "method " & x.Name & vbCrLf

                pl = x.GetParameters

                For Each p In pl
                    r += " * " & p.Name & " " & p.ParameterType.ToString & vbCrLf

                Next p
            Next x

            ' iterate through all the field members
            'For Each m In mi
            ' Console.WriteLine(m)
            ' s += m.Name
            'Next m
            'For Each f In fi
            ' Console.WriteLine(f)
            ' s += m.Name
            'Next f
            Return s
            ' etc.... for each array type
        Catch ex As Exception
            Return s

        End Try


    End Function


    <WebMethod(MessageName:="getSupervisorsXML")> _
  Public Function getSupervisors(ByVal planCode As String, ByVal salAdminPlan As String, ByVal emplId As String, ByVal stopId As String) As XmlDocument
        '----------------------------------------------------------------------------------
        ' method: getSupervisors
        '----------------------------------------------------------------------------------
        ' purpose: retrieve supervisor information for an employee
        ' returns: XMLDocument
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' salAdminPlan salary admin plan
        ' emplid employee id
        ' stopid employee id to stop at
        '----------------------------------------------------------------------------------

        'create the data service object
        Dim o As New DSPS

        'return header data
        Return o.getSupervisorsXML(planCode, salAdminPlan, emplId, stopId)

    End Function


    'get supervisor list
    <WebMethod(MessageName:="validateEmplId")> Public Function validateEmplId(ByVal planCode As String, ByVal emplId As String) As DataSet
        '----------------------------------------------------------------------------------
        ' method: getSupervisors
        '----------------------------------------------------------------------------------
        ' purpose: export the database with demographic data from HRMS
        ' returns: nothing
        '----------------------------------------------------------------------------------
        ' parameters:
        ' planCode salary plan code
        ' emplid employee id
        '----------------------------------------------------------------------------------
        Dim ds As New DataSet

        'create the data service object
        Dim o As New DSPS

        'initialize data adapter for select
        'o.initializeAdapterForSelectEmplIdTree(planCode, emplId)

        'retrieve the dataset
        ds = o.ValidateEmplId(planCode, emplId)

        'return the dataset
        Return ds

    End Function

#End Region

End Class



 
Old April 2nd, 2007, 08:46 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Take a look at the code that is generated for the web service proxy class. The detail from your error message indicates that the problem has to do with the proxy class ("salPlan.WSReference"):

Unable to generate a temporary class (result=1). error CS0122: 'salPlan.WSReference' is inaccessible due to its protection level


-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to generate a temporary class (result=1) phuongdv ASP.NET 1.0 and 1.1 Basics 3 January 23rd, 2007 09:29 AM
Database unable to show result. (ASP.NET C#) richie86 ASP.NET 1.0 and 1.1 Basics 3 November 10th, 2005 01:59 PM
Unable to open registry key 'Temporary p2ptolu Classic ASP Databases 3 March 7th, 2005 06:49 AM
Temporary Intenet Files + WebClient Class philw86 C# 1 July 6th, 2004 02:15 AM
Unable to generate a temporary class (result=1). Ghistos BOOK: ASP.NET Website Programming Problem-Design-Solution 8 March 11th, 2004 10:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.