Tuesday, October 18, 2005

Cat is out of the bag: VPN

Since afternoon today, this nagging message popped up again - every time I tried to bind web services dynamically. I thought "Oh God, why am I going backwards when I dont have proper time to go forward?"

---------------------------
Error
---------------------------
The underlying connection was closed: Unable to connect to the remote server.
---------------------------
OK
---------------------------

I thought there is something I changed - oh yes, I changed the namespaces of both web services. But that did not work. I tried changing proxy settings in machine.config and web.config files. No use.

I tried running the webservice directly from their original location - http://localhost/webservice1/service1.asmx/HelloConcept - this gave me a cute string output!

All this while, I noticed from the corner of my eyes at the taskbar icons - the Skype messenger was trying to login continously - but for some reason it couldn't.

Were they co-related? You bet...I remember changing the VPN server today since my regular server disconnected twice early in the morning.

Now - I disconnected from the VPN tunnel - with just the Internet connectivity on. You know what - Skype connected!

And you know what what - my application was able to bind to web services dynamically - without any unwanted messages!

Now you know the cat is out of the bag - VPN - now I can't help wondering if this might've been the reason from some nasty errors a few days back??!!

Lesson: You never know if one's solution is a problem to something else, or if one's problem is somebody else's solution!!! So, focus on whether you want to deal with a solution or a problem - one at a time. So much for peace and harmony!

Monday, October 17, 2005

The story so far...

This is sort of building the infrastructure for the actual implementation of the project (I would say it is 80% of the hard-work!):
1)Getting IIS to host ASP.Net web services
2)Creating a web service from .Net, describe and publish it on test UDDI registry provided by Microsoft.
3)Using WSDL and UDDI SDK, I'm able to find a method exposed by all services on the UDDI registry - ie. get details of all published web services which have exposed a function/method along with their accesspoints and binding keys. I can do this at run-time or at design-time by adding a web reference.
4)In short, my application can search for a service (from UDDI registry) which does a specific task - dynamically and invoke it. All we need to know is some understanding between the service providers and my application - on the interface of the exposed method.

Things to cover in this week (by 23rd - I really hope so!) - basically this is moving on to actual implementation of the project items:
1)Build the web services
2)Implement GUI - for a customer and for a Technical Support Engineer
3)Expose a web service hosted on a Linux box - this may take some time (considering I need to - get Apache web server to host web service and re-write the web service in Java).

Coming up...
1)24th to 30th Oct 05 - Prepare and validate the Final Project Report from Mentor/Examiner (mind you this is not a project demo).
2)31st Oct 05 - Courier the hard-copy of latest Final Project Report to BITS
3)Between 7th Nov to 11th Nov 05 - Demo of Project to Mentor/Examiner
4)Someday in Nov/Dec 05 - Viva at BITS Campus at a date BITS announces.

Somebody had called BITS office today and they told her BITS would announce the Viva dates by the end of this week (23rd Oct 05). That's the flash news!

On a finishing note, I even dreamt of invoking a web service for a handful of hours I slept yesterday!

Thursday, October 13, 2005

Discovery of discovery?!

Having done that, now my goal was to find a way to search for a business/service at run-time ie. programatically discover services from UBR.

On one night, I let my system download and install MS Platform SDK (~450MB) - I turned it on and woke up in the morning to find it had done it so well.

After some good amount of playing around, I realized I was adding reference to C:\Program Files\Microsoft UDDI SDK\2.0 Beta\Microsoft.Uddi.Sdk.dll instead of the latest from C:\Program Files\Microsoft Platform SDK. This I got to know when I found (or rather did not find!) some class members of microsoft.uddi.

Then, I went through C:\Program Files\Microsoft Platform SDK\Bin\UddiReadMe.htm to "%ProgramFiles%\Microsoft SDK\Bin\UddiSdkRegister" - a utility to get the latest UDDI SDK listed in the MS VS.Net Global Cache of references of assemblies. Mind you - run this from VS.Net command prompt - else it says gacutil.exe is not added to path.

Created a C# Console application to find no. of business listed on UBR:
//establish connection to UDDI server for inquiry
UddiConnection uc = new UddiConnection();
uc.InquireUrl = "http://uddi.microsoft.com/inquire";

//create an onject to find a business
FindBusiness fb = new FindBusiness();
fb.Names.Add("Microsoft");

//send the prepared find business request
BusinessList bizList = fb.Send(uc);
Console.WriteLine("Businesses found=" + bizList.BusinessInfos.Count.ToString());


Then, this is what I get:
---------------------------
Error
---------------------------
The underlying connection was closed: Unable to connect to the remote server.
---------------------------
OK
---------------------------

Tried some things on the references to this error at
http://support.microsoft.com/kb/819692/
http://weblogs.asp.net/tmarman/archive/2003/04/06/4948.aspx

But what really helped me was this one:
http://geekswithblogs.net/ranganh/archive/2005/08/29/51474.aspx

Found machine.config file at C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG

Made changes like this at a portion which gives you instructions to add your custom settings for . Mind you - open this file in textpad or VS.Net for better indentation (notepad gave me some strong feelings!). Note that I have inter-changed the tagging characters "<" and ">" just to get these lines on this post:


>defaultProxy<
>system.net<
proxyaddress="address:port"
bypassonlocal="false"/>
>/system.net<
>/defaultProxy<
The following entry enables reading of the per user (LAN) Internet settings.
Adding additional proxy settings, without first setting to "false",
will individually override. Note that "Automatic configuration" and
"automatic configuration scripts" cannot be read.

>proxy< settings:
usesystemdefault="[true|false]" - Read settings from Internet Options (see above)
proxyaddress="[string]" - A Uri string of the proxy server to use.
bypassonlocal="[true|false]" - Enables bypassing of the proxy for local resources.


use this section to disable proxy use for matching servers
example:
>bypasslist<

>/bypasslist<



Voila - I got the result:
C:\Documents and Settings\machanis\My Documents\Visual Studio Projects\ConsoleApplication1\bin\Debug>ConsoleApplication1.exe
Businesses found=18

Don't you see I'm having fun in crumbling, faltering, getting lost, hanging on to the ropes and - then getting upto this point??!! :-)

Senor...some updates for you

They say if you dont have anything to say, then either you're rocking or else rotting so much you cant say anything.

Well, in my case thankfully it was on the side of gliding gleefully - though not exactly rocking.

There are lots of things I did in the past few days on this project. Hmm, er...let me try to document it until my patience runs out of me - you'll see a lot of posts on top of this.

To begin with, after my OS was re-installed fresh, ASP.net started dancing on the IIS floor.

I kicked off my odyssey by a simple web service (WS).

Then, I thought of hosting a personal UDDI registry for this project - but voila, it turns out we cant do that unless we're running Windows 2003 Server - it has UDDI services to do that. I pondered on a dual-boot OS on my system - but then, soon decided to use a public UDDI Business Registry (UBR) by Microsoft (MS). They have a replica on test UBR where folks like me can play around.
http://test.uddi.microsoft.com

I created a MS passport > created a provider > published tModel > published service ....and created a sample VB.Net web application with a button which invokes the registered web service on click. I found this MSDN seminar very useful to come up to this point...
Introducing UDDI in Microsoft Windows Server 2003