6

Has anyone written a client in Lotus Notes to consume a RESTful web service? If so, what are some examples of code that you have used? I'm uncertain as to where to start, as there do not seem to be many examples on the web at present.

My end goal is to have some Lotusscript (or alternatively Java or even @Formula) that a Notes client app can use to perform regular GET, POST, PUT and DELETE calls to a RESTful web service with. I'll be storing the results in .xml files on the client's computer.

Thanks!

Fuzzy Analysis
  • 3,168
  • 2
  • 42
  • 66
  • Is this a Lotus Notes client application, a web application or both? – Rob Darwin Jul 25 '12 at 13:04
  • Also, is your goal an application for a single Notes or Domino web user to consume the RESTful service interactively during their session? Or is it for a process on the the Domino server to consume information from the RESTful service in the background, and keep a record of the consumed information for Lotus Notes or Domino web users to view and act on later? – Richard Schwartz Jul 25 '12 at 17:13
  • It is a Lotus Notes client application. The goal is for a single Notes user to consume the RESTful service interactively during their session through GET, POST, PUT and DELETE as a normal RESTful client might do. Lotusscript examples might be nice, if anyone has them. I don't mind writing an Agent (even in Java) to consume information in the background. Thanks – Fuzzy Analysis Jul 25 '12 at 21:33

1 Answers1

5

The Geocoding class here doesn't implement all the verbs, but it gives you the basis of a COM-based approach, assuming we're talking about Windows clients.

OP Edit (Example):

Dim httpObject As Variant
Dim httpURL As String
Dim response As String
Dim returnCode As String

Set httpObject = CreateObject("MSXML2.ServerXMLHTTP")  ' use MSXML object
httpURL = "http://" & yourWebServiceURL      
Call httpObject.open("GET", httpURL, False)
response = Left$(httpObject.responseText,16000)
returncode = GetGeoValue("code")  ' e.g. 200 for success
Fuzzy Analysis
  • 3,168
  • 2
  • 42
  • 66
Rob Darwin
  • 942
  • 1
  • 10
  • 17
  • 1
    Perfect, thanks! It should be noted that you will also need to install MSXML 2.0 or later for the code to create the needed object (http://msdn.microsoft.com/en-us/library/ms762278%28VS.85%29.aspx) – Fuzzy Analysis Jul 26 '12 at 11:36
  • 1
    MSXML2.XMLHTTP will also work for your object type, since this is a client-side operation. I couldn't find whether it also depends on MSXML 2.0 being installed though. – Rob Darwin Jul 26 '12 at 15:58