Wednesday, April 27, 2011

Web Services Concept

Web Service:
Web services (sometimes called application services) are services (usually including some combination of programming and data, but possibly including human resources as well) that are made available from a business's Web server for Web users or other Web-connected programs. Providers of Web services are generally known as application service providers.
The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available. Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall.
In Simple Term,
  •         Web services are application components
  •         Web services communicate using open protocols
  •         Web services are self-contained and self-describing
  •         Web services can be discovered using UDDI
  •         Web services can be used by other applications
·         XML is the basis for Web services
Advantage of Web Service
  • Web Services are platform-independent and language-independent, since they use standard XML languages. This means that my client program can be programmed in C++ and running under Windows, while the Web Service is programmed in Java and running under Linux.
  • Most Web Services use HTTP for transmitting messages (such as the service request and response). This is a major advantage if you want to build an Internet-scale application, since most of the Internet's proxies and firewalls won't mess with HTTP traffic (unlike CORBA, which usually has trouble with firewalls).
Disadvantages of Web Service:
  • Overhead. Transmitting all your data in XML is obviously not as efficient as using a proprietary binary code. What you win in portability, you lose in efficiency. Even so, this overhead is usually acceptable for most applications, but you will probably never find a critical real-time application that uses Web Services.
  • Lack of versatility. Currently, Web Services are not very versatile, since they only allow for some very basic forms of service invocation. CORBA, for example, offers programmers a lot of supporting services (such as persistency, notifications, lifecycle management, transactions, etc.). Fortunately, there are a lot of emerging Web services specifications (including WSRF) that are helping to make Web services more and more versatile.

How Does it Work?

The basic Web services platform is XML + HTTP.
XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.
The HTTP protocol is the most used Internet protocol.
Web services platform elements:
  • SOAP (Simple Object Access Protocol)
  • UDDI (Universal Description, Discovery and Integration)
  • WSDL (Web Services Description Language)
What is SOAP?
SOAP is an XML-based protocol to let applications exchange information over HTTP.
Or more simple:
  •         SOAP is a protocol for accessing a Web Service.
  •         SOAP stands for Simple Object Access Protocol
  •         SOAP is a communication protocol
  •         SOAP is a format for sending messages
  •         SOAP is designed to communicate via Internet
  •         SOAP is platform independent
  •         SOAP is language independent
  •         SOAP is based on XML
  •         SOAP is simple and extensible
  •         SOAP allows you to get around firewalls
  •    SOAP is a W3C standard
What is WSDL?
·         WSDL is an XML-based language for locating and describing Web services.
  •          WSDL stands for Web Services Description Language
  •          WSDL is based on XML
  •          WSDL is used to describe Web services
  •          WSDL is used to locate Web services
  •          WSDL is a W3C standard
What is UDDI?
UDDI is a directory service where companies can register and search for Web services.
  • UDDI stands for Universal Description, Discovery and Integration
  • UDDI is a directory for storing information about web services
  • UDDI is a directory of web service interfaces described by WSDL
  • UDDI communicates via SOAP
  • UDDI is built into the Microsoft .NET platform
Type of uses of Web Service
1.      Reusable application-components.
There are things applications need very often. So why make these over and over again?
Web services can offer application-components like: currency conversion, weather reports, or even language translation as services.
2.      Connect existing software.
Web services can help to solve the interoperability problem by giving different applications a way to link their data.
With Web services you can exchange data between different applications and different platforms.
Why Web Services
  •        A few years ago Web services were not fast enough to be interesting
  •                  Interoperability has Highest Priority
When all major platforms could access the Web using Web browsers, different platforms could interact. For these platforms to work together, Web-applications were developed.
Web-applications are simple applications that run on the web. These are built around the Web browser standards and can be used by any browser on any platform.
  •      Web Services take Web-applications to the Next Level
By using Web services, your application can publish its function or message to the rest of the world. Web services use XML to code and to decode data, and SOAP to transport it (using open protocols). With Web services, your accounting department's Win 2k server's billing system can connect with your IT supplier's UNIX server.

This article is contributed by “Sudhir Patil”. Thank you.

Wednesday, April 13, 2011

Working with FileSystemObject- Part 1

How to get List of subfolder and count of Subfolder

Set fso = CreateObject("Scripting.FileSystemObject")

Set b = fso.GetFolder("C:\TestEnvironments")
Set c = b.SubFolders
foldercount=c.Count
msgbox foldercount
For Each d in c
e=e&d.name&vbnewline
Next
msgbox e

Working with some file system methods

Set f1 = CreateObject("Scripting.FileSystemObject")

Set f2 = f1.GetFile("c:\path.txt")
Filecreatedon = "File was Created on: "&f2.DateCreated
Msgbox Filecreatedon
fileDateLastModified="file path is:" &f2.DateLastModified
Msgbox fileDateLastModified
filetype="File type is:" &f2.Type
Msgbox filetype
filepath="file path is:" &f2.Path
msgbox filepath
filesize="file path is:" &f2.Size
msgbox filesize
'To find the type of file extension from given folder
Set ParentFld = fso.GetFolder ("E:\Trupti")

For Each oFile In ParentFld.files
' msgbox fso.GetExtensionName(oFile.Path )
'to find the extensionname of file
If fso.GetExtensionName(oFile.Path ) = "docx" Or fso.GetExtensionName(oFile.Path ) = "doc" then
txtCount = txtCount + 1
END IF
Next
msgbox "file type is:" &txtCount

QTP-How to get number of controls (Links, Edits, Images, etc) with DP

Hi,

If you want to find the number of links, webedits, images etc controls on the page, then use following.

Function GetAllSpecificControls(Page, MicClass)

Set Desc = Description.Create()
Desc("micclass").Value = MicClass
Set GetAllSpecificControls = Page.ChildObjects(Desc)
End Function

Function GetAllEdits(Page)
Set GetAllEdits = GetAllSpecificControls(Page, "WebEdit")
End Function

Function GetAllButtons(Page)
Set GetAllButtons = GetAllSpecificControls(Page, "WebButton")
End Function

Function GetAllLinks(Page)
Set GetAllLinks = GetAllSpecificControls(Page, "Link")
End Function

Function GetAllImages(Page)
Set GetAllImages = GetAllSpecificControls(Page, "Image")
End Function

Set oPage = Browser("Google Sets").Page("Google Sets")

MsgBox "Number of Edits: " & GetAllEdits(oPage).Count
MsgBox "Number of Buttons: " & GetAllButtons(oPage).Count
MsgBox "Number of Links: " & GetAllLinks(oPage).Count
MsgBox "Number of Images: " & GetAllImages(oPage).Count

Monday, April 11, 2011

About Normalization

What is Normalization?
Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

First Normal Form (1NF)
First normal form (1NF) sets the very basic rules for an organized database:
  • Eliminate duplicative columns from the same table.
  • Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).  
Second Normal Form (2NF)
Second normal form (2NF) further addresses the concept of removing duplicative data:
  • Meet all the requirements of the first normal form.
  • Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
  • Create relationships between these new tables and their predecessors through the use of foreign keys.  
Third Normal Form (3NF)
The rules of 3NF are mentioned here
  • Make a separate table for each set of related attributes, and give each table a primary key.
  • If an attribute depends on only part of a multi-valued key, remove it to a separate table
  • If attributes do not contribute to a description of the key, remove them to a separate table. 
Fourth Normal Form (4NF)
Finally, fourth normal form (4NF) has one additional requirement:
  • Meet all the requirements of the third normal form.
  • A relation is in 4NF if it has no multi-valued dependencies.  
Remember, these normalization guidelines are cumulative. For a database to be in 2NF, it must first fulfill all the criteria of a 1NF database.