Thomas Adrian aka Notessidan has written a small web service for which he provides code to consume it. I had to try it so I did both with the suggested way in an agent using Microsoft's SOAP client and it works fine.
I also had to try using the new consumer service in Notes8. This works very good as well and this is how I did it:
- Download the WSDL-file that describes the web service you want to call
- Create a script library (LotusScript)
- Press the WSDL button and import the WSDL file. When doing this on Notesidan's WSDL file my script library looks like:
%INCLUDE "lsxsd.lss"
Class Notessidan As PortTypeBase
Sub NEW
Call Service.Initialize ("UrnDefaultNamespaceNotessidanService", _
"NotessidanService.Domino", "http://www.notessidan.se:80/A55B53/blogg.nsf/_
notessidan?OpenWebService", "Notessidan")
End SubFunction GETSIZE() As XSD_ANYTYPE
Set GETSIZE = Service.Invoke("GETSIZE")
End Function
Function NUMBEROFDOCUMENTS() As Long
Let NUMBEROFDOCUMENTS = Service.Invoke("NUMBEROFDOCUMENTS")
End Function
End Class - Now create an agent and use the script library. Type 'Use "scriptlib_name"' in the (Options).
- To show for example the number of documents in a message box, use the following code in initialize:
Sub Initialize
Dim ns As New Notessidan
Dim numbDoc As Long
numbDoc = ns.NUMBEROFDOCUMENTS
Msgbox "Number of documents: " & numbDoc
End Sub - Run the agent from the Notes client or from an application in where you want to use the data.
Technorati tags:
Lotus Notes, , notes8beta, Web Service, Consumer