Call a Jaguar component from ASP (this howto is deprecated)Tag(s): DEPRECATED
- Install the Jagclient on the Web server. Jagclient.exe when executed will install a COM component (Jaguar.ORB) that can be used with ASP to access Jaguar Component.
- You generate the REG/TLB proxies through JagManager for the desired package.
- You need to specified an output directory, you need give the same name as the directory on the Web server which will contain the generated interface (for example, on the development machine c:\jagcomp then on the Web server there must be a c:\jagcomp too).
- Plus you need the MIDL.EXE utility which is not included with the Jaguar installation. MIDL.EXE can be found in a Visual Studio installation, simply copy MIDL.EXE in %JAGUAR%\bin before generating the REG/TLB.
- You specify the directory containing jagproxy.dll (on the Web Server), habitually c:\program file\sybase\jaguar cts 3.5\client\dll .
- Copy c:\jagcomp from the development machine to the Web Server. Execute the various REG files.
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
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com