in

ASP.NET Weblogs

Web Service Guy

Web service stuff

March 2003 - Posts

  • Quod?

    Quid iuris consulti, quid pontifices, quid augures, quid philosophi senes, quam multa meminerunt!

    No it's ok - I've not gone mad. Just a line from my Latin.txt file I keep in my toolkit in case I need large amounts of dummy text data. Great for CMS development or web page design. Even better when you have clients like these.

  • God's Web Service

    Browsing around the WS Index recently I came across the the Bible Web Service.

    The host site http://www.stgregorioschurchdc.org didn't look promising, but I pressed on and pointed my current favourite 'quick and dirty' soap client (XML Spy Enterprise Edition) at the wsdl file.

    Sure enough - replacing
    <verses xsi:type="xsd:string">string</verses>
    with
    <verses xsi:type="xsd:string>Genesis 1:1</verses>
    in the auto generated Soap request and choosing 'Send request to server' from the Soap menu and there it was in the Soap response window:

    Genesis 1:1

    1 In the beginning God created the heaven and the earth.

    The interface is flexible:
    Genesis 1:1-10 will bring back verses 1 to 10
    Genesis 1:5- will bring back verse 5 to the end of the chapter and
    Genesis 3:20-24 will produce the elegant verses ending with:

    23 Therefore the LORD God sent him forth from the garden of Eden, to till the ground from whence he was taken.

    A salutary tale!

    I immediately started to think of uses for this marvellous service. After all this is a serious resource, offered in lovely Soap XML and much more useful than most of the services listed on directories like XMethods and SalCentral (e.x. Number adder - Zip code lookup - Stock quote [whose interested!] - String reverser [yes, pass it a string and it will reverse it for you !?!]).

    [Official retraction: XMethods and SalCentral are really good web service resources]

    Ideas:
    Word macros (Insert a Verse) in 'sermon' templates using the Office Web Services Toolkit aimed at the church industry.
    'Verse of the day' instead of 'Tip of the day' with your new killer app (possibly more useful).
    There are possibilities here. These could be better than my last great web services 'idea' - A component to insert adverts in Soap headers.

    Commercial opportunities aside, it's nice to see a very very old institution (I mean - when exactly was Adam?) using such a very new technology. A sign perhaps of the goodness of web services.

    I recommend this service to all.
    All details from http://www.stgregorioschurchdc.org/wsdl/Bible.wsdl.

  • Code Optimisation in .Net

    Saw an article a few months ago about code optimisation in .Net. The examples were in C# but I assume they apply to VB.Net and managed C++.

    It concerned the widely known good practice of extracting a value into a local variable rather than hitting an object property repeatedly which incurs greater overhead. Such as the following code which extracts an array length into a variable rather than on each pass of the for loop:

    int length = myStrings.Length; 
    for (int i = 0; i < length; i++)
    {
    string aString = myStrings[i];
    }

    Fair enough. This looks like good practice backed up by common sense. A good combination.

    Now it seems that this is the wrong way. Because of .Net optimisation, the faster code gets the length property of the array in the loop:

    for (int i = 0; i < myStrings.Length; i++) 
    {
    string aString = myStrings[i];
    }

    So do I unlearn a coding pattern that I've used for years? No thanks - I'll carry on the old way.

  • Buddy Browser - Who's buddy buddy with who?

    Ever wondered who's buddy buddy with who or who your buddies are and who they are buddy buddy with?

    Answer all these questions with Buddy Browser, a simple web application based on FOAF. FOAF is an emerging standard that represents an individual's basic personal information and who they know in XML format.

    Where to start? After launching Buddy Browser, choose 'Sample FOAF Urls' from the menu and choose one of the urls on the list. You may get a warning message as the page loads the FOAF file depending on your browser settings - just click OK and a person and his list of buddies will appear. You can then click on one of his buddies to display their buddies and so on.

    Buddy Browser is written in pure JavaScript and HTML and will run equally well on your own computer (without the security warning). Please feel free to download Buddy Browser - just unzip the files and double click on Buddy Browser.htm. Please feel free also to extend the functionality or the look and feel of the page as you wish.

    Buddy Browser requires Internet Explorer 6.

More Posts