From: jro@... Date: 2005-11-15T02:34:19+09:00 Subject: Re: [question]How do I access the http request from within a XMLRPC::WEBrickServlet? --yiup30KVCQiHUZFC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 13, 2005 at 06:39:17AM +0900, Adam Keys wrote: > Here's how I get at the request and response objects in xmlrpc4r. >=20 > --- > class MyServlet < XMLRPC::WEBrickServlet > def service(request, response) > # do whatever I want with the request > super > # do whatever I want with the response > end > end > --- >=20 > The call to #super will invoke whatever handlers you've added to your =20 > servlet. Its not quite what you're looking for, but hopefully its a =20 > start. Maybe you could put the relevant certificate information in =20 > an instance variable from #service and then revisit it in your handler? Thanks for the tip, it has put me one step closer to my goal. I can gather info about the certificate in the service method, but I haven't figured out how to pass it into the handler..=20 class MyServlet < XMLRPC::WEBrickServlet def service(request, response) @client_cert_subject=3Drequest.client_cert.subject puts client_cert_subject # this works super end end servlet =3D MyServlet.new something =3D SomeObject.new=20 servlet.add_handler("something.do_something") do puts @client_cert_summary # this prints "nil" something.do_something end And also if I "puts self.inspect" inside the add_handler block, I get "main= ". Which wasn't quite what I expected. =20 -jason --yiup30KVCQiHUZFC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDeMt4w2QEY5tkPw0RAqldAJwI4ifpiw6g1TJ2M0G7vBC0TeBKzwCeLhS7 VamGLaUnEU1uV9jUhdX6WT8= =uCTY -----END PGP SIGNATURE----- --yiup30KVCQiHUZFC--