<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Dillon - Senior Adjunct Professor &#187; IBM Notes (Lotus Notes)</title>
	<atom:link href="https://blogs.callutheran.edu/jpdillon/category/ibm-notes-lotus-notes/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogs.callutheran.edu/jpdillon</link>
	<description>Infrequently Used Blog for My Students</description>
	<lastBuildDate>Thu, 06 Nov 2025 17:22:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<item>
		<title>Returning a Notes Document from a Web Service</title>
		<link>https://blogs.callutheran.edu/jpdillon/2014/07/01/returning-a-notes-document-from-a-web-service/</link>
		<comments>https://blogs.callutheran.edu/jpdillon/2014/07/01/returning-a-notes-document-from-a-web-service/#comments</comments>
		<pubDate>Wed, 02 Jul 2014 02:00:28 +0000</pubDate>
		<dc:creator><![CDATA[John Dillon]]></dc:creator>
				<category><![CDATA[IBM Notes (Lotus Notes)]]></category>

		<guid isPermaLink="false">http://blogs.callutheran.edu/jpdillon/?p=129</guid>
		<description><![CDATA[After a fair amount of research, experimentation, and poking around, I have finally found a way to return a Domino object (such as a NotesDocument, NotesDocumentCollection, or NotesDatabase) via a Web Service. Now that I figured it out, it struck me that it&#8217;s not something that I&#8217;m likely to use because the DXL (Domino XML [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>After a fair amount of research, experimentation, and poking around, I have finally found a way to return a Domino object (such as a NotesDocument, NotesDocumentCollection, or NotesDatabase) via a Web Service.</p>
<p>Now that I figured it out, it struck me that it&#8217;s not something that I&#8217;m likely to use because the DXL (Domino XML Language) markup is more complicated than I need. The only scenario I can imagine at this point is if you have a remote Domino server needing a Domino object that is accessible only via a Web Service.</p>
<p>Anyway, it&#8217;s worth documenting the process here so I can revisit it later.</p>
<p>For the purpose of this illustration, my code will open the Domino Directory (formerly, the &#8220;NAB&#8221;) and return the first document found in the People view.  It includes some basic error trapping.</p>
<p>Here&#8217;s the code:</p>
<pre> Public Class co_NotesDocument ' name of the "Port Type Class"

    ' note that %INCLUDE "lsxsd.lss" is defined in Options
    ' recommended Web Services tool: SoapUI from soapui.org

    Public Function getNotesDoc( aFault As WS_FAULT ) As String

        On Error Goto errHandler

        ' define basic Domino objects; note the "New" for session
        Dim s As New NotesSession
        Dim dbNAB As NotesDatabase
        Dim viewNAB As NotesView
        Dim doc As NotesDocument

        ' special object for exporting the Domino object 
        ' as a DXL thingie
        Dim exporter As NotesDXLExporter

        ' instantiate Domino objects for the Notes Address
        Set dbNAB = New NotesDatabase( "", "names.nsf" )
        Set viewNAB = dbNAB.GetView( "People" )
        Set doc = viewNAB.GetFirstDocument()

        ' Define exporter object for current document
        ' alternately you can define the input document with 
        ' Call exporter.SetInput( doc )
        Set exporter = s.Createdxlexporter( doc )

        ' return the string of text that is the DXL by assigning
        ' the Export() method's output the function's name
        getNotesDoc = exporter.Export( Doc )

        Goto Done 

errHandler:

        ' If you are using OpenLog.NSF (highly recommended), log 
        ' the error information with LogErrorEx().  This is for 
        ' internal use only (by the Domino developer)

        ' Call LogErrorEx( "Error " &amp; Err &amp; " in line " &amp; Erl _ 
        ' &amp; ": " &amp; Error$, "ERROR", doc ) 

        ' define the return properties for the fault object
        ' this is deliberately generic for external users of 
        ' the web service so it reveals less information about
        ' your infrastructure

        ' assign actor an arbitrary name; maybe substitute calling user
        Call aFault.setFaultActor( "CLU Web Service" ) 

        Call aFault.setFaultCode( 1200 ) ' arbitrary fault code

        ' arbitrary and generic error message returned in the web service
        Call aFault.setFaultString( "Sorry, this program encountered an " _
        &amp; "unexpected error. Ask your app developer to check the logs." )

        ' must do this or the fault is NOT returned
        Call aFault.setFault( True )

        Resume Done
Done:

    End Function
End Class ' ===================================================================================</pre>
<p>&nbsp;</p>
<p><span style="color: #cc99ff">Keywords: Returning a NotesDocument from a Web Service, IBM Notes, Lotus Notes, IBM Lotus Notes, IBM Notes Web Services, How to return a Domino object via web service</span></p>
]]></content:encoded>
			<wfw:commentRss>https://blogs.callutheran.edu/jpdillon/2014/07/01/returning-a-notes-document-from-a-web-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
