ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Capitulo 1 - Resumen Libro Examen 70-515: Web Applications Development With Microsoft .NET Framework 4

Hernaldog24 de Mayo de 2013

4.679 Palabras (19 Páginas)1.134 Visitas

Página 1 de 19

Capitulo 1: Intrucción a ASP.NET

Lección 1: Entender Cominicaciones Web

- Modelo Cliente/Servidor:

- Cliente: conocido como "interface front-end", el navegador presenta una interfaz, acepta input del user, y envia datos al servidor para ser procesado.

- Servidor: conocido como "back-end" procesa y responde los request de clientes de cada página, responde con una página html con instrucciones de como generar una interfaz.

- Tanto el browser (cliente) y servidor Web se comunican con un protocolo Hypertext Transfer Protocol (HTTP)

- es un protocolo tipo texto

- asignado al puerto TCP 80 (hay protocolos TCP y UPD)

- si el servidor tiene un certificado, el cliente y el servidor usan HTTP seguro (HTTPS) para autentificar el servidor y encriptar las cominicaciones.

- HTTPS se le asigna por defecto el puerto TCP 443.

- Error 404 error de servidor cuando uno pide una pag. pero el servidor existe: www.wikipedia.org/x, en cambio si se pide un página www.xcc.cl, el error es del browser

- Pasos de la comunicación:

1. Un usuario entra una dirección en el navegador como http://www.microsoft.com/

2. El servidor se conecta usando HTTP y envía un requesto por el comando "GET", algo como GET / (para pedir la página raiz), al servidor web.

3. El servidor web procesa la página solicitada. Esta acción hace que el servidor retorne una página HTML estática o ímagenes, o puede ejecutar código ASP.Net que se conecte con alguna BD.

4. El servidor web usa HTTP para enviar la respuesta de vuelta al navegador web. Si el Request se proces  ok, el servidor retorna al navegador el estado HTTP 200 junto con el documento HTML.

Si el servidor web no encuentra la página, retorna el código de error 404. Si el usuario solicita una página no existente (outdated) o que se movi , el servidor retorna el código 302

y el nuevo URL así el navegador puede acceder a la página correcta. Esto es conocido como "redirección". Muchas otras respuestas son posibles dependiendo de cada caso. Si la página es incorrecta

el proxy retorna error 502 Host Not Found

5. El navegador del usuario procesa la respuesta del server mostrando la página HTML (si el código fue 200), mostrando mensaje de error (si el código fue 404),

o cargando un página diferente (si el código fue 302). Otras respuestas de servidores son parecidas a las manejadas por el navegador, dependiendo de la respuesta.

Este proceso se repite cada vez que se hace click en un botón o link.

- Rol del Servidor:

1. Verificar que el request tiene una estructura ok.

2. Autenticarse a si mismo. Si el servidor tiene un certificado Secure Sockets Layer (SSL) y el request está con HTTPS, el navegador usa el certificado para autenticar el

servidor. El web server encripará todo el contenido antes de retornarla al navegador.

3. Autentifica al usuario. Si el contenido requiere autorización, el web server verifica que el usuario a ingresado las credenciales. Si el usuario no ha sido auntentificado,

el servidor web redirige al usuario a un formulario de autentificación.

4. Autorizar al usuario. After the Web server authenticates the user, the web server verifies

that the user is allowed to access the requested content.

5. Determinar como manejar un request. Si el navegador solicita contenido "estatico" o si simplemente puede usar algún contenido de cache, el navegador puede responder directamente.

If the web browser requested an ASP.NET page, the web server must

forward the request to ASP.NET.

6. Manejar errores. If a server cannot process the user’s request, it provides error information to the web browser.

7. Cache de salida. Web servers can cache output to improve the response time of subsequent requests. Web servers also provide caching information to web browsers, so

browsers know how long to keep content cached.

8. Comprimir la salida. Before returning a page to a web browser, a web server can compress the content to reduce the bandwidth required.

9. Acceso a Log. Web servers typically record usage information for security and performance-monitoring purposes.

- Rol del Web Browser

1. Enviar request al web server. If the user enters http://www.microsoft.com

the web browser resolves the www.microsoft.com Domain Name System (DNS) address,

uses HTTP to connect to the server, and requests a page.

2. Autentifica al servidor. If the server has an SSL certificate and the request was

made with HTTPS, the web browser uses the certificate to authenticate the server and

then decrypt future communications.

3. Procesa la respuesta. If the server has provided HTML, the browser retrieves embedded

objects, such as images, videos, or animations referenced in the HTML. If the server

has provided an error, redirection, or other response, the browser responds appropriately.

4. Muestra HTML y objetos embebidos. Web browsers use HTML standards to determine

how to display a webpage to the user. Because HTML can contain embedded objects,

a web browser might have to display dozens of objects to render a single webpage.

5. Ejecuta scripts en el cliente. JS

- Entender el Rol HTTP: el browser envía al server

GET /default.aspx HTTP/1.1 // Get /URI de pagina HTTP v 1.1

Host: www.northwindtraders.com // host

- HTTP soporta más comandos, si está habilitado Distributed Authoring and Versioning (DAV) como Lock o Unlock.

- "GET" solicita un objeto, como Gets an object, such as a webpage, from the server. A GET request

for a specific URL (Uniform Resource Locator) retrieves the resource.

For example, GET /test.htm retrieves the test.htm resource (typically

a static file, but it could be generated dynamically).

- "POST" Envía datos al servidor para ser procesado. This is typically what

happens when users enter data on a form and submit that data as

part of their request, but it has other meanings when used outside

the bounds of HTML forms.

- HEAD Obtiene información general de un objeto sin bajar la página completa. Se usa para verificar que el recurso no haya cambiado desde que el navegador lo cachea.

OPTIONS Used by client applications to request a list of all supported commands.

You can use OPTIONS to check to see if a server allows a particular

command, thus avoiding wasting network bandwidth trying to send

an unsupported request.

- PUT Allows a client to directly create a resource at the indicated URL on

the server. If the user has permission, the server takes the body of the

request, creates the file specified in the URL, and copies the received

data to the newly created file.

- DELETE Deletes a resource on the web server if the user has permission.

- TRACE Used for testing or diagnostics; allows the client to see what is being

received at the other end of the request chain.

- CONNECT Reserved for use with a proxy that can dynamically switch to being a

tunnel, such as with the SSL protocol.

- DEBUG Starts ASP.NET debugging. This command informs Visual Studio of the

process to which the debugger will attach.

- La comunicación entre el navegador y el servidor se llama "request".

- En .Net hay un objeto Request que representa dicho request, permitiendo acceso a las cookies, parametros query string que van con la URL, la ruta del objeto que se solicita.

- La comunicación entre el servidor y en navegador se llama "response".

- En .Net existe el objeto Response que permite setear cookies, definir cache, setear expiración de la página y más.

- Esta es una respuesta de ejemplo que recibe el browser:

HTTP/1.1 200 OK // version de HTTP código 200 y el mensaje

Server: Microsoft-IIS/6.0 // tipo de Web Server

Content-Type: text/html // tipo de contenido a ser enviado al navegador - archivo HTML en formato texto.

// Formato MIME (multipurpose internet mail extensions) es de 2 partes, la primera es el tipo de recurso (en el ej. text), 2da parte subtipo de recurso (en el ej. html)

Content-Length: 38 // largo del contenido en octets (bytes) 38 bytes

<html><body>Hello, world.</body><html> // mensaje que debe interpretar el navegador

- Tipos MIME típicos:

text - Textual information. Subtypes include plain, html, and xml.

image - Image data. Subtypes are defined for two widely used image formats, jpeg and gif, and other subtypes exist as well.

audio - Audio data. Requires an audio output device (such as a speaker or headphones) for the contents to be heard. An initial subtype, basic, is defined for this type.

video - Video data. The subtype mpeg is often used. Typically, videos are not transferred directly, but are read from an embedded object, such as a JavaScript or Adobe Flash object.

application - Any binary data. The subtype octet-stream is typically used.

- códigos de respuesta

1xx Informational: The request was received, and the server is continuing to

...

Descargar como (para miembros actualizados) txt (32 Kb)
Leer 18 páginas más »
Disponible sólo en Clubensayos.com