How can access to COM+ Proxy(s) from ASPX pages

asp.net United States
  • 17 years ago

    How can access to COM+ Proxy(s) from ASPX pages



    Hi,


    When I wanted to call COM+ Proxy methods from ASPX pages it returns error but in VB.Net Application it is running


    correctly. what is the problem?



    Source 1 (ASPX page):


    'Test1.aspx
    '----------------


    Dim objProxy as New TestComPlus.Class1Class()
    Dim str as Object
    str = "test"
    objProxy.TestMethod(str)
    Response.Write(str)


    'End of Program


    in the run time when it reach to objProxy.TestMethod(str) it is returning the following error:


    QueryInterface for Interface TestComPlus.Class1 failed.
    Exception Details: System.InvalidCastException: QueryInterface for Interface TestComPlus.
    Class1 failed.



    when I wrote the above code in the following format it will show different error message in the same method calling.




    Source 2 (ASPX page):


    'Test2.aspx
    '----------------


    Dim objProxy as Object
    objProxy = GetObject("", "TestComPlus.Class1")
    Dim str as Object
    str = "test"
    objProxy.TestMethod(str)
    Response.Write(str)


    'End of Program


    in the run time when it reach to objProxy.TestMethod(str) it is returning the following error:


    Server Error in "/WebApplication3"


    Object reference not set to an instance of an object.


    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.



    but it is running simply in an application form without error and it returns the correct answer.


    Source 3 :



    Dim objProxy as New TestComPlus.Class1Class()
    Dim str as Object
    str = "test"
    objProxy.TestMethod(str)
    MessageBox.Show(str)


    'End of Program




    it is a simple com+ (written in VB) with one method that I wrote the source code here:


    Public Function TestMethod(ByRef str)
       str = str + "*"
       TestMethod = True
    End Function


    it is all. if you have any idea please let me know. thank you.


    Sincerely,


    Jacoby



Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard