<?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>Lotushints &#187; Web services</title>
	<atom:link href="http://www.lotushints.com/tag/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lotushints.com</link>
	<description>Lotus Notes tips &#38; tricks you always hoped you will not need</description>
	<lastBuildDate>Thu, 29 Dec 2011 09:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cleaning behind you</title>
		<link>http://www.lotushints.com/2010/04/cleaning-behind-you/</link>
		<comments>http://www.lotushints.com/2010/04/cleaning-behind-you/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 06:00:03 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[destructor]]></category>
		<category><![CDATA[erase]]></category>
		<category><![CDATA[garbage collector]]></category>
		<category><![CDATA[memory leak]]></category>
		<category><![CDATA[Web services]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=494</guid>
		<description><![CDATA[Ending up a big project, I was brimming with confidence. The code was well structured, it ran fast despite using external web services and on top of that, it worked on test system. Oh boy, did it work. I should have seen a warning sign there. But no. I let my vanity kick  in and [...]]]></description>
			<content:encoded><![CDATA[<p>Ending up a big project, I was brimming with confidence. The code was well structured, it ran fast despite using external web services and on top of that, it worked on test system. Oh boy, did it work. I should have seen a warning sign there. But no. I let my vanity kick  in and enjoyed the good times. Yes, everything worked. Until&#8230;</p>
<p><span id="more-494"></span></p>
<p>&#8230;server crashed. With access violation problem. I feverishly scrolled through code, looking for an obvious error, but was unable to locate one at first glance. And than, slowly it dawned on me. I let garbage collection do my own dirty work. Unfortunately garbage collection in LotusScript has a small &#8220;feature&#8221;. It does not collect and disposes of web service consumers.</p>
<p>This is what my problem was. I created an abstract class that took care of initialization (including service consumer object). Then each data type had it&#8217;s own class that inherited from that abstract class. Needless to say that I forgot to add destructor that would clear web service consumer object. So, now, I had n web service consumer objects pointing to the same web service consumer, resulting in a memory leak of a size of an elephant after a huge meal and consequently a server crash.</p>
<p>But enough about me. Cleaning behind you in your code is a good practice. Not only it will make your code run smoother and look more spiffy, but it will also save you from feverish last minute code scrambling, busting your head and yelling like a mad man with a look of a rabid squirrel. So, let&#8217;s look what you can do.</p>
<p>1. <strong>Use destructors that actually do something useful in your classes.</strong></p>
<p>Having an empty Sub Delete (or none at all) is just not enough. Try  clearing your member variables as well. Specially if they are your  custom classes, web services, arrays or lists.<strong></strong></p>
<p><strong>2. Don&#8217;t be afraid to use Erase statement to clear arrays and lists you don&#8217;t need.<br />
</strong></p>
<p>Arrays and lists can take up a lot of your servers memory. Specially if you do an array of Notes objects. Be sure to clear them as soon as they are not needed anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2010/04/cleaning-behind-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web services and arrays in LotusScript</title>
		<link>http://www.lotushints.com/2010/03/web-services-and-arrays-in-lotusscript/</link>
		<comments>http://www.lotushints.com/2010/03/web-services-and-arrays-in-lotusscript/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:00:16 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Web services]]></category>
		<category><![CDATA[LotusScript]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=490</guid>
		<description><![CDATA[Recently, I was working on an agent that used a web service to export data. Now, I don&#8217;t know if you noticed, but for some reason, consuming services is way easier in LotusScript than it is in Java. As far as I know, and I could be wrong, you need to import Axis in Java [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was working on an agent that used a web service to export data. Now, I don&#8217;t know if you noticed, but for some reason, consuming services is way easier in LotusScript than it is in Java. As far as I know, and I could be wrong, you need to import Axis in Java to do anything with a Web service consumer.</p>
<p><span id="more-490"></span></p>
<p>In LotusScript, consuming web services is plain easy. You just import the WSDL, which can be located either on your file system or directly on the web and you are good to go.</p>
<p>Sounds too good to be true? It is. There are couple of limitations, that will make you swear like a gypsy on a bad day.</p>
<ol>
<li>Variables and function names must not be longer than 46 characters.</li>
<li>There is no way in hell your code will know how to process an array, that was passed as a result.</li>
</ol>
<p>Don&#8217;t get me wrong. This is most certainly not a problem when Web service itself is pretty simple. However, it becomes an annoyance when you start using complex 3rd party Web services.</p>
<p><strong>How to get around those?</strong></p>
<p>For 3rd party services, I guess it depends from case to case. For one web service, we actually had to come up with adapter web service written in C#, that would translate interfaces needed to something that could be used in LotusScript. I guess we could have used Java, but that caused some memory leaks.</p>
<p>If you are doing your own service, just make sure, that you don&#8217;t return any arrays and that your variables are according to the consensus of LotusScript and youa re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2010/03/web-services-and-arrays-in-lotusscript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web Services on ND8 vs ND7</title>
		<link>http://www.lotushints.com/2009/01/web-services-on-nd8-vs-nd7/</link>
		<comments>http://www.lotushints.com/2009/01/web-services-on-nd8-vs-nd7/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 08:00:21 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[Upgrades]]></category>
		<category><![CDATA[Web services]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[LotusScript]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=160</guid>
		<description><![CDATA[One would think, creating and running web services on ND8 should not be incompatible with ND7 process. Wrong. There are a few quite important differences when creating web services on ND8 instead of ND7. You can now create clients. The one we&#8217;ve all been waiting for since ND7 came out. Web services created/built on ND8 [...]]]></description>
			<content:encoded><![CDATA[<p>One would think, creating and running web services on ND8 should not be incompatible with ND7 process. Wrong. There are a few quite important differences when creating web services on ND8 instead of ND7.</p>
<ol>
<li>You can now create clients. The one we&#8217;ve all been waiting for since ND7 came out.</li>
<li>Web services created/built on ND8 don&#8217;t work on ND7 anymore! So, keep in mind that if you are running web services on ND7, you shouldn&#8217;t upgrade your designer to release 8 just yet.</li>
<li>You can now use Java libraries when creating web services in Java. You couldn&#8217;t in ND7.</li>
<li>You can now have port class defined in a script library when creating web services using LotusScript. This was not possible in ND7.</li>
<li>You can now return empty array. if you wanted to do this in ND7, you had to create a class, containing an array and then return object of that class.</li>
<li>More SOAP error handling elements.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/01/web-services-on-nd8-vs-nd7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing Web Services</title>
		<link>http://www.lotushints.com/2008/12/securing-web-services/</link>
		<comments>http://www.lotushints.com/2008/12/securing-web-services/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 08:00:33 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[Web services]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=134</guid>
		<description><![CDATA[Last week I wrote my first web service (yay!). I am not going to write about that, as process of creating web services is nicely described at IBM developerworks. But, back to my service. The service is used to do some work that only my consumer application should be able to do. However, due to [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I wrote my first web service (yay!). I am not going to write about that, as process of creating web services is nicely described at <a href="http://www.ibm.com/developerworks/lotus/library/nd7-webservices/">IBM developerworks</a>. But, back to my service. The service is used to do some work that only my consumer application should be able to do. However, due to nature of it&#8217;s use, it has to be available on public server. It was after I nearly completed it, when I became aware of this issue. <span id="more-134"></span></p>
<p>Lotus Notes offers several security features for Web services (the same as for notes agents). My first thought was to just set people who can run the service, but that failed miserably, as web service consumer (another LN application) now didn&#8217;t see the service it was supposed to consume.</p>
<p>Next idea was to have Web Service Run as web user, but that only caused an error upon saving newly imported consumer code. Thus, Lotus Notes security failed in full (or, I just don&#8217;t know how to use it for Web Services).</p>
<p>Next option was to have my web service request user name and password, but for the life of me, I couldn&#8217;t find any reference as to how I would do that.</p>
<p>So, the only option left, and the easiest one to implement, was to just create a hash string, that web service could check and send it as part of data structure. It works nicely and provides enough security.</p>
<p>I do wonder why all those security options didn&#8217;t work though&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2008/12/securing-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

