Week-12

=Week-12=

Describe the three ways to deploy an ASP.NET application.
We can deploy ASP.NET Application in 3 different ways The choice of best deployment alternative depends upon particular need of each application. Xcopy deployment is the easiest, and it is often used during development to create copies of an application in different servers for testing purpose. For small application xcopy deployment may be the best choice. Precompiled deployment has several advantages over XCopy deployment. Eg. Precompiled deployment is always gives better performance for the first users of the site at the same time it is more secure as we don’t need to copy our source code files on to server. If our application deployed on one or few servers then precompiled deployment is usually best choice. When we are going to deploy our application on number of servers then creating a setup program is a very handy tool. Although creating this setup program is much tedious and involves considerable working, the deployment from this setup program becomes very easier. Describe two advantages of precompiling a web site before deploying it. More Details
 * 1) xCopy Deployment
 * 2) Precompiled Deployment
 * 3) Web Setup Project

What are Web services?
Web services are software components that communicate using pervasive, standards-based Web technologies including HTTP and XML-based messaging. Web services are designed to be accessed by other applications and vary in complexity from simple operations, such as checking a banking account balance online, to complex processes running CRM (customer relationship management) or enterprise resource planning (ERP) systems. Since they are based on open standards such as HTTP and XML-based protocols including SOAP and WSDL, Web services are hardware, programming language, and operating system independent. This means that applications written in different programming languages and running on different platforms can seamlessly exchange data over intranets or the Internet using Web services.

Describe the benefits of creating and using web services.

 * Benefits of using Web Services**
 * 1) **Exposing the function on to network**: A Web service is a unit of managed code that can be remotely invoked using HTTP, that is, it can be activated using HTTP requests. So, Web Services allows you to expose the functionality of your existing code over the network. Once it is exposed on the network, other application can use the functionality of your program.
 * 2) **Connecting Different Applications**: Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services. For example VB or .NET application can talk to java web services and vice versa. So, Web services is used to make the application platform and technology independent.
 * 3) **Standardized Protocol**: Web Services uses standardized industry standard protocol for the communication. All the four layers (Service Transport, XML Messaging, Service Description and Service Discovery layers) uses the well defined protocol in the Web Services protocol stack. This standardization of protocol stack gives the business many advantages like wide range of choices, reduction in the cost due to competition and increase in the quality.
 * 4) Low Cost of communication: Web Services uses SOAP over HTTP protocol for the communication, so you can use your existing low cost internet for implementing Web Services. This solution is much less costly compared to proprietary solutions like EDI/B2B.
 * 5) **Support for Other communication means**: Beside SOAP over HTTP, Web Services can also be implemented on other reliable transport mechanisms. So, it gives flexibility use the communication means of your requirement and choice. For example Web Services can also be implemented using ftp protocol (Web services over FTP).
 * 6) **Loosely Coupled Applications**: Web Services are self-describing software modules which encapsulates discrete functionality. Web Services are accessible via standard Internet communication protocols like XML and SOAP. These Web Services can be developed in any technologies (like c++, Java, .NET, PHP, Perl etc.) and any application or Web Services can access these services. So, the Web Services are loosely coupled application and can be used by applications developed in any technologies. For example, I have heard of people developing Web Services using Java technologies and using the Web Services in VB or .NET applications.
 * 7) **Web Services Sharing**: These days due to complexness of the business, organizations are using different technologies like EAI, EDI, B2B, Portals etc. for distributing computing. Web Services supports all these technologies, thus helping the business to use existing investments in other technologies.
 * 8) **Web Services are Self Describing**: Web Services are self describing applications, which reduces the software development time. This helps the other business partners to quickly develop application and start doing business. This helps business to save time and money by cutting development time.
 * 9) **Automatic Discovery**: Web Services automatic discovery mechanism helps the business to easy find the Service Providers. This also helps your customer to find your services easily. With the help of Web Services your business can also increase revenue by exposing their own Web Services available to others.

Describe the way that XML facilitates the use of web services.
Web services are powered by XML and three other core technologies: WSDL, SOAP, and UDDI. Before building a Web service, its developers create its definition in the form of a WSDL document that describes the service's location on the Web and the functionality the service provides. Information about the service may then be entered in a UDDI registry, which allows Web service consumers to search for and locate the services they need. This step is optional but is beneficial when a company wants its Web services to be discovered by internal and/or external service consumers. Based on information in the UDDI registry, the Web services client developer uses instructions in the WSDL to construct SOAP messages for exchanging data with the service over HTTP.

Describe the use of the WebService and WebMethod attributes.
A WSDL file is an XML document that describes a Web service using six main elements:
 * 1) Port type – groups and describes the operations performed by the service through the defined interface.
 * 2) Port – specifies an address for a binding, i.e., defines a communication port.
 * 3) Message – describes the names and format of the messages supported by the service.
 * 4) Types – defines the data types (as defined in an XML Schema) used by the service for sending messages between the client and server.
 * 5) Binding – defines the communication protocols supported by the operations provided by the service.
 * 6) Service – specifies the address (URL) for accessing the service.

SOAP messages are XML documents that contain some or all of the following elements:
 * 1) Envelope – specifies that the XML document is a SOAP message; encloses the message itself.
 * 2) Header (optional) – contains information relevant to the message, e.g., the date the message was sent, authentication data, etc.
 * 3) Body – includes the message payload.
 * 4) Fault (optional) – carries information about a client or server error within a SOAP message.