If you're writing Domino Java agents that use HTTP requests to talk to the Internets, you might need to debug your code by capturing the actual bits that leave your computer as Web requests, or even by looking at the responses that come back.
I recently had to do just that for a customer project. I could write debug logs for the URLs and "payloads" that I was sending and receiving, but you don't easily get to see the HTTP headers that come and go. I found that I could download and configure Fiddler (it's free here) to reveal all, for both "normal" HTTP and also for HTTPS connections.
First of all, if you're debugging Java agents for Notes or Domino, I hope you're doing it in Eclipse, as described in my "2-Headed Beast" posting.
There's only 1 little trick you need to know to make it work properly. Because Fiddler acts as a "proxy", inserting itself between your program and your network you have to tell Java to send HTTP commands to Fiddler, instead of directly to your network adapter (other programs, like the Chrome client for GMail automatically look for proxies, and require no special configuration). The way you tell Eclipse to do what you want is to go to the "Run Configuration" (or "Debug Configuration") dialog, click on the "Arguments" tab, and enter these JVM arguments into the "VM arguments" box:
Click "Apply", and you're all set. Launch Fiddler before you run/debug your code, and it will capture all the HTTP traffic out and in. Click the "Raw" button in Fiddler to see everything (outgoing in the top pane, incoming in the bottom pane), including headers. Voilà! It's especially fun to use with Web Services.
What about doing this in Domino Designer? I haven't found an equivalent setting that allows me to specify the extra JVM arguments that Fiddler needs. It may be that if you can tweak the Run Configuration for your agents in Designer (see my blog post on how to do that), you can get it to work - I haven't tried it.
What about LotusScript? Well, unfortunately, LotusScript has never had native HTTP capabilities (probably never will). Most people who want to use HTTP from a LotusScript program use outside libraries that you can invoke using DECLARE statements, or (on Windows systems), use the COM interfaces to libraries such as MSXML.
Well, there you have it. Happy coding! Geek ya later!
Sun, Jun 8th 2014 11:10a Bob Balaban Greetings, geeks! I came across this problem on a project I'm doing: given a RESTful API on a web application server, how do you "throttle" calls so that a given authenticated user can only make a certain number of calls (N) per time interval (W), where both N and W are configurable. The solution I came up with is basically a “Token Bucket” with a sliding time window. What surprised me when I got something working was how easy it really was to implement. The context in whi [read] Keywords: application
"Employee of the Quarter" (not)
Fri, Dec 27th 2013 2:20p Bob Balaban Greetings, geeks! This one is not a technical topic, so feel free to move on. In my work email today, I received a shotgun message announcing the current "Employee of the Quarter". The lucky designee receives preferential parking (near the building entrance) for 3 months. There was a long-ish description of how great the EotQ is, and why they were selected for this honor. Not to take away from someone who is obviously (from the email description) a very hard worker, get-it-done typ [read] Keywords: email
Some Interesting Tech I’ve Been Involved With Lately
Sat, Apr 20th 2013 8:00p Bob Balaban Greetings, geeks! Some of you have been wondering what I've been up to lately. No, not a stealth-mode startup, not a new API for Notes/Domino, nothing like that. In fact, I'm at about the 6-month mark in a whole new (to me) tech area: storage and storage management. It's one of those things that's a whole lot more complicated than you'd ever think, until you start to dig into it. Me, I thought a "disk" started and ended with that box on the end of a USB cable that you plug into a la [read] Keywords: domino
The Interesting Difference Between "Exception" and "RuntimeException" (Java)
Sat, Feb 2nd 2013 6:30p Bob Balaban Greetings Geeks! I hope everyone who attended Lotusphere IBMConnect '13 had a good time and has returned home safely. I didn't attend (again, I stopped going after the first 17), but I've been hearing that it was pretty good. I learned something new about certain types of exceptions in Java programming the other day. Here's the context: I had an Enum class with a few items in it I had a String that came from outside the program that I wanted to convert into an enum'ed constant Thi [read] Keywords: lotusphere
"Reflections on Reflecting Light" - Java program
Wed, May 9th 2012 6:10p Bob Balaban Greetings Geeks! Today it is my very great pleasure to introduce to you a new guest blogger: my son David. He has graciously allowed me to prevail upon him to write about his recent science fair project, titled "Reflections on Reflecteing Light". That may sound innocuous, but to quote one of my favorite movies, "That's no ordinary rabbit!". David took this project through our local high school's science fair, was invited to the regional fair, and then to the Massachusetts state science [read] Keywords: blogger
Happy 5th? Yeah, 5th
Tue, Apr 10th 2012 8:40p Bob Balaban Greetings Geeks! So. March 30, 2007 was my first blog entry. Evidently I missed my own 5th Blanniversary! :-( Better late than never, I suppose. In theory, anyway :-) I know I don't post here often, but I do hope that when I do post, it's worth reading. For some people, anyway. I'll quote from a nice person who commented on that first post: "energetic,funny,cute--that's what I feel about you from your special explanation about "In Theory".I think you must be very content while wr [read] Keywords: lotus
"Programming Domino With Java" - Final Flush
Mon, Jan 2nd 2012 3:10a Bob Balaban Happy New Year, Geeks! Here's the 7th (and final) installment of the book. Thanks again for all the positive feedback. The first installment can be found here The 2nd installment is here The 3rd is here The 4th is here The 5th is here and the 6th is here All of the book content (as is all of the content on this blog) is Copyright 1998 and 2011 by Looseleaf Software, Inc. You may not reproduce or distribute the book's content without permission from me. Some Caveats and ex [read] Keywords: domino