« Back to home

A REST Web Service antipattern: The 200 black hole

If you haven’t yet gotten around to implementing an API call on your Web Service, do not make it return HTTP 200 OK. Instead, return 501 Not Implemented. If you return 200 OK but your code does nothing, the caller is likely to assume that he made some kind of error performing the call, and could easily spend an entire afternoon trying different payload and parameter encodings and tracing code internals.…

Read more »

Getting UTF-8 out of Domino web agents

A common technique for getting XML data out of IBM Lotus Domino is to build an agent which outputs the DXL encoding of a document and call it via HTTP. The code typically looks like this:

Print "Content-type: text/xml"
Dim session As New NotesSession
Dim doc As NotesDocument
[...obtain your data somehow in the variable doc...]
Dim exporter As NotesDXLExporter
Set exporter = session.CreateDXLExporter
exporter.OutputDOCTYPE = False
Dim stream As NotesStream
Set stream = session.CreateStream
Call exporter.SetInput(doc)
Call exporter.SetOutput(stream)
Call exporter.Process
Print stream.ReadText()

However, there’s a subtle error in the above code. The kind of error that can make everything look fine in testing, then cause your integration work to fall over in production.

Read more »

Web Services, SOAP, Domino, and Java 6

A while back I made a brief attempt to embark on a voyage of Web Services discovery via JAX-WS. The problem was simple enough: I had a Java program running on server A which had an object. I wanted to send that object to a Domino server running on machine B. Domino has a nifty Web Services feature these days, so it took about 2 minutes to create the SOAP-based Web Service.…

Read more »

Looking for debug information in all the wrong places

Today I took some Java code which I had been running on my laptop, and tried to deploy it to the server where it belongs. The code in question is a command-line utility designed to be run from cron. It connects to a Domino server via Web Services, connects to a DB2 server via JDBC, and then pumps data between the two via a protocol designed to try to minimize the number of updates that need to be transferred.…

Read more »