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
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).