Then from ASP, to call a CORBA component (like a PB component)
<%
theURL = "iiop://myjaguar:9000"
set aORB = Server.CreateObject("Jaguar.ORB")
aORB.init("")
Set aManager =
aORB.string_to_object(theURL).Narrow_("SessionManager/Manager")
Set aSession =
aManager.createSession("myuser","mypwd").Narrow_
("SessionManager/Session")
Set aFactory = aSession.lookup("MyPackage/MyComponent")
Set obj = aFactory.Create().Narrow_("MyPackage/MyComponent")
sz = obj.of_sayhello()
response.write sz
set obj = nothing
set aFactory = nothing
set aSession = nothing
set aManager = nothing
set aORB = nothing
%>
<%
theURL = "iiop://myjaguar:9000"
set aORB = Server.CreateObject("Jaguar.ORB")
aORB.init("")
Set aManager =
aORB.string_to_object(theURL).Narrow_("SessionManager/Manager")
Set aSession =
aManager.createSession("myuser","mypwd").Narrow_
("SessionManager/Session")
Set aFactory = aSession.lookup("MyPackage/MyComponentEJB")
Set objHome = aFactory.Narrow_("com/rgagnon/EJB/MyComponentHome")
Set obj = objHome.Create()
sz = obj.sayHello()
response.write sz
set objHome=nothing
set obj = nothing
set aFactory = nothing
set aSession = nothing
set aManager = nothing
set aORB = nothing
%>Thanks to RobbGolds
Written and compiled by Réal Gagnon ©1998-2005
[ home ]