I found the solution to it.
I was entering the service name and hostname in wrong place.
and because my server is locally hosted. following code stub worked for connection with Tigase Server.
ConnectionConfiguration config = new ConnectionConfiguration("localhost", 5222, "yourdomain");
yourdomain shoulde be the domain name which was entered earlier while installation and configuration of the server.
Thank you all for your help though.