Assessment Name: MC0081 Assessment ID: 24112 Question ID ...

bubblemessengerΑσφάλεια

5 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

73 εμφανίσεις

Assessment Name:

MC0081





Assessment ID:

24112





Question ID:

423306





Question Label:

Q19





Question Text:

Explain the different types of Global Directives in ASP.NET and also


write a note
on Start and End Events





Answer Text:

i. Global directives, also known as application directives, provide application
-
wide
instructions to the ASP.NET compilation engine. A Global.asax file supports three
types of global directives (2 marks) ii. The @Application Directive: This directive
serve

two purposes: they enable developers to add descriptive text to applications,
and they facilitate code
-
behind programming in Global.asax files. An @
Application directive accompanied by a Description attribute adds descriptive text,
as in <%@Application D
escription=”My First ASP.NET Application”%>
ASP.NET ignores Description attributes, so descriptions declared with it are visible
only to those persons with access to your Global.asax files. (2 marks) iii. The @
Import Directive: This directive serve the sa
me purpose in Global.asax that it serves
in ASPX files: it imports namespaces that ASP.NET doesn’t import by default. For
example, lets say you include the following <script> block in Global.asax <script
language=”C# runat=”server”> Void Application_Start(
) { DataSet ds= new
DataSet(); Ds.ReadXml(Server.MapPath(“GlobalData. xml”));
Application{“GlobalData”}=ds; } </script> Because DataSet is defined in the
System.Data namespace and System.Data isn’t imported by default, you must either
fully qualify all ref
erences to DataSet by including the namespace or place the
following directive at the top of Global.asax; <%@ Import
Namespace=”System.Data”%> @ Import directives in Global.asax pertain only to
code in Global.asax. they do not import namespaces into other
of the application’s
files. (2 marks) iv. The @ Assembly Directive: This directive does for Global.asax
what @ Assembly does for ASPX files: it identifies assemblies Global.asax uses
that ASP.NET doesn’t link by default. Suppose your Global.asax file uses
classes in
the System.DirectoryServices namespace, you need to include the following
statements in Global.asax <%@ Import Namespace
=”System.DirectoryServices”%> <%@ Assembly
Name=””System.DirectoryServices”%> If you don’t, ASP.NET will greet you with
an e
rror message the moment the application starts up (2 marks) v. Start and Events:
ASP.NET fires global events named Start and End when an application starts and
stops. To process these events,include handlers named Application_Start and
Application_End in G
lobal.asax (2 marks)





Score:

10.00

Assessment Name:

MC0081





Assessment ID:

24112





Question ID:

423307





Question Label:

Q20





Question Text:

Explain briefly Session State and Application State in ASP.NET? Explain the
importa
nt considerations for Application State





Answer Text:

i. Session State : ASP.NET session state enables you to store and retrieve values for
a user as the user navigates the different ASP.NET pages that make up a Web
application. HTTP is a stateless p
rotocol. Building Web applications that need to
maintain some cross
-
request state information can be a challenge. ASP.NET session
state identifies requests received from the same browser during a limited period of
time as session, and provides the ability
to persist variable values for the duration of
that session. ASP.NET session state is enabled by default for all ASP.NET
applications. (3 marks) ii. Application State: Application state is a data repository
available to all classes in an ASP.NET applicatio
n. Application state is stored in
memory on the server and is faster than storing and retrieving information in a
database. Unlike session state, which is specific to a single user session, application
state applies to all users and all sessions. Therefore
, application state is a useful
place to store small amounts of often
-
used data that does not change from one user
to another.(3 marks) iii. Application State Considerations a. Resources: because it is
stored in memory, application state is very fats compa
red to saving data to disk or a
database. However, storing large blocks of data in application state can fill up server
memory, causing the server to page memory to disk. (1 mark) b. Volatility: as the
application state is stored in server memory, it is lo
st whenever the application is
stopped or restarted. (1 mark) c Scalability: application state is not shared among
multiple servers serving the same application, as in a Web form, or among multiple
worker processes serving the same application on the same
server, as in a Web
garden. If your application runs in a multi
-
processor or multi
-
server environments,
consider using a more scalable option, such as a database, for data that must
preserve fidelity across the application (1 mark) d. Concurrency: Applicat
ion state is
free
-
threaded, which means that application state data can be accessed
simultaneously by many threads. Therefore, it is important to ensure that when you
update application state data, you do so in a thread
-
safe manner by including built
-
in sy
nchronization support. (1 mark)





Score:

10.00

Assessment Name:

MC0081





Assessment ID:

24112





Question ID:

423308





Question Label:

Q21





Question Text:

a) What do you mean by Web Service?

b) write short notes on

i) WSDL

ii)

DISCO

iii) UDDI

iv) SOAP







Answer Text:

i. Web service is an application that : Runs on a Web server Exposes Web methods
to interested callers Listens for HTTP requests representing commands to invoke
Web methods Executes Web methods and returns th
e results (2 marks) ii. The Web
Services Description Language (WSDL) WSDL is a relatively new standard. It’s an
XML vocabulary devised by IBM, Microsoft and others. It describes the interface to
Web Services, including the data formats. Its syntax is docum
ented at
http://www.w3.org/TR/wsdl. WSDL is a language for machines, not humans.(2
marks) iii. DISCO: the DISCO, is short for “discovery”, protocol is simple one that
revolves around XML
-
based DISCO files. It is a file
-
based mechanism for local
Web service

discovery

that is, for getting a list of available Web services from
DISCO files deployed on Web servers. (2 marks) iv. UDDI: UDDI is an
abbreviation for Universal Description, Discovery and Integration. It is jointly
developed by IBM, Microsoft, and Ari
ba and supported by hundreds of other
companies. UDDI is a specification for building distributed databases that enable
interested parties to “discover” each other’s Web services. No one company owns
the databases; any one is free to publish a UDDI
-
based b
usiness registry. UDDI
sites are themselves Web services. (2 marks) v. SOAP: it is Simple Object Access
Protocol, an XML based protocol for sending and receiving data to and from a Web
Service. InfoPath communicates with Web Services using SOAP. SOAP messa
ges
are well
-
formed XML documents. InfoPath sends the SOAP message to the Web
Service using HTTP. (2 marks)





Score:

10.00

Assessment Name:

MC0081





Assessment ID:

24112





Question ID:

423309





Question Label:

Q22





Question Tex
t:

a) Write the Goals of Cryptography and also explain Secret
-
Key & Public
-
Key
Encryption.

b) Write a note on ASP.NET membership





Answer Text:

i. Cryptographic Goals : Cryptography is used to achieve the following goals a.
Confidentiality : to help

protect a user’s identity or data from being read b. Data
integrity : To help protect data from being changed c. Authentication: to ensure that
data originates from a particular party. (2 marks) ii. Secret
-
Key Encryption: this
algorithms use a single secr
et key to encrypt and decrypt data. This is also referred
to as symmetric encryption because the same key is used for encryption and
decryption. Secret Key algorithms are very fast (compared with public
-
key
algorithms) and are well suited for performing cr
yptographic transformation on
large streams of data. (2 marks) iii. Public
-
Key Encryption: This encryption uses a
private key that must be kept secret from unauthorized users and a public key that
can be made public to anyone. The public key and private ke
ys are mathematically
linked; data that is encrypted with the public key can be decrypted only with the
private key, and data that is signed with the private key can be verified only with the
public key. The public key can be made available to anyone; it i
s used for
encrypting data to be sent to the keeper of the private key. This algorithm is also
known as asymmetric algorithm because one key is required to encrypt data, and
another key is required to decrypt data. both keys should be unique for each
commu
nication session. Asymmetric keys are generally long
-
lived. (2marks) iv.
ASP.NET membership: this gives you a built
-
in way to validate and store user
credentials. ASP.NET membership therefore helps you manage user authentication
in your Websites. You can u
se ASP.NET membership with ASP.NET Forms
authentication or with ASP.NET login controls to create a complete system for
authenticating users. (1 mark) ASP.NET membership supports facilities for : i.
Creating new users and passwords ii. Storing membership in
formation in Microsoft
SQL server, Active Directory, or an alternative data store iii. Authenticating users
who visit your site. You can authenticate users programmatically, or you can use the
ASP.NET login controls to create a complete authentication syst
em that requires
little or no code iv. Managing passwords, which includes creating, changing, and
resetting them v. Exposing a unique identification for authenticated users that you
can use in your own applications and that also integrates with ASP.NET
per
sonalization and role
-
management systems. vi. Specifying a membership
provider (3 marks)





Score:

10.00