It was a great day,My three months of hard work has paid off,at last.
I used Microsoft pubs 70-536 as guide to exam.It covers most of the chapters except the concept of GDI+ programing. The syllabus published in microsoft site was my second guide and I kept on searching the key works in google.
Any way prepration of C# 2.0 from Illustrated C# 2005,Accelarated C#2005,programming C# by Sells was great from Generics and Streams.
The books on Crytography and security has helped me a lot.
The measure UP prepartion with trancender was excellent choice.
My expecience with MCAD has helped me great ways,to get away with diffucult questions.
All done..It was excellent experience and to end a year in wonderful note...
Saturday, December 15, 2007
Sunday, October 7, 2007
Passed MCAD :-)
It was on Sept end that my great hard work has paid of. I was slogging from january onwards for this exam.
I had prepared with Amit Kalani books.Those were the great books. But still to get overall idea of exams. I needed to take pratice test either from measure Up or Transcender.
The toughest exam was on XML webservice and easiest was ASP.NET.
Now my aim is to get an MCPD. There are no materials avaliable for prepartions for upgrade exams.Hence, I have choosen the path of MCTS ->MCPD. Those are challanging path.
I had prepared with Amit Kalani books.Those were the great books. But still to get overall idea of exams. I needed to take pratice test either from measure Up or Transcender.
The toughest exam was on XML webservice and easiest was ASP.NET.
Now my aim is to get an MCPD. There are no materials avaliable for prepartions for upgrade exams.Hence, I have choosen the path of MCTS ->MCPD. Those are challanging path.
Saturday, April 28, 2007
MCAD 70-320 Notes Imp Questions
MS- Exam 70-320 (Notes). 5
Topic 1 - .NET Remoting. 5
Basics : 5
Q- What is application domain? What are the advantages?. 5
Q- What is .NET Remoting?. 5
Q- What is marshaling? And what are the two way with there disadvantages?. 5
Q- What are the channels? What are different types? What are the pros and cons of each?. 6
Q- What are various types of formatter available? Compare it with channels, using efficiency and interoperability scale? 6
Q -What are the different activation methods? When they are desired? Compare it with scale of Flexibility and Scalability? 6
Q - Explain concept of Lease time? What are the different attributes?. 7
Q- Explain the Steps in client and server for SAO remote object working?. 7
Q- Explain the Steps in client and server for CAO remote object working?. 8
Remoting with .config : 9
Q- What is the Steps to be followed?. 9
Q- What are the major option in configuration file ?. 10
Q- What are the major options in under tag of Configuration file?. 10
Q- What are the major attribute of with explanation?. 10
Q- What are major attribute of with explanation?. 10
Q-. What are the element and there attributes of with explanation?. 11
Remoting -Using SoapSuds. 11
Q-What are the steps ?. 11
Q-How to generate Wrapped Proxy?. 11
Q- How to generate Non Wrapped Proxy?. 12
Topic-2 .NET Security. 13
Basics: 13
Q- What are the two type of security in .NET?. 13
Q- What is Code Access Security and Role based Security?. 13
Code Access Security: 13
Q- What is Evidence, Security policy and permissions?. 13
Q-What are the types of Evidence?. 13
Q-What is Minimum Permission, optimal (optional) permission, Refusing permission?. 13
Q-What is Code access Permissions?. 14
Q- What is Identity permission?. 14
Q-What is Stack Walk and how we can override the default stack walk?. 14
Q- Type of security policy? What are the key elements of each of them?. 14
Q-What is the membership conditions (set of Evidences) for code group?. 15
Q What are the Permissions that are available?. 15
Q- How the permissions are calculated?. 15
Q- What is Exclusive permission and Level final permission?. 16
Role Based Security. 16
Q What is Authentication and Authorization?. 16
Q- What are various ways for Authentication in IIS and ASP.NET?. 16
Q What is impersonation?. 17
Q-Can we give authorization via Web.Config ?. 17
Topic3-Enterprise Services (COM+) 18
Basics. 18
Q- What are the services provided by COM+ ?. 18
Q –What are the steps to create enterprise service component ?. 18
Q- What are the type of Applications the COM+ has ? What are the factors that will influence our decision? 18
Q- What are the different types of registration possible for COM+ objects? What are pros and cons of each of them? 19
Q-What ClassInterface Attribute? What are different ClassInterfaceType values that can be set? Explain there significance? 19
Q Why ClassInterface (ClassInterfaceType.None) is recommended ?. 20
Q – How to use enterprise components?. 20
Q – What are the various methods of Service Component Class?. 20
Q- What are the class attribute of Service component 20
Q –What is context? What is light weight proxy?. 22
Q –What do you mean by instance mgmt? What are the option for instance Mgmt in Com+?. 22
Object Pooling. 22
Q-What is object pooling? What are different attribute in .NET?. 22
Q –What are the Requirements or Restriction on Pooling?. 22
Q –What is method that has to be overloaded for object pool?. 23
Just in Time Activation (JITA) 23
Q- What is JITA (Just in Time Activation)? What is the attribute that needs to be added? What are the methods that have to be overloaded?. 23
Q- What is are different ways of Deactivating or disposing the object in JITA?. 23
Q – If the JITA is not set from Component Catalog, What will happen to [AutoComplete] Statement, ContextUtil.DeactiveOnReturn?. 23
Q –What is idle time management?. 23
Q – What is an Apartment? What are there different types?. 23
Transaction. 24
Q – What is Transaction? And what is ACID principle?. 24
Q – What are resource managers?. 24
Q – What is Transaction Root? What is Two-phase Commit process?. 24
Q –What is DTC (Distributed Transaction coordinator)?. 24
Q –What are the different attribute of Transaction, with meaning?. 25
Q –What are DONE, CONSISTENT, ABORT bit? Explain there working?. 25
Q – What are the ContextUtil method that influence the DONE and CONSISTENT bit?. 25
Q- What are the Granulites in which COM+ Component can participate in Security?. 25
Q What is the master control switch? What is different level of Authentication? What is different level of Impersonation? 25
Topic 4 -Using COM Component from NET.. 26
Q – How COM Components can be used by .NET?. 26
Q – What PInvoke ,how it is used ?. 26
Topic 5-Deployment. 26
Private Assemblies Deployment. 26
Q – What are the different ways in which private assemblies can be deployed? What are various ways to find out dependences of application?. 26
Q- What is probing? What is binding? How does CLR probe the application dependencies?. 27
Q – What are the ways to set the Probing path inn .NET?. 27
Q- How will you diagnose for failure of probing?. 27
Deploying Shared Assemblies. 27
Q What is strong name? How it is generated? What is the process of verification used by CLR?. 27
Q- How shared assembly be added to GAC ?. 28
Q What is the binding policy for Shared assembly ?. 28
Q – Explain Side by Side Execution scenario ? Explain how to configure these ?. 28
Q – What is delay signing in Assembly? How it is done?. 29
Topic 5-WebService in .NET.. 29
Q –What are the Technologies that web service depends?. 29
SOAP. 29
Q – What is SOAP? What are the basic building blocks?. 29
Q – Explain Soap functionality? What is ‘mustUnderstand’ Attribute? What is ‘actor’ attribute ? 30
Q –What is Soap Body Element used for? What are the categories of Soap binding and use style Messages ? 30
Q – What are RPC and Document messages? What are encoding and literal?. 31
Q –What is element? What are important fault codes?. 31
Q- What is Soap Encoding ? What encodingStyle attribute ?. 31
Web Service Description Language (WSDL) 31
Q What is WSDL ? What is Syntax of typical WSDL file?. 31
Q – What is Extensible element ?. 32
Web Service In ASP.NET. 33
Q What are the ways in which web service can be created ? what is [WebMethod] ?. 33
Q- What are the various attributes of [WebMethod] ? What are various attribute of [WebService] ? 33
Q – What are the protocol binding that ASP.NET Web service to HTTP are Provided ? What are the advantage/disadvantage of POST and GET over SOAP? How the value can be set?. 33
Q –What are the type of soap Exception that can be raised ?. 34
Q-What are the different encoding styles can be configured at Class level provided by .NET ? What are different attributes that can be manipulated ?. 34
Q-What are the different encoding styles can be configured at Method level provided by .NET ? What are different attributes that can be manipulated?. 35
Q What are three Main issues with ref type passing in WebMethod ?. 35
Q – What are the different types of session state ? how they are configured? What are the different attributes of sessionState element?. 36
Q- What are Application State ? how to avoid race condition while updating Application State?. 36
Q –What are Soap Headers ? How it is invoked client side ?explain server and client interface?. 36
Q- What is the Required and Mustundestand in Soap Header?. 37
Q – What is SoapHeaderDirection attribute?. 37
Q What is Soap Extensions? What the Steps to be followed ?. 38
Q- What is the Sequence of method called by the Webservice in connection with Soap Extension?. 39
Q What is WSDL.exe utility? What are the major options available?. 39
Topic-5 NET & XML Manipulation. 40
XMLReader Class: 40
Q What is Push parser and Pull parser ? What is an XmlReader class ? What are the different type of XmlReader Class? 40
Q How the attribute & element and distinguished ? what is normalization ? How exception can be caught ? 40
Q What are the Important properties and method of XmlReader ?. 40
XMLWriter. 41
Q What are XMlWriter ? What are the important attributes and methods ?. 41
Q- What are the various limitations of XmlWriter ?. 42
XmlDocument. 42
Q- What are XmlDocument class? Explain its different properties and methods?. 42
Q-What is XmlNode Class ? What are various attributes and Method?. 42
XPath and XNavigation. 43
Q- What is XPath? How various expression are given in XPath?. 43
Using SQL Server to generate XML. 44
Windows Services. 45
Basics : 45
Q –What is windows service ? What are there general characteristics ?. 45
Q – Explain the Architecture of Windows Service ?. 45
Q- What are the various Windows services support class that is provided in FCL (framework class library) ? 46
Q –What are the main properties and method of ServiceBase Class?. 46
Q –What are important Classes that helps in installing WS ?. 47
Q- What are the important properties of ServiceProcessInstaller and ServiceInstaller Class?. 47
Q What are the Ways to monitor the WS ?. 47
Q What are the different utility for WS ?. 47
Q – Explain ServiceController class with various properties and methods ?. 48
Tracing and Debugging. 49
Tracing and Debugging. 49
Debugging. 50
MS- Exam 70-320 (Notes)
Topic 1 - .NET Remoting
Basics :
Q- What is application domain? What are the advantages?
In MANAGED execution it is the smallest unit of separation. It is in-built feature of a managed code to have type safety (i.e. program does not call program elements beyond its boundary).
Advantage –
It is light weight i.e. to create, monitor and maintain the application is less tedious than process boundary.
Q- What is .NET Remoting?
It is way in which application talk between Appdomains objects. The Appdomains can be with in same network or may be different.
Q- What is marshaling? And what are the two way with there disadvantages?
It is technique of packaging and sending the objects across the Appdomains.
There are two types:
Marshaling by Value(MBV ) Object -
The value of the object is transferred across the Appdomains i.e. actual copy of the objects is re-created at Appdomains. This technique involves Serializing and then de-serializing the objects.
Disadvantage
- Large objects transfer takes time
- The objects runs at client environment hence advantage of server resource is absent.
Marshaling by reference (MBR) object -
The proxy (ObjRef) is transferred to Appdomains; the ObjRef contains IPAddress and the method signature of the calling object. This proxy is used
by the client to reference the method call at server.
Disadvantage-
- Network round trip is increased.
Q- What are the channels? What are different types? What are the pros and cons of each?
In order to communicate between two Appdomains, the channels are used which are unique (port) and specific type (HTTP/TCP).
There are two types:
- HTTP
- TCP
The Pro's and Con's are as follows –
Scope - HTTP via I-NET as wide scope. There are no firewall hindrances.
TCP does not have wide scope .Always restricted because of firewall.
Efficiency -HTTP is bulky with Soap (string), hence less efficient.
TCP is light with stream (binary), hence more robust.
Security-
More - IIS is used for Security.
Less - should use custom security.
Q- What are various types of formatter available? Compare it with channels, using efficiency and interoperability scale?
There are Binary and Soap formatter.
The combinations are:
Channels
Formatter
Efficiency
Interoperability
TCP
Binary
Highest
Lowest
TCP
Soap
High
Lower
HTTP
Binary
Lower
High
HTTP
Soap
Lowest
Highest
Q -What are the different activation methods? When they are desired? Compare it with scale of Flexibility and Scalability?
There are two activation methods –
Server Activated Objects (SAO)-
These are objects whose life time is controlled by server. They are further
Classified as -
Single call Activated objects
Each server method call creates new object in server, the method is executed and then destroyed. These are Stateless objects.
Desirability:
- The overhead of creating the object is not significant.
- State of the object across method is not important.
- The Server needs to support large number of stateless requests.
- The load balancing needs to be achieved (i.e. a technique in which requests are distributed among many servers).
Singleton Objects
There is only one object created for all the method calls. The object lives in the server for its lifetime period.
Desirability:
- There are several clients needing previous state of object.
- The overhead associated with creation of object is substantial.
Client Activated Objects (CAO)
These are the objects whose lifetimes are controlled by client.
Desirability:
- Client want to maintain a private sesion with remote object
Note :
The Single call Server has maximum Scalability (they can be put in different servers.
The CAO has maximum flexiblity has lifetime is controlled by client.
Q - Explain concept of Lease time? What are the different attributes?
It is a time in server for which remote object will remain alive. After that the garbage collector will remove that object.
Attributes:
CurrentLeaseTime = Amount of lease time remaining. (Read-only)
InitialLeaseTime = Initial lease time
RenewOnCall = Amount of time added to CurrentLeaseTime.
SponsorShipTime = Amount of time to wait for any sponsors.
(ILease) is the interface.
Q- Explain the Steps in client and server for SAO remote object working?
At Server side:
1. Create a Remote Class
- Derived as MarshallByObject and ISerialize or MarshallByRef generate a DLL.
2. Create the Server
- Add reference to remote class i.e. DLL and System.Runtime.Remoting.
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
Using
- Create channel (TCPChannel/HTTPChannel) with port.
- Register the channel (use ChannelService.RegisterChannel(channel)).
- Call RemotingConfiguration.RegisterWellknowType(typeof
(),Objecturi,WellKnownobject.Singleton/SingleCall).
At Client Side :
- Add reference to remote class and System.Runtime.Remoting assembly
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
using
- Create HttpClientChannel or TcpClientChannel
- ChannelService.RegisterChannel(channel)
- RemoteConfiguration.RegiasterWellKnownClientType(typeof(),url)
OR
- Activator.GetObject(typeof(remote class),url)
Q- Explain the Steps in client and server for CAO remote object working?
At Server Side:
1. Create a Remote Class
- Derived as MarshallByObject and ISerialize or MarshallByRef generate a DLL.
2. Create the Server
- Add reference to remote class i.e. DLL and System.Runtime.Remoting.
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
Using
- Create channel (TCPChannel/HTTPChannel) with port.
- Register the channel (use ChannelService.RegisterChannel(channel)).
- Call RemotingConfiguration.RegisterActivatedServiceType(typeof
()).
At Client Side :
- Add reference to remote class and System.Runtime.Remoting assembly
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
using
- Create HttpClientChannel or TcpClientChannel
- ChannelService.RegisterChannel(channel)
- RemoteConfiguration.RegiasterActivatedClientType(typeof(),”url”)
url : or //localhost:
OR
- Activator.GetObject(typeof(remote class),url):
Remoting with .config :
Q- What is the Steps to be followed?
At server :
- RemotingConfiguration.Configure("server.exe.config")
- The 'server.exe.config' is an xml file and stored in Debug/bin using VS.NET.
- Content of ‘server.exe.config’
"/>
At client :
- Generate the .cs or the DLL from soapsuds (use Server DLL)
- Reference these through Add Reference
- Add line RemotingConfiguration.Configure("client.exe.config")
- Create the instance of server class with 'new'
- The ’client.exe.config’ configuration file and place in bin/debug folder of VS.NET
- Content of the file
url= />
Q- What are the major option in configuration file ?
, , ,
i.e.
Q- What are the major options in under tag of Configuration file?
,,, (LCSC for short)
Q- What are the major attribute of <lifetime> with explanation?
sponsorshipTime="1H"
renewOnCallTime="1M"
leaseManagerPollTime="100H"
/>
H=Hrs,M=Min,MS=millesec S=second and 1H10M is not Possible
leaseTime = Initial time
sponsorshipTime=Wait period for any other object's call
renewOnCallTime=When any method is called add renewOnCallTime to
leaseTime
leaseManagerPollTime = the polling time for the object.
Q- What are major attribute of with explanation?
ref = refrence channel type TCP or HTTP
displayName= only with .NET type frame work configuration
port =server side port number ,can be 0 means server side call backs used
type= id is used the to specify weather it is Namespace etc
Note : there are many more attributes
Q-. What are the element and there attributes of with explanation?
At Server side
,"
objectUri="Url"
displayName="" />
," />
At Client side
,"
url="http /or tcp:/localhost:/ />
," />
Remoting -Using SoapSuds
Q-What are the steps ?
Write the Code for Server
Q-How to generate Wrapped Proxy?
- Run the Server.
- use command at client work place:
soapsuds -url:http://loaclhost/
-oa:.dll
At Client Code:
- Reference.dll
- Use
using
objectClass myObj = new objectClass();
Advantage-
-It is very simple to use.
Disadvantage
- Only Soap Channels.
- No Value type can be passed
Q- How to generate Non Wrapped Proxy?
- Run the Server.
- Use command at client work place:
soapsuds -nowp -url:http://loaclhost/
-oa:.dll
At Client Code
- Reference.dll
- Use
using
- Create Channel .
- Register Channel .
- Use objectClass
myobj=(objectClass) Activator.GetObject(typeof(objectClass),"http://localhost: ,”)
Advantage
-It is very simple to use.
- With Any channels
Disadvantage
- Only code can be seen.
- No Value type can be passed
Topic left
Deployment through IIS
Deployment through Window Services
Security of .NET Remoting
Topic-2 .NET Security
Basics:
Q- What are the two type of security in .NET?
Code Access security and Role based security
Q- What is Code Access Security and Role based Security?
Access to the Code to particular resource and Role to the Resource
Code Access Security:
Q- What is Evidence, Security policy and permissions?
Evidence - It is a set of characteristics (ex. Application directory, Hash code, Strong name, URL, site, zone, publishers) that establishes the identity of assembly.
Permission - It is a set of permission grants to particular resource.
Security policy - A bridge between Evidence and the permission (i.e. the license and the permission).
Q-What are the types of Evidence?
Two types - Host evidence, Assembly evidence
Host Evidence - At runtime it is evaluated (i.e. Application directory, Hash code, Strong name, URL, site, zone, publishers).
Assembly evidence - At build time it is evaluated. (i.e. Custom evidence). It has least priority.
Q-What is Minimum Permission, optimal (optional) permission, Refusing permission?
Minimum permission is the set without which assembly cannot execute (lower limit).
Optional permission - it is favorable (upper limit).
Refusing - Never allowed to gain these set of permission even if it is given by higher level of permission.
Q-What is Code access Permissions?
These are the permission sets that code can enquire for –
Type of Permission
Namespace
Class
Database Permissions
System.Data.Common
System.Data.Odbc
System.Data.SqlClient
DBDataPermission
ODBCPermission
OlePermission
SqlClientPermission
OraclePermission
Log Permission
System.Diagnostics
EventLogPermission
PermormanceCounterPermission
Directory Services
System.Diagnostics
DirectoryServicePermission
Printer Permission
System.Drawing.Printing
PrintingPermission
Network Permission
System.Net
DnsPermission
WebPermission
SocketPermission
System Resource Permission
System.Security.Permission
EnvironmetPermission
FielDialogPermission
FileIOPermission
IsolatedStoragePermission
ReflectionPermission
Q- What is Identity permission?
Permission to take particular resource depending on code credentials.
Q-What is Stack Walk and how we can override the default stack walk?
Override by Assert, Deny, Permit only.
Q- Type of security policy? What are the key elements of each of them?
Security policy is categorized –
Enterprise policy
Machine policy
User policy
Each of security policy has following Key elements-
Code group
Name permission
Fully trusted.
Q-What is the membership conditions (set of Evidences) for code group?
They are –
Application Directory – installation directory is a evidence.
Hash-The Assembly is hashed and that will act as evidence.
Publisher – code signed by particular publisher is a evidence
Site- code from particular i-net domain.
Strong Name- code with specified strong name.
URL- All code with specified URL.
Zone- Code with specific security zone.
Q What are the Permissions that are available?
Nothing – No permission
Execution- Only to run.
Internet- from unknown origin.
Local Internet – Code with in enterprise.
Everything – Everything except to skip permission.
Skipverification – To skip security checks
FullTrust – grant full permission to all resource.
Q- How the permissions are calculated?
Condition
Resultant Permission
Example
My code belongs to more than two code group
Union of two code group
FileDilaogpermission is given to Codegroup1
FileDilaogpermission is not given to Codegroup2
When you do FileDialogPermission.Demand() - Permission is there.
My Code belongs to Enterprise,
Machine,
User levels
Intersection of permission is given
FileDilaogpermission is given to Enterprise
FileDilaogpermission is not given to Machine
When you do FileDialogPermission.Demand() -
Permission is absent.
My code executes different method with different permission
Intersection of permission is given
Q- What is Exclusive permission and Level final permission?
Exclusive permission - On calculating the permission for Code groups, the group having exclusive permissions will have max points. There cannot be more then one Code group in a level with exclusive permission.
Level final - No further calculation of below Level is done when this is set.
Role Based Security
Q What is Authentication and Authorization?
Authentication - To validate the user credentials (may be by name and password) referred to as Authentication.
Authorization - To give access to secured resource for authenticated user is authorization.
Q- What are various ways for Authentication in IIS and ASP.NET?
Authentication through IIS (inetinfo,exe process) :
Anonymous (IUSER_MACHINE):
No Authentication is done (every user has all the rights)
Basic:
Windows User name and password is verified and information is passed through clear text.
Digest:
Windows User name and password is verified and information is passed in cryptic form. It requires that IE 5 or later
Integrated:
Windows user name and password is verified
Authentication through ASP.NET (ASPNET process):
None:
No ASP authentication
Windows:
The Authentication used by IIS is passed to ASP.NET
Forms:
The Authentication is done by user defined Form.
Passport -
The Authentication is download to Microsoft passport (www.passport.net ) via passport SDK installed .
Q What is impersonation?
It is Setup by virtue of which ASP.NET impersonate the IIS assesing user. i.e.
- ASPNET account privilege is used
- ASPNET is replace with IIS Authenticated user
- the username is selected from name
Q-Can we give authorization via Web.Config ?
Yes, using
< users="?">
It is to deny anonymous users.
Topic3-Enterprise Services (COM+)
Basics
Q- What are the services provided by COM+ ?
Central Administration – Use COM+ Catalog to manipulate the COM+ components.
Just in Time Activation-To use object as and when required.
Object pooling – Pool for frequently used objects.
Transactions-Use ACID principle from controlling multiple ,distributed transaction.
Synchronization-Concurrent access of multiple objects.
Security – COM+ Role based security access for authenticating clients.
Queued Components – Asynchronous messaging .
Events – To inform other components about significant events.
Q –What are the steps to create enterprise service component ?
1. Add Class library from VS.NET
2. Define the Configuration information in assemblyinfo.cs
3. Add following
- using system.EnterpriseService (first add Reference through VS.2003)
- then add
[assembly: ApplicationName("Name")]
[assembly: Description("Sample Application for Enterprise Services")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: ApplicationAccessControl(false)]
4. Generate .snk file using sn-k.snk
5 .And then in assemblyinfo.cs add
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../../mykey.snk")]
[assembly: AssemblyKeyName("")]
6. Define interface
7. Create serviced component. derive it from ServicedComponent class
8. Register the component using regsvcs
View it in catalog manager.
Q- What are the type of Applications the COM+ has ? What are the factors that will influence our decision?
There are two types (denoted by [assembly: ApplicationActivation (ActivationOption.xxxx))
· Server Application
The Com+ application runs in its own process (dllhost.exe) and host DLL file.
· Library Application
The Com+ dll is made to run in client process
Factors:
Parameters
Server Application
Library
Performance
Low, Marshalling is involved
High
Fault tolerance
High,Server down will not influence the client.
Low,As client and server are both is same process
Security
High,We can explicitly configure using COM+ Security
Low,Client security features
Support for Com+
High, all feature are supported.
Low,
Object pooling
Queued Component
Security are not Supported
Q- What are the different types of registration possible for COM+ objects? What are pros and cons of each of them?
Dynamic registration
Manual Registration
Advantage
1. In Case of Web App ,XCopy registration is use full
1. It is only way to register in GAC
2. Both COM clients and .NET clients can invoke the COM+ methods
Disadvantage
1. All privilege will not be available ,that will generate error
2. Error can be found only after first go.
1. Requires an addition effort i.e. use regsvcs
Q-What ClassInterface Attribute? What are different ClassInterfaceType values that can be set? Explain there significance?
The CCW (COM Callable Wrapper) automatically generates the interfaces for COM+ clients using ClassInterface Attribute values. These interface method can be seen in COM+ Catalog.
There different types are–[ClassInterface (ClasIntefaceType.XXXX)]
Member Name(value)
Description
AutoDispatch
It is a default value. It will support late binding of interface to COM Client. There is no info in type library.
AutoDual
It will support late as well as early binding of interface. It generates all public elements in type library.
None
It does not generate any interface .In this case an Interface needs to be defined separately. this is recommended.
Q Why ClassInterface (ClassInterfaceType.None) is recommended ?
Problem with AutoDual-There are versioning problem. As AutoDual generates a type information, base class members and DispId depending on the position of Interface. The DispId generated creates the versioning problem has the next version will have different DispId. Hence the problem.
Problem with AutoDispatch- The settings enables only late binding because no DispId is generated. Hence it is limited to Script or interpreted environment (ex. VB 6.0, Javascript)
Due to above mentioned problem it is recommend to have ClassInterfaceType.None and derive the class from I
.
Q – How to use enterprise components?
1 .Add Reference to created object Component (use browse button) in .NET tab.
2. refer to System.EnterpriseService and the object
Q – What are the various methods of Service Component Class?
The class ServicedComponent has some protected methods that can be overridden for use with some of the services. All these methods –
Protected Method
Description
Construct
The method Construct can be overridden to get an object initialization string at object creation. The default construction string can be specified with the attribute [Construction-Enabled].
Activate
Deactivate
CanBePooled
The methods Activate, Deactivate, and CanBePooled are used for pooled objects.
Dispose
Calling Dispose releases the unmanaged resources held by the serviced component. With the exception of JITA-configured serviced components, you should invoke Dispose to release resources early. With JITA, there is not a 100 percent rule, as discussed later in this chapter.
Q- What are the class attribute of Service component?
With the class, you can specify many attributes to influence the use of services.
Attribute
Description
Description
This attribute was already discussed with assembly attributes. Not only can it be used to describe the application, but it also can be used to describe the component.
MustRunInClientContext
The attribute [MustRunInClientContext] means that if the context of the caller is not compatible with the required context of the component, an exception is thrown.
EventTrackingEnabled
Applying the attribute [EventTrackingEnabled] allows monitoring of the serviced component.
ConstructionEnabled
With the attribute [ConstructionEnabled], the system administrator can define a string that is passed to the component at initialization time.
JustInTimeActivation
The attribute [JustInTimeActivation] is used to decrease the load with the server, because the component itself can decide when it should be deactivated.
ObjectPooling
If the initialization time is longer than the method execution time, you can think about creating an object pool. This is done with the attribute [ObjectPooling].
PrivateComponent
If a component should only be used within the application, it can be marked as a private component. This option is only available with COM+ 1.5.
Synchronization
To get synchronized access to the component from the .NET Enterprise Services runtime, the [Synchronization] attribute is used.
Transaction
With the [Transaction] attribute, we can specify transactional requirements of the component.
SecurityRole
This attribute defines roles that can be used with the application. Applying this attribute to the class has a different meaning; here it means that users of this role are allowed to access the component.
COMTIIntrinsics
With this attribute, a transaction from the COM Transaction Integrator can be passed from the outside to the context of the class. This can be used to integrate IBM Customer Information Control System (CICS) and IBM Information Management System (IMS).
Eventclass
The attribute [EventClass] is needed for loosely coupled events.
InterfaceQueuing
The attribute [InterfaceQueuing] can be applied to both the classes and the interfaces. Calls on methods of the class/interface are queued with the help of queued components.
ExceptionClass
For queued components, this attribute marks a class to handle errors.
LoadBalancingSupported
If the load-balancing service is installed, this attribute allows the component to make use of this service.
Q –What is context? What is light weight proxy?
It is the runtime environment for instance of COM+ object. Each object will have exactly one context (i.e. if Object A belongs to Context1 then Object A will never belong to other context) but each context can have several objects.
Now for a Com+ object a process is broken into apartment then into context. To have cross apartment communication proxy (thread switch) is used, while for cross-context and in same apartment, lightweight proxy is used (no thread switch).
Q –What do you mean by instance mgmt? What are the option for instance Mgmt in Com+?
To manage the object at runtime with higher efficiency is called instance mgmt. Object pooling, Just in time activation are major example of this.
Object Pooling
Q-What is object pooling? What are different attribute in .NET?
COM+ maintains the pool of objects that can be recycled instead of disposing it.
In .NET following setting has to be done –
[ObjectPoolling (true, 1, 4)] - It’s a attribute that has to be applied on the class .The parameter indicates pooling status, Max and min pool.
Q –What are the Requirements or Restriction on Pooling?
Following are the Restrictions –
1. The Com+ object should aggregate i.e. the Wrapper should use AddRef () and Release() functionality of COM. So in ATL component remove DECLARE_NOT_AGGREATE () Macro.
2. The Pooled object should not have thread affinity i.e. thread Local storage or STA should not be used. So the threading model can be MTA or NTA.
So, if your client is –
STA mark your component as both (STA and MTA)
None NTA
MTA Both
3. Pooled object cannot display UI (event driven like windows) because UI requires STA message loop.
4. VB 6 uses STA and local storage hence COM_ component cannot be developed.
Q –What is method that has to be overloaded for object pool?
CanBePooled ()
Just in Time Activation (JITA)
Q- What is JITA (Just in Time Activation)? What is the attribute that needs to be added? What are the methods that have to be overloaded?
JITA is a way by which object is created or activated only when it is needed i.e. when method of the object is called. The attribute [JustInTimeActivation ()] needs to be added on class and [Autocomplete] for the method that uses this scenario. There are two methods that needs to be overloaded –
· Activate ()
· Deactivate()
Q- What is are different ways of Deactivating or disposing the object in JITA?
Using [AutoComplete] declarative statement and,
ContextUtil.DeactivateOnReturn=true.
Q – If the JITA is not set from Component Catalog, What will happen to [AutoComplete] Statement, ContextUtil.DeactiveOnReturn?
It will ignore for [AutoComplete] and exception will be thrown for ContextUtil.DeactiveOnReturn.
Q –What is idle time management?
As the objects in object pool can run for infinite time (if min pool size is mentioned), there is an idle time setting in component catalog to manage this.
Q – What is an Apartment? What are there different types?
An apartment in simple terms is a imaginary synchronization boundary i.e. if client object and Server object have incompatible threading characteristics then apartment is used. Now, if a thread uses COM and creates a object is assigned apartment (may be same or different).
Note: If client and server are in different process then automatically they are in different processes.
There three types are
· STA (Single thread apartment)
A single thread will be responsible for many compatible objects i.e. Single thread will pass message between different objects. Many STA is possible in a Process. There is message pipeline that is maintained by Thread.
· MTA (Multiple Thread apartment):
Many Compatible threads with many compatible objects.
· NTA or TNA (Neutral thread apartment)
??
Transaction
Q – What is Transaction? And what is ACID principle?
Transaction is collection of operation that either all succeeds or fails i.e. if all individual operations succeeds then Transaction is committed else even one failed operation will result in Transaction rollback.
It is a basic property of Transaction (ACID principle) - Atomic, Consistent, Isolation and Durability.
Q – What are resource managers?
These resources (such as SQL database, oracle database, Message Queue etc that have following features –
· They can participate in COM+ transactions
· It notes down all the changes done by each transactional application and can commit or rollback only when it is told so.
· It has property of en-listing i.e. it knows that particular transaction needs it, so it will en-list.
· It maintains data in Durable and isolated from other transactions.
· It also votes for transaction result, i.e tells weather it is ready for commit.
Q – What is Transaction Root? What is Two-phase Commit process?
Transaction Root is a COM+ object, that is first to take part in particular transaction.
Two phase Commit:
At the end of Transaction the COM+ steps back and checks for combined votes ,if all votes are positive then two phase Commit starts –
Phase One(prepare phase) :
All participating Resource managers are asked, if they can commit the transaction.
Phase Two (commit/rollback phase)
If Answer to question is ‘Yes’, then all resource managers are asked to ‘commit’.
If Answer to question is ‘No’ from even one of the resource manager, then all resource managers are asked to ‘rollback’.
Q –What is DTC (Distributed Transaction coordinator)?
It is system services (windows provided) tightly coupled with COM+. It coordinates the activity during two phase commit.
The DTC on the root machine instructs all the DTC to collect the resource manager vote for first phase .The root DTC collects all the votes and starts phase two by instructing all the DTC to either commit or rollback the transaction.
Q –What are the different attribute of Transaction, with meaning?
They are
Required NEW - The Context will run in new transaction always. i.e. always new transaction is created.
Required - The Context will run in the context of Creator, if creator has transaction else new transaction will be created.
Supported - The Context will run in context of Creator, if creator has transaction else not in any transaction.
Not Supported - The Context will not be part of any transaction.
Disabled - ???
Q –What are DONE, CONSISTENT, ABORT bit? Explain there working?
They are –
DONE bit – It is used for JITA indicating that object has done its work and can be deactivated.
CONSISTENT bit – It is used for vote of transaction.
ABORT bit- To abort the transaction.
Working:
At creation of Root object the DONE and CONSISTENT bit of Root is set to false and ABORTS to true. As the Root object creates another object again DONE, CONSISTENT=false and ABORT =true for this object and it continues for all child objects.
Now , as a object is completed with transaction and if it is happy about it ,the CONSISTENT bit is set to true and at the end object is deactivated with DONE bit =true. Same action of DONE and CONSISTENT bit is repeated for all objected.
At last, for Root object the CONSISTENT and DONE bit is evaluated. At any given object evaluation, any of DONE or CONSISTENT bit is evaluated to be false ,corresponding ABORT bit is also set to false and the transaction is rolled back.
Q – What are the ContextUtil method that influence the DONE and CONSISTENT bit?
ContextUtil Method
Done bit
Consistent bit
Transaction State
Object state
SetComplete()
True
True
Committed
Deactivate
SetAbort()
True
False
Abort
Activate
EnableCommit()
False
True
Commit
Deactivate
DisableCommit()
False
False
Abort
Deactivate
Q- What are the Granulites in which COM+ Component can participate in Security?
The gratuity with respect to entire component, interface or method level allocation for particular role.
Q What is the master control switch? What is different level of Authentication? What is different level of Impersonation?
The Check box in Security tab “Enforce access checks . . .” is a master controller.
Levels of Authentication :
None : No checks are done
Connect : Only at first call the Authentication is checked ,but once connection is established COM+ will remain out.
Call: Identity is checked for every method call but the data is not checked.
Packet: Each packet is authenticated but the packet data can still change .
Packet integrity : With packet authentication the checksum is also done.
Packet Privacy: With checksum the encoding is also done.
Impersonation Level :
Anonymous :Least Security impersonation level
Identity : Only on server identity
Impersonate : Only on clients identity on same machine .
Delegate : clients identity in any machine.
Topic 4 -Using COM Component from NET
Q – How COM Components can be used by .NET?
A proxy RCW (Runtime callable wrapper) is placed between COM and .NET to interoperate . There are two ways –
- Use command line tool tlbimp.exe (type library importer) .
- Using Add reference in VS.NET .
Q – What PInvoke ,how it is used ?
Topic 5-Deployment
Private Assemblies Deployment
Q – What are the different ways in which private assemblies can be deployed? What are various ways to find out dependences of application?
Simply copy the required .exe and the required .dll to folder of interest.
The dependencies can be found by using ildasm.exe or .NET configuration wizard .In ildasm just drag the application and .NET configuration use Application option.
Q- What is probing? What is binding? How does CLR probe the application dependencies?
Searching for all the depended elements for an application is termed as probing. When depended element is found the CLR binds with application. CLR probes with following sequence
AppBase/
AppBase//
AppBase/PrivatePath/
AppBase/Private Path//
Here AppBase = Installed application folder
= element that is being probed
= The name of directory ELEMENT .
Q – What are the ways to set the Probing path inn .NET?
The probing path can be set using –
-.exe..config or web.config file with
” />
- .NET configuration tool ,specifying additional path
Application/ -right click ,properties,In relative search path.
Q- How will you diagnose for failure of probing?
The tool fuslogvw.exe can be used to display for the failed assembly.
Deploying Shared Assemblies
Q What is strong name? How it is generated? What is the process of verification used by CLR?
Strong name consists of Simple Name, Version number (...),culture, Public Key token
It is generated using sn –k.snk
The Strong name consists of public key token that is stored by Assembly manifest. And the Assembly as private key that is obtained by hashing and encoding the public key and is stored with Assembly.
When the CLR verifies an assembly, it reads the public key from assembly manifest using the algorithm (i.e. hashing and encoding) to get private key.
The private key of Assembly and the algorithm generated is compared and validated.
Q- How shared assembly be added to GAC ?
Following are the ways –
Through windows explorer - Open windows/assembly folder then drag the DLL and drop it.
Through .NET Configuration -Open the .Net Configuration folder right click the Assembly Cache item and add the DLL.
Through gacutil : In VS.NET command prompt gacutil /I.
Q What is the binding policy for Shared assembly ?
In order to bind the shared assembly CLR uses three XML based files
Application Configuration files – It will have the path of assembly with version information.
Publisher Policy Resolution – It will have version of the assembly that needs to be referenced for correct working.
Administrator policy Resolution – The binding rules are specified in machine.config file .
- Now, the CLR uses above XML files to located the proper assembly .
- If the Assembly is loaded then CLR will nor attempt to load
- If the assembly is in GAC then it is loaded from GAC.
Q – Explain Side by Side Execution scenario ? Explain how to configure these ?
Side by side execution means multiple version of same DLL . It can be configured by
With .Net configuration tool
- Application Configuration files (.config file client side) (Application tree)
- Administrator Policy (machine.config client side)
(Configured Assembly)
- Publisher policy (with dll server side)
(new dll and then al.exe to compile)
Q – What is delay signing in Assembly? How it is done?
Delay singing of Assembly is a way to delay the verification by GAC and executing component of strong name. The Strong name has private ,public key has one of its requirement. But in delay signing the
sn –p publicprivate.snk public.snk will be issued and in
assembly.cs
[assembly:AssemblyDelaySign(true)]
[assembly:AssemblyKeyFile(“public.snk”)] is issued. By which the executing component will delay the verification (off).
Now,in order to make GAC delay the verification following is issued –
Sn.exe -Vr (Skips the verification)
Sn.exe –R ready to deploy
Turn on velification
Sn.exe –Vu
Note :al.exe also can be used for same.
Q What are the type of Setup and Deployment project does VS.NET Supports ?
- Setup Project – For Setting up Window Application, Window Service ,Console Application.
- Web Setup Project – ASP.NET Web application and Web Services
- Merge Module - It is an .msm file. They the package that are merged with the installer packages of the particular application.
- Cab projects - These are the cabinet files that create the package in compressed format that can be used for copying in floppy or CD.
Q- What are the various type of editors the VS.NET 2003 provides for Deployment ?
Following are the editors that VS.NET provides –
- File System Editors - Used to manipulate the target machine folder. These are the special names that this editors provides e.g. USER’S Desktop, Application Folder, Program Files, Common Files etc.
- Registry Editor - This is an editor that provides the facility to specify the key , sub key and values. We can also import the registry files.
- File Type Editor – This editor enables to associate the file extension with action in the application. for e.g. the .qty or .txt should open or print etc.
- UI Editor – The Setup UI at Start, Progress and End can be specified. Both administrative and User interface can be manipulated.
- Launch condition editor – The minimum condition that needs to be evaluated while installing is calculated.
- Custom Editor – Certain important functionality like executing a script or database manipulation can be done. There are 4 Phases Install, Commit, Rollback, Un Install..
Setup and Web Setup supports all type of editors but merge module does not supports UI Interface and Launch condition. The CAB does not support any of these.
Q – What are the ways in which Web Project can be deployed?
It can be deployed –
- Copying manually.
- Using Copy Project command in VS
- Using Win Installer package
Q –What is Boot strap executable ? Is the .NET Framework Required for any Installation to work ?
In the Setup folder there will be setup.exe (bootstrap) executable. These bootstrap will look for MSI Installer ,if not present then it will be installed using insallMsiA.exe or installMsiW.exe and then instruct the installer to insall.
Yes! .Net framework is required.
Q- How can the setup project be configured ?
It can be configured using Configuration set up i.e. right clicking the project property. Following can be configured –
- output file name
- Package to done – As CAB ,loose uncompressed file ,in set up file.
- Bootstrap- Specifies weather setup.exe to be created or not.
- Compression – type of compression (by Speed or by Size) .There is a trade off for each type of sepcifaction.
Topic 5-WebService in .NET
Q –What are the Technologies that web service depends?
There are Four essential paradigm that Web service depends-
- Discovery (UDDI Disco)
- Description (WSDL,XML Schema ,DOCS)
- Message Formatting (SOAP)
- Encoding (XML)
- Transporting (HTTP,SMTP and so on)
SOAP
Q – What is SOAP? What are the basic building blocks?
It is a XML based messaging protocol. It Contains
- Essential envelope MUST.
- Optional header
- Essential body MUST
- Optional fault
Hence ,
... ... ... ... ... ...
Q – Explain Soap functionality? What is ‘mustUnderstand’ Attribute? What is ‘actor’ attribute ?
Soap is used to
Authenticate
Security Digest information
Routing information
Transaction
Payment information
mustUnderstand=1 attribute is used in Header tag to denote the client should adhere to the header information.
Actor=URI is the intermediary (i.e. not an end point of message) .
Q –What is Soap Body Element used for? What are the categories of Soap binding and use style Messages ?
Body element of Soap contains message that the user wants to pass. It can be categorized has –
- Procedure oriented Message i.e. RPC Message
It is two way communication of message . It contains request and response . In request the method and parameter signature is present.
- Document orientated message
It is basically one way communication containing XML document as parameter.
Use Style are
Encoding and literal ,So in effect there are –
- RPC Encoding
- RPC literal
- Document encoding
- Document literal
And in addition document literal wrapped
Q – What are RPC and Document messages? What are encoding and literal?
The RPC is the Remote procedure call i.e. the procedure call in remote machine and the result or response back to current machine.
The document is the message or the document that is send /received from/to remote machine.
RPC Encoding –
It is Straight and simple but cannot be validated after converting into SOAP and not WS-I compliant
RPC literal -
It is simple and WS-I compliant but cannot be validated easily.
Document Encoding -
Not used and not WS-I compliant
Document literal –
It can be validated as schema is in Soap message and is Ws-I compliant but bit complicated.
Document literal Wrapped
It can be validated as schema is in Soap message and is Ws-I compliant but very complicated. It does not support overloaded web service method.
Hence best is Doc/lit wrapped i.e..Net Web service uses.
Q –What is element? What are important fault codes?
Under Body element there can be fault code that describes the fault code ,fault string(description) ,fault factor (url of fault) and details. Major fault code are
- versionMisamatch code
- mustUnderstand violation
- Client
- Server
Q- What is Soap Encoding ? What encodingStyle attribute ?
The Method by which Soap serialize and de-serialize the data is called encoding technique. The encodingStyle attribute will specify the style for either entire document or for an element. The URI of encodingStyle can specify the Schema.
Web Service Description Language (WSDL)
Q What is WSDL ? What is Syntax of typical WSDL file?
It is an XML based way to describe the Web service, so that client can extract the proxy class out of it.
It has Syntax
Definition :
element – It is root element containing WSDL namespace(i.e. targetNameSpace) and other namespace.
Types
element – It contains Schema (type definition )
(element)
Message
-
It contains various method and parameters in the method.
(element)
PortType
It contains various
(reference to message)
Message Operation Types –
With the various combination and order of
WriteStartAtribute
Start collection of attribute
WriteStartDocument
Write Xml 1.0 prolog
WriteStartElement
Writes specified Xml start tag
WriteString
Writes string content
Attributes of XmlTextWriter
Formatting
It can be None,Intended
Intentation
Intentchar
Gets or sets the white space char
Q- What are the various limitations of XmlWriter ?
- Cannot validate the character
- Cannot check for duplicate attribute
- It does not validate against any Schema.
XmlDocument
Q- What are XmlDocument class? Explain its different properties and methods?
It is confined to XMDOM Core 2.0 specification . it is used to create, manipulate, search specific or collection of xml node/nodes. All the operation are done in Memory. i.e. Entire XML file is loaded in memory and then manipulated.
Some important properties –
Property
Description
DocumentElement
Get root node of document
InnerXml
Get or sets the Markup of document element
Some important method-
Method
Description
CloneNode
Clones the Document
CreateAttribute
It create attribute
CreateCDataSection
It create CData
CreateCommnet
It create Comment
CreateElement
It create Element
CreateNode
It create node
GetElementById
Get Elements by given id
GetElementsbyTagName
Return the list of Elements that matches Tag
Load,LoadXMl
ReadNode
Reads the XmlNode of current object
Save
Q-What is XmlNode Class ? What are various attributes and Method?
It is base class of Document (XmlDocument) and is an abstract class .
The attributes are –
Properties
Description
Attirbutes
Collection of attribute of current node
ChildNodes,FirstChild
HasClildNodes
Indicates weather current node has child
InnerText
Get or Sets the text of current node
InnerXml
Get or Set the Xml
Method of XmlNode-
InsertAfter –
InserBefore-
SelectSingleNode-
SelectNode-
RemoveChild-
RemoveAll –
XPath and XNavigation
Q- What is XPath? How various expression are given in XPath?
It is XML technology that is used to search path in the XML document in Random fashion.
Various XPath –
/Books/Book/Author – Select Author from the Root
//Author-Select nodes of Author
/Books/*/Author – Grand child of all author where child can be anything
/Books/Book/@pages – pages attributes under Book
//@pages – all pages attribute
//Book/@* - all attribute under Book node
/Books/Book/Publisher[.=”Addison “] – All Publisher named Addison under Books
or
/Books/Book/[./Publisher=”Addison “]
/Books/Book[./Pages>=100]
All pages greater than 100
/Books/Book[Starts-With(Title, ’A’)]] - All books start ing with ‘A’
Few more functions are –
Concat() – joins two string
Contains () – Detetime weather one string contains other
Count()- Count occurrence of element
Last() – Last element in the colletion
Normalize-space()
Not()- Negates the argument
Number()- converts argument to number.
Position() – Node with its parent
Starts-with() –
String-length() –
Substring()-
Q- What is XPathNavigator ? How to obtain the object ?
XPathNavigator is a class that provides with the functionality to move in the XML document faster. It can be created with –
XPathDocument , XmlDocument,XmlDocument.
Q – How will you get XML Schema from XML document ? How will you validate ? How would you validate the XML
XML Schema can be obtained from XML document
- Loading Xml document has DataSet and then using ReadXMLSchema or InferXMlScheam
- To use xsd.exe
The main difference between InferXMLSchema and ReadXmlSchema is that Infer will take additional parameter to ignore the namespace.
Validatioin is done by using XMLValidatingReader Class.
Using SQL Server to generate XML
Q – How SQL Server can be used to generate XML ?
Various XML clauses are –
FOR XML RAW
Each element will have Tag and all the field as attribute
FOR XML AUTO
Each element will have Table Name in element and each field as attribute
FOR XML AUTO ,ELEMENTS
Each element will have Table Name in element and each field as Element
FOR XML EXPLICT
User defined XML Tags
FOR XML AUTO,XMLDATA
Functionality of AUTO + XMLSCHEMA also
Through SQLCommand.ExecuteXmlReader() can also be used to generate XML with above FOR XML Clause.
Windows Services
Basics :
Q –What is windows service ? What are there general characteristics ?
Window Services are the background processes that conforms to Service Control manager(SCM) . The SCM is a part of Windows OS that unifies the way various services work.
Following are the Characteristics of Window services –
1- Conforms to SCM – The SCM exposes set of well known interfaces .These are implemented by Services to conform to basics functionality of Window servicing. Some of the important message are Start, Stop, Continue, Pause. Etc
2- Lack Of User interface – Most of WS (windows service) do not have UI and work at background.
3- Specific User Identity – Either System User Identity or Specific User Identity. It may not be logged on USER. Each WS has its own user identity.
4- Separate Window Process-
5- Special Install Procedure
Q – Explain the Architecture of Windows Service ?
It contains five main component –
- Service database
It consists of
· Path of Service
· Security settings
· Start up parameter
- Service Installed
· The name that uniquely identifies while instaaling
· Accounts password and username.
· WS process is created
· WS Started
- Service Control Manager(SCM)
· Accepts install and uninstall of Service
· Starts WS while window is started or on demand
· Enumerates installed WS
· Transmits Start, Stop, Pause etc to Service
· Locks and unlocks WS Database
- Service in Execution
- Service Controller
· Start, Stop, Resume, Pause, Query, install, uninstall.
Q- What are the various Windows services support class that is provided in FCL (framework class library) ?
The name space is
System.ServiceProcess
The Classes are
- ServiceBase – It includes base functionality for Services.
- ServiceProcessInstaller and ServiceInstaller- Using installutil.exe the Services can be installed
- ServiceController – To connect to service and perform various operations such as Start, Stop, Continue etc
.
Q –What are the main properties and method of ServiceBase Class?
The Properties are –
Properties
Description
AutoLog
“true” then it logs the call in Application event log to onStart(),OnStop(),OnPause(),OnContinue() methods
CanPauseAndContinue
“true “, The service can pause and continue.
CanStutDown
“true”,When system shutdown the Service should be notified
CanStop
“true” ,the service can be stopped if started
EventLog
“true”,Logs into Event log Customized message on OnStart() and OnStop().
ServiceName
Name of the service
The Methods are –
Method
Description
OnContinue
The SCM sends a continue message the method is called
OnPause()
The SCM sends a pause message the method is called
OnStart()
OnStop
Run()
Main entry point for service to run
Q –What are important Classes that helps in installing WS ?
These classes are –
- ServiceProcess.ServiceProcessInstaller – These class creates record for all the WS in an Application into WS database. We can have just one instance of this class /Application.
- ServiceProcess.ServiceInstaller – These class writes WS information into WS database . There can be many instances of this class per application i.e. per WS there is one instance.
- Configuration..Install.Installer –It acts an entry point for Installation. It can contain instance of ServiceProcessIntaller and many instances of ServiceInstaller
Q- What are the important properties of ServiceProcessInstaller and ServiceInstaller Class?
Properties of ServiceProcessInstaller –
Account
Type of account under which user runs.The values can be LocalSystem,LocalService,NetworkService,User
Password ,Username
For Account=”User” ,then specify Password
Properties of ServiceInstaller –
DisplayName
The user read able Name .
ServiceName
Specifies unique name which system identifies
ServiceDependOn
Specifies the array of WS that must run before this service runs.
StartType
Automatic,Disabled,Manual . When the Service stars .
Q What are the Ways to monitor the WS ?
Two ways –
- Windows MMC
- VS.NET Server Explorer ->Service
Q What are the different utility for WS ?
Installutil.exe
To install the WS
Net
To Enumerate various services
- NET START
To Start
- Net Start
To Pause
- NET PAUSE
To Resume –
- NET CONTINUE
To Stop
- NET STOP
SC.exe (only in XP,2003)
To Start, Stop ,Pause ,continue ,Configure, query etc
Q – Explain ServiceController class with various properties and methods ?
The Class is used to access functionality of already created Windows service ,the functionality can be accessed programmatically.
The basic properties are -
Properties
Description
CanPauseAndContinue
True indicates service can be paused and resumed
CanShutdown
True indicates that service should be notified while shutting down
CanStop
True means service can be stopped after start
DisplayName
Friendly Name of the Service
MachineName
Name of Computer in Which WS is working
ServiceName
Name of WS
ServiceDependsOn
Set of Services on which Servcie depends on
ServiceType
How the ES is used.
InteractiveProcess –Can communicate with desktop
Win32Process – runs in its own process
Win32ShareProcess – Share process with other WS.
Status
Retrives Status of WS.
The basic methods are –
Method
Description
Close()
Disconnects the WS with Application
Continue()
Continue the WS .
ExecuteCommand()
Execute Custom Command in WS
GetServices()
Gets The list of Services on Machine
Pause()
Pauses the WS
Refresh()
Refresh all properties with latest
Start()
Starts WS
Stop()
Stops the WS
Tracing and Debugging
Tracing and Debugging
Q -How will Tracing and Debug be enabled using VS.NET ? What are the Methods and property?
The Tracing and Debug can be enabled by using DEBUG symbol in VS editor. Only Tracing (i.e. TRACE) will be enabled in Release mode.
Some of the Properties are –
AutoFlush
Specifies flush should be called after every write
IntendedLevel
Specify indented level
IntendedSize
Specifies number of Spaces
Listerners
Specifies listeners that are monitoring
The Methods are – (All method are Static)
Assert()
Checks the condition and displays the error if condition is false
Close()
Flushes the output buffer and closes the listener
Fail()
Display the error message
Intend()
Increase the current level of intend by one
Unintend()
Decrease the Intended level by one
Write(),WriteIf(),WriteLine(),writeLineif()
Writes the content to listener, if the condition is true(writeIf)
Q-What are the types of listeners?
There are three types of listener and they are available in System. Diagnostics namespace
Customize listener – TraceListerner .
DefaultTraceListner - An object of this class is automatically added to Listerner collection. It write message to OUTPUT window
TraceListrerner – Write message to any stream Class.
EventLogListerner – Write message to Event log
E.g
Trace.Listerners.Add(new EventLogTraceListner());
Trace.Listerners.Add(new TraceListerner(stream));
Q – What are the ASP.NET Tracing facility ? How web.Config file is set?
In addition to above trace and debug the ASP.NET has facility to view the trace using Trace.axd url .
Following is the setting that can be done
enabled=”true”/false
requestLimit=”10”
pageOutput=”false” /true
traceMode=”SortByTime” /SortByCategoery
localOnly=”true”/false
/>
enabled – Tracing is enabled
requestLimit – Limit of Request for which data has to shown
pageOutput – to show in same page
traceMode- to Sort by time or Sort by Category
localOnly - to show the page to client or Not.
The page can be viewed by
Localhost//virtualdirectory/trace.axd
Debugging
Q How to handle the Exception Messages? What is the tool for debugging ?
Debug->Exception can handle it.
Tool is
Dbgclr.exe
Q –What are the Steps to setup a machine for remote debug ?
Steps are -
- in remote machine the mdm.exe should be running
- If it is not present ,then install VS.NET with Remote Component setup enabled
- Ensure that you are the member of Debugger User Group, for ASP.NET application you must have admin privilege on remote M/C.
- On Local m/c ,Set Enable Remoting Debugging Enabled to true. The Exe that is being debugged must be in Sharable folder.
- Add Remote Debug Machine option with the name of the machine.
Q – How will you debug DLL files and Client side script ?
DLL files can be debugged by attaching the DLL.
The Client script debugging can be done –
- IE can only be debugged
- The Script debugging should be enabled in IE (Tools ->Ie Options-> Advance Tab)
- Attach ieExplorer to the debug
Q- How to debug WS ,Remoting ?
WS,Remoting can be debugged by Attach process.
COM+ Debugging ??
Q – What are the Trace switches ? what are the Types ?
There are BooleanSwitch and TraceSwitch .
BooleanSwitch – It has two modes Off and On and default is On.
TraceSwitch –It has five level ,
0 – off
1 – Only Error
2 – Error ,Warining
3 – Error ,Warning,Info
4 – Error,Waring,Info,Verbose
Important Properties
Level – Trace level enumeration
TraceError – returns true if Level is set to 4 otherwise false
Traceinfo – returns true if Level is set to Info or verbose
TraceVerbose – returns true if Level is verbose
TraceWarnig – Info is set to true.
To add in Web.config file
Q – What are the Conditional compilations? What is the attribute that is used to define it?
There are various conditional compilations –
# if #else #elif and #endif
#define and #undef
#warning and #error
#line
#region and #endregion
The attribute is [Conditional(“DEBUG”)]
Note : The method should return void for the above attribute.
Q – What is the EventLog class ? What are the important methods and properties ?
EventLog class is used to log the event log messages into log. The important method and properties are –
CreateEventSource()
Create event source for application to write
Delete()
Removes the log message
DeleteEventSource()
Removes the application event source form event log
Entries
Get the content of Event log
Exists()
Determines weather specific log exists
Log
Specifies name of the log to write and read
LogDisplayName
Represents friendly name for the event log
SourceExits()
Checks if source Exits
WriteEntry()
Writes to log file
Topic 1 - .NET Remoting. 5
Basics : 5
Q- What is application domain? What are the advantages?. 5
Q- What is .NET Remoting?. 5
Q- What is marshaling? And what are the two way with there disadvantages?. 5
Q- What are the channels? What are different types? What are the pros and cons of each?. 6
Q- What are various types of formatter available? Compare it with channels, using efficiency and interoperability scale? 6
Q -What are the different activation methods? When they are desired? Compare it with scale of Flexibility and Scalability? 6
Q - Explain concept of Lease time? What are the different attributes?. 7
Q- Explain the Steps in client and server for SAO remote object working?. 7
Q- Explain the Steps in client and server for CAO remote object working?. 8
Remoting with .config : 9
Q- What is the Steps to be followed?. 9
Q- What are the major option in configuration file ?. 10
Q- What are the major options in under
Q- What are the major attribute of
Q- What are major attribute of
Q-. What are the element and there attributes of
Remoting -Using SoapSuds. 11
Q-What are the steps ?. 11
Q-How to generate Wrapped Proxy?. 11
Q- How to generate Non Wrapped Proxy?. 12
Topic-2 .NET Security. 13
Basics: 13
Q- What are the two type of security in .NET?. 13
Q- What is Code Access Security and Role based Security?. 13
Code Access Security: 13
Q- What is Evidence, Security policy and permissions?. 13
Q-What are the types of Evidence?. 13
Q-What is Minimum Permission, optimal (optional) permission, Refusing permission?. 13
Q-What is Code access Permissions?. 14
Q- What is Identity permission?. 14
Q-What is Stack Walk and how we can override the default stack walk?. 14
Q- Type of security policy? What are the key elements of each of them?. 14
Q-What is the membership conditions (set of Evidences) for code group?. 15
Q What are the Permissions that are available?. 15
Q- How the permissions are calculated?. 15
Q- What is Exclusive permission and Level final permission?. 16
Role Based Security. 16
Q What is Authentication and Authorization?. 16
Q- What are various ways for Authentication in IIS and ASP.NET?. 16
Q What is impersonation?. 17
Q-Can we give authorization via Web.Config ?. 17
Topic3-Enterprise Services (COM+) 18
Basics. 18
Q- What are the services provided by COM+ ?. 18
Q –What are the steps to create enterprise service component ?. 18
Q- What are the type of Applications the COM+ has ? What are the factors that will influence our decision? 18
Q- What are the different types of registration possible for COM+ objects? What are pros and cons of each of them? 19
Q-What ClassInterface Attribute? What are different ClassInterfaceType values that can be set? Explain there significance? 19
Q Why ClassInterface (ClassInterfaceType.None) is recommended ?. 20
Q – How to use enterprise components?. 20
Q – What are the various methods of Service Component Class?. 20
Q- What are the class attribute of Service component 20
Q –What is context? What is light weight proxy?. 22
Q –What do you mean by instance mgmt? What are the option for instance Mgmt in Com+?. 22
Object Pooling. 22
Q-What is object pooling? What are different attribute in .NET?. 22
Q –What are the Requirements or Restriction on Pooling?. 22
Q –What is method that has to be overloaded for object pool?. 23
Just in Time Activation (JITA) 23
Q- What is JITA (Just in Time Activation)? What is the attribute that needs to be added? What are the methods that have to be overloaded?. 23
Q- What is are different ways of Deactivating or disposing the object in JITA?. 23
Q – If the JITA is not set from Component Catalog, What will happen to [AutoComplete] Statement, ContextUtil.DeactiveOnReturn?. 23
Q –What is idle time management?. 23
Q – What is an Apartment? What are there different types?. 23
Transaction. 24
Q – What is Transaction? And what is ACID principle?. 24
Q – What are resource managers?. 24
Q – What is Transaction Root? What is Two-phase Commit process?. 24
Q –What is DTC (Distributed Transaction coordinator)?. 24
Q –What are the different attribute of Transaction, with meaning?. 25
Q –What are DONE, CONSISTENT, ABORT bit? Explain there working?. 25
Q – What are the ContextUtil method that influence the DONE and CONSISTENT bit?. 25
Q- What are the Granulites in which COM+ Component can participate in Security?. 25
Q What is the master control switch? What is different level of Authentication? What is different level of Impersonation? 25
Topic 4 -Using COM Component from NET.. 26
Q – How COM Components can be used by .NET?. 26
Q – What PInvoke ,how it is used ?. 26
Topic 5-Deployment. 26
Private Assemblies Deployment. 26
Q – What are the different ways in which private assemblies can be deployed? What are various ways to find out dependences of application?. 26
Q- What is probing? What is binding? How does CLR probe the application dependencies?. 27
Q – What are the ways to set the Probing path inn .NET?. 27
Q- How will you diagnose for failure of probing?. 27
Deploying Shared Assemblies. 27
Q What is strong name? How it is generated? What is the process of verification used by CLR?. 27
Q- How shared assembly be added to GAC ?. 28
Q What is the binding policy for Shared assembly ?. 28
Q – Explain Side by Side Execution scenario ? Explain how to configure these ?. 28
Q – What is delay signing in Assembly? How it is done?. 29
Topic 5-WebService in .NET.. 29
Q –What are the Technologies that web service depends?. 29
SOAP. 29
Q – What is SOAP? What are the basic building blocks?. 29
Q – Explain Soap
Q –What is Soap Body Element used for? What are the categories of Soap binding and use style Messages ? 30
Q – What are RPC and Document messages? What are encoding and literal?. 31
Q –What is
Q- What is Soap Encoding ? What encodingStyle attribute ?. 31
Web Service Description Language (WSDL) 31
Q What is WSDL ? What is Syntax of typical WSDL file?. 31
Q – What is Extensible element ?. 32
Web Service In ASP.NET. 33
Q What are the ways in which web service can be created ? what is [WebMethod] ?. 33
Q- What are the various attributes of [WebMethod] ? What are various attribute of [WebService] ? 33
Q – What are the protocol binding that ASP.NET Web service to HTTP are Provided ? What are the advantage/disadvantage of POST and GET over SOAP? How the value can be set?. 33
Q –What are the type of soap Exception that can be raised ?. 34
Q-What are the different encoding styles can be configured at Class level provided by .NET ? What are different attributes that can be manipulated ?. 34
Q-What are the different encoding styles can be configured at Method level provided by .NET ? What are different attributes that can be manipulated?. 35
Q What are three Main issues with ref type passing in WebMethod ?. 35
Q – What are the different types of session state ? how they are configured? What are the different attributes of sessionState element?. 36
Q- What are Application State ? how to avoid race condition while updating Application State?. 36
Q –What are Soap Headers ? How it is invoked client side ?explain server and client interface?. 36
Q- What is the Required and Mustundestand in Soap Header?. 37
Q – What is SoapHeaderDirection attribute?. 37
Q What is Soap Extensions? What the Steps to be followed ?. 38
Q- What is the Sequence of method called by the Webservice in connection with Soap Extension?. 39
Q What is WSDL.exe utility? What are the major options available?. 39
Topic-5 NET & XML Manipulation. 40
XMLReader Class: 40
Q What is Push parser and Pull parser ? What is an XmlReader class ? What are the different type of XmlReader Class? 40
Q How the attribute & element and distinguished ? what is normalization ? How exception can be caught ? 40
Q What are the Important properties and method of XmlReader ?. 40
XMLWriter. 41
Q What are XMlWriter ? What are the important attributes and methods ?. 41
Q- What are the various limitations of XmlWriter ?. 42
XmlDocument. 42
Q- What are XmlDocument class? Explain its different properties and methods?. 42
Q-What is XmlNode Class ? What are various attributes and Method?. 42
XPath and XNavigation. 43
Q- What is XPath? How various expression are given in XPath?. 43
Using SQL Server to generate XML. 44
Windows Services. 45
Basics : 45
Q –What is windows service ? What are there general characteristics ?. 45
Q – Explain the Architecture of Windows Service ?. 45
Q- What are the various Windows services support class that is provided in FCL (framework class library) ? 46
Q –What are the main properties and method of ServiceBase Class?. 46
Q –What are important Classes that helps in installing WS ?. 47
Q- What are the important properties of ServiceProcessInstaller and ServiceInstaller Class?. 47
Q What are the Ways to monitor the WS ?. 47
Q What are the different utility for WS ?. 47
Q – Explain ServiceController class with various properties and methods ?. 48
Tracing and Debugging. 49
Tracing and Debugging. 49
Debugging. 50
MS- Exam 70-320 (Notes)
Topic 1 - .NET Remoting
Basics :
Q- What is application domain? What are the advantages?
In MANAGED execution it is the smallest unit of separation. It is in-built feature of a managed code to have type safety (i.e. program does not call program elements beyond its boundary).
Advantage –
It is light weight i.e. to create, monitor and maintain the application is less tedious than process boundary.
Q- What is .NET Remoting?
It is way in which application talk between Appdomains objects. The Appdomains can be with in same network or may be different.
Q- What is marshaling? And what are the two way with there disadvantages?
It is technique of packaging and sending the objects across the Appdomains.
There are two types:
Marshaling by Value(MBV ) Object -
The value of the object is transferred across the Appdomains i.e. actual copy of the objects is re-created at Appdomains. This technique involves Serializing and then de-serializing the objects.
Disadvantage
- Large objects transfer takes time
- The objects runs at client environment hence advantage of server resource is absent.
Marshaling by reference (MBR) object -
The proxy (ObjRef) is transferred to Appdomains; the ObjRef contains IPAddress and the method signature of the calling object. This proxy is used
by the client to reference the method call at server.
Disadvantage-
- Network round trip is increased.
Q- What are the channels? What are different types? What are the pros and cons of each?
In order to communicate between two Appdomains, the channels are used which are unique (port) and specific type (HTTP/TCP).
There are two types:
- HTTP
- TCP
The Pro's and Con's are as follows –
Scope - HTTP via I-NET as wide scope. There are no firewall hindrances.
TCP does not have wide scope .Always restricted because of firewall.
Efficiency -HTTP is bulky with Soap (string), hence less efficient.
TCP is light with stream (binary), hence more robust.
Security-
More - IIS is used for Security.
Less - should use custom security.
Q- What are various types of formatter available? Compare it with channels, using efficiency and interoperability scale?
There are Binary and Soap formatter.
The combinations are:
Channels
Formatter
Efficiency
Interoperability
TCP
Binary
Highest
Lowest
TCP
Soap
High
Lower
HTTP
Binary
Lower
High
HTTP
Soap
Lowest
Highest
Q -What are the different activation methods? When they are desired? Compare it with scale of Flexibility and Scalability?
There are two activation methods –
Server Activated Objects (SAO)-
These are objects whose life time is controlled by server. They are further
Classified as -
Single call Activated objects
Each server method call creates new object in server, the method is executed and then destroyed. These are Stateless objects.
Desirability:
- The overhead of creating the object is not significant.
- State of the object across method is not important.
- The Server needs to support large number of stateless requests.
- The load balancing needs to be achieved (i.e. a technique in which requests are distributed among many servers).
Singleton Objects
There is only one object created for all the method calls. The object lives in the server for its lifetime period.
Desirability:
- There are several clients needing previous state of object.
- The overhead associated with creation of object is substantial.
Client Activated Objects (CAO)
These are the objects whose lifetimes are controlled by client.
Desirability:
- Client want to maintain a private sesion with remote object
Note :
The Single call Server has maximum Scalability (they can be put in different servers.
The CAO has maximum flexiblity has lifetime is controlled by client.
Q - Explain concept of Lease time? What are the different attributes?
It is a time in server for which remote object will remain alive. After that the garbage collector will remove that object.
Attributes:
CurrentLeaseTime = Amount of lease time remaining. (Read-only)
InitialLeaseTime = Initial lease time
RenewOnCall = Amount of time added to CurrentLeaseTime.
SponsorShipTime = Amount of time to wait for any sponsors.
(ILease) is the interface.
Q- Explain the Steps in client and server for SAO remote object working?
At Server side:
1. Create a Remote Class
- Derived as MarshallByObject and ISerialize or MarshallByRef generate a DLL.
2. Create the Server
- Add reference to remote class i.e. DLL and System.Runtime.Remoting.
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
Using
- Create channel (TCPChannel/HTTPChannel) with port.
- Register the channel (use ChannelService.RegisterChannel(channel)).
- Call RemotingConfiguration.RegisterWellknowType(typeof
(
At Client Side :
- Add reference to remote class and System.Runtime.Remoting assembly
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
using
- Create HttpClientChannel or TcpClientChannel
- ChannelService.RegisterChannel(channel)
- RemoteConfiguration.RegiasterWellKnownClientType(typeof(
OR
- Activator.GetObject(typeof(remote class),url)
Q- Explain the Steps in client and server for CAO remote object working?
At Server Side:
1. Create a Remote Class
- Derived as MarshallByObject and ISerialize or MarshallByRef generate a DLL.
2. Create the Server
- Add reference to remote class i.e. DLL and System.Runtime.Remoting.
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
Using
- Create channel (TCPChannel/HTTPChannel) with port.
- Register the channel (use ChannelService.RegisterChannel(channel)).
- Call RemotingConfiguration.RegisterActivatedServiceType(typeof
(
At Client Side :
- Add reference to remote class and System.Runtime.Remoting assembly
- Use following at top:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.TCP, or
using System.Runtime.Remoting.Channels.HTTP
using
- Create HttpClientChannel or TcpClientChannel
- ChannelService.RegisterChannel(channel)
- RemoteConfiguration.RegiasterActivatedClientType(typeof(
url :
OR
- Activator.GetObject(typeof(remote class),url):
Remoting with .config :
Q- What is the Steps to be followed?
At server :
- RemotingConfiguration.Configure("server.exe.config")
- The 'server.exe.config' is an xml file and stored in Debug/bin using VS.NET.
- Content of ‘server.exe.config’
At client :
- Generate the .cs or the DLL from soapsuds (use Server DLL)
- Reference these through Add Reference
- Add line RemotingConfiguration.Configure("client.exe.config")
- Create the instance of server class with 'new'
- The ’client.exe.config’ configuration file and place in bin/debug folder of VS.NET
- Content of the file
Q- What are the major option in configuration file ?
i.e.
Q- What are the major options in under
Q- What are the major attribute of <lifetime> with explanation?
renewOnCallTime="1M"
leaseManagerPollTime="100H"
/>
H=Hrs,M=Min,MS=millesec S=second and 1H10M is not Possible
leaseTime = Initial time
sponsorshipTime=Wait period for any other object's call
renewOnCallTime=When any method is called add renewOnCallTime to
leaseTime
leaseManagerPollTime = the polling time for the object.
Q- What are major attribute of
ref = refrence channel type TCP or HTTP
displayName= only with .NET type frame work configuration
port =server side port number ,can be 0 means server side call backs used
type= id
Note : there are many more attributes
Q-. What are the element and there attributes of
At Server side
,
objectUri="Url"
displayName="" />
At Client side
url="http /or tcp:/localhost:
Remoting -Using SoapSuds
Q-What are the steps ?
Write the Code for Server
Q-How to generate Wrapped Proxy?
- Run the Server.
- use command at client work place:
soapsuds -url:http://loaclhost
-oa:
At Client Code:
- Reference
- Use
using
objectClass myObj = new objectClass();
Advantage-
-It is very simple to use.
Disadvantage
- Only Soap Channels.
- No Value type can be passed
Q- How to generate Non Wrapped Proxy?
- Run the Server.
- Use command at client work place:
soapsuds -nowp -url:http://loaclhost
-oa:
At Client Code
- Reference
- Use
using
- Create Channel .
- Register Channel .
- Use objectClass
myobj=(objectClass) Activator.GetObject(typeof(objectClass),"http://localhost:
Advantage
-It is very simple to use.
- With Any channels
Disadvantage
- Only code can be seen.
- No Value type can be passed
Topic left
Deployment through IIS
Deployment through Window Services
Security of .NET Remoting
Topic-2 .NET Security
Basics:
Q- What are the two type of security in .NET?
Code Access security and Role based security
Q- What is Code Access Security and Role based Security?
Access to the Code to particular resource and Role to the Resource
Code Access Security:
Q- What is Evidence, Security policy and permissions?
Evidence - It is a set of characteristics (ex. Application directory, Hash code, Strong name, URL, site, zone, publishers) that establishes the identity of assembly.
Permission - It is a set of permission grants to particular resource.
Security policy - A bridge between Evidence and the permission (i.e. the license and the permission).
Q-What are the types of Evidence?
Two types - Host evidence, Assembly evidence
Host Evidence - At runtime it is evaluated (i.e. Application directory, Hash code, Strong name, URL, site, zone, publishers).
Assembly evidence - At build time it is evaluated. (i.e. Custom evidence). It has least priority.
Q-What is Minimum Permission, optimal (optional) permission, Refusing permission?
Minimum permission is the set without which assembly cannot execute (lower limit).
Optional permission - it is favorable (upper limit).
Refusing - Never allowed to gain these set of permission even if it is given by higher level of permission.
Q-What is Code access Permissions?
These are the permission sets that code can enquire for –
Type of Permission
Namespace
Class
Database Permissions
System.Data.Common
System.Data.Odbc
System.Data.SqlClient
DBDataPermission
ODBCPermission
OlePermission
SqlClientPermission
OraclePermission
Log Permission
System.Diagnostics
EventLogPermission
PermormanceCounterPermission
Directory Services
System.Diagnostics
DirectoryServicePermission
Printer Permission
System.Drawing.Printing
PrintingPermission
Network Permission
System.Net
DnsPermission
WebPermission
SocketPermission
System Resource Permission
System.Security.Permission
EnvironmetPermission
FielDialogPermission
FileIOPermission
IsolatedStoragePermission
ReflectionPermission
Q- What is Identity permission?
Permission to take particular resource depending on code credentials.
Q-What is Stack Walk and how we can override the default stack walk?
Override by Assert, Deny, Permit only.
Q- Type of security policy? What are the key elements of each of them?
Security policy is categorized –
Enterprise policy
Machine policy
User policy
Each of security policy has following Key elements-
Code group
Name permission
Fully trusted.
Q-What is the membership conditions (set of Evidences) for code group?
They are –
Application Directory – installation directory is a evidence.
Hash-The Assembly is hashed and that will act as evidence.
Publisher – code signed by particular publisher is a evidence
Site- code from particular i-net domain.
Strong Name- code with specified strong name.
URL- All code with specified URL.
Zone- Code with specific security zone.
Q What are the Permissions that are available?
Nothing – No permission
Execution- Only to run.
Internet- from unknown origin.
Local Internet – Code with in enterprise.
Everything – Everything except to skip permission.
Skipverification – To skip security checks
FullTrust – grant full permission to all resource.
Q- How the permissions are calculated?
Condition
Resultant Permission
Example
My code belongs to more than two code group
Union of two code group
FileDilaogpermission is given to Codegroup1
FileDilaogpermission is not given to Codegroup2
When you do FileDialogPermission.Demand() - Permission is there.
My Code belongs to Enterprise,
Machine,
User levels
Intersection of permission is given
FileDilaogpermission is given to Enterprise
FileDilaogpermission is not given to Machine
When you do FileDialogPermission.Demand() -
Permission is absent.
My code executes different method with different permission
Intersection of permission is given
Q- What is Exclusive permission and Level final permission?
Exclusive permission - On calculating the permission for Code groups, the group having exclusive permissions will have max points. There cannot be more then one Code group in a level with exclusive permission.
Level final - No further calculation of below Level is done when this is set.
Role Based Security
Q What is Authentication and Authorization?
Authentication - To validate the user credentials (may be by name and password) referred to as Authentication.
Authorization - To give access to secured resource for authenticated user is authorization.
Q- What are various ways for Authentication in IIS and ASP.NET?
Authentication through IIS (inetinfo,exe process) :
Anonymous (IUSER_MACHINE):
No Authentication is done (every user has all the rights)
Basic:
Windows User name and password is verified and information is passed through clear text.
Digest:
Windows User name and password is verified and information is passed in cryptic form. It requires that IE 5 or later
Integrated:
Windows user name and password is verified
Authentication through ASP.NET (ASPNET process):
None:
No ASP authentication
Windows:
The Authentication used by IIS is passed to ASP.NET
Forms:
The Authentication is done by user defined Form.
Passport -
The Authentication is download to Microsoft passport (www.passport.net ) via passport SDK installed .
Q What is impersonation?
It is Setup by virtue of which ASP.NET impersonate the IIS assesing user. i.e.
Q-Can we give authorization via Web.Config ?
Yes, using
< users="?">
It is to deny anonymous users.
Topic3-Enterprise Services (COM+)
Basics
Q- What are the services provided by COM+ ?
Central Administration – Use COM+ Catalog to manipulate the COM+ components.
Just in Time Activation-To use object as and when required.
Object pooling – Pool for frequently used objects.
Transactions-Use ACID principle from controlling multiple ,distributed transaction.
Synchronization-Concurrent access of multiple objects.
Security – COM+ Role based security access for authenticating clients.
Queued Components – Asynchronous messaging .
Events – To inform other components about significant events.
Q –What are the steps to create enterprise service component ?
1. Add Class library from VS.NET
2. Define the Configuration information in assemblyinfo.cs
3. Add following
- using system.EnterpriseService (first add Reference through VS.2003)
- then add
[assembly: ApplicationName("Name")]
[assembly: Description("Sample Application for Enterprise Services")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: ApplicationAccessControl(false)]
4. Generate .snk file using sn-k
5 .And then in assemblyinfo.cs add
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../../mykey.snk")]
[assembly: AssemblyKeyName("")]
6. Define interface
7. Create serviced component. derive it from ServicedComponent class
8. Register the component using regsvcs
View it in catalog manager.
Q- What are the type of Applications the COM+ has ? What are the factors that will influence our decision?
There are two types (denoted by [assembly: ApplicationActivation (ActivationOption.xxxx))
· Server Application
The Com+ application runs in its own process (dllhost.exe) and host DLL file.
· Library Application
The Com+ dll is made to run in client process
Factors:
Parameters
Server Application
Library
Performance
Low, Marshalling is involved
High
Fault tolerance
High,Server down will not influence the client.
Low,As client and server are both is same process
Security
High,We can explicitly configure using COM+ Security
Low,Client security features
Support for Com+
High, all feature are supported.
Low,
Object pooling
Queued Component
Security are not Supported
Q- What are the different types of registration possible for COM+ objects? What are pros and cons of each of them?
Dynamic registration
Manual Registration
Advantage
1. In Case of Web App ,XCopy registration is use full
1. It is only way to register in GAC
2. Both COM clients and .NET clients can invoke the COM+ methods
Disadvantage
1. All privilege will not be available ,that will generate error
2. Error can be found only after first go.
1. Requires an addition effort i.e. use regsvcs
Q-What ClassInterface Attribute? What are different ClassInterfaceType values that can be set? Explain there significance?
The CCW (COM Callable Wrapper) automatically generates the interfaces for COM+ clients using ClassInterface Attribute values. These interface method can be seen in COM+ Catalog.
There different types are–[ClassInterface (ClasIntefaceType.XXXX)]
Member Name(value)
Description
AutoDispatch
It is a default value. It will support late binding of interface to COM Client. There is no info in type library.
AutoDual
It will support late as well as early binding of interface. It generates all public elements in type library.
None
It does not generate any interface .In this case an Interface needs to be defined separately. this is recommended.
Q Why ClassInterface (ClassInterfaceType.None) is recommended ?
Problem with AutoDual-There are versioning problem. As AutoDual generates a type information, base class members and DispId depending on the position of Interface. The DispId generated creates the versioning problem has the next version will have different DispId. Hence the problem.
Problem with AutoDispatch- The settings enables only late binding because no DispId is generated. Hence it is limited to Script or interpreted environment (ex. VB 6.0, Javascript)
Due to above mentioned problem it is recommend to have ClassInterfaceType.None and derive the class from I
.
Q – How to use enterprise components?
1 .Add Reference to created object Component (use browse button) in .NET tab.
2. refer to System.EnterpriseService and the object
Q – What are the various methods of Service Component Class?
The class ServicedComponent has some protected methods that can be overridden for use with some of the services. All these methods –
Protected Method
Description
Construct
The method Construct can be overridden to get an object initialization string at object creation. The default construction string can be specified with the attribute [Construction-Enabled].
Activate
Deactivate
CanBePooled
The methods Activate, Deactivate, and CanBePooled are used for pooled objects.
Dispose
Calling Dispose releases the unmanaged resources held by the serviced component. With the exception of JITA-configured serviced components, you should invoke Dispose to release resources early. With JITA, there is not a 100 percent rule, as discussed later in this chapter.
Q- What are the class attribute of Service component?
With the class, you can specify many attributes to influence the use of services.
Attribute
Description
Description
This attribute was already discussed with assembly attributes. Not only can it be used to describe the application, but it also can be used to describe the component.
MustRunInClientContext
The attribute [MustRunInClientContext] means that if the context of the caller is not compatible with the required context of the component, an exception is thrown.
EventTrackingEnabled
Applying the attribute [EventTrackingEnabled] allows monitoring of the serviced component.
ConstructionEnabled
With the attribute [ConstructionEnabled], the system administrator can define a string that is passed to the component at initialization time.
JustInTimeActivation
The attribute [JustInTimeActivation] is used to decrease the load with the server, because the component itself can decide when it should be deactivated.
ObjectPooling
If the initialization time is longer than the method execution time, you can think about creating an object pool. This is done with the attribute [ObjectPooling].
PrivateComponent
If a component should only be used within the application, it can be marked as a private component. This option is only available with COM+ 1.5.
Synchronization
To get synchronized access to the component from the .NET Enterprise Services runtime, the [Synchronization] attribute is used.
Transaction
With the [Transaction] attribute, we can specify transactional requirements of the component.
SecurityRole
This attribute defines roles that can be used with the application. Applying this attribute to the class has a different meaning; here it means that users of this role are allowed to access the component.
COMTIIntrinsics
With this attribute, a transaction from the COM Transaction Integrator can be passed from the outside to the context of the class. This can be used to integrate IBM Customer Information Control System (CICS) and IBM Information Management System (IMS).
Eventclass
The attribute [EventClass] is needed for loosely coupled events.
InterfaceQueuing
The attribute [InterfaceQueuing] can be applied to both the classes and the interfaces. Calls on methods of the class/interface are queued with the help of queued components.
ExceptionClass
For queued components, this attribute marks a class to handle errors.
LoadBalancingSupported
If the load-balancing service is installed, this attribute allows the component to make use of this service.
Q –What is context? What is light weight proxy?
It is the runtime environment for instance of COM+ object. Each object will have exactly one context (i.e. if Object A belongs to Context1 then Object A will never belong to other context) but each context can have several objects.
Now for a Com+ object a process is broken into apartment then into context. To have cross apartment communication proxy (thread switch) is used, while for cross-context and in same apartment, lightweight proxy is used (no thread switch).
Q –What do you mean by instance mgmt? What are the option for instance Mgmt in Com+?
To manage the object at runtime with higher efficiency is called instance mgmt. Object pooling, Just in time activation are major example of this.
Object Pooling
Q-What is object pooling? What are different attribute in .NET?
COM+ maintains the pool of objects that can be recycled instead of disposing it.
In .NET following setting has to be done –
[ObjectPoolling (true, 1, 4)] - It’s a attribute that has to be applied on the class .The parameter indicates pooling status, Max and min pool.
Q –What are the Requirements or Restriction on Pooling?
Following are the Restrictions –
1. The Com+ object should aggregate i.e. the Wrapper should use AddRef () and Release() functionality of COM. So in ATL component remove DECLARE_NOT_AGGREATE () Macro.
2. The Pooled object should not have thread affinity i.e. thread Local storage or STA should not be used. So the threading model can be MTA or NTA.
So, if your client is –
STA mark your component as both (STA and MTA)
None NTA
MTA Both
3. Pooled object cannot display UI (event driven like windows) because UI requires STA message loop.
4. VB 6 uses STA and local storage hence COM_ component cannot be developed.
Q –What is method that has to be overloaded for object pool?
CanBePooled ()
Just in Time Activation (JITA)
Q- What is JITA (Just in Time Activation)? What is the attribute that needs to be added? What are the methods that have to be overloaded?
JITA is a way by which object is created or activated only when it is needed i.e. when method of the object is called. The attribute [JustInTimeActivation ()] needs to be added on class and [Autocomplete] for the method that uses this scenario. There are two methods that needs to be overloaded –
· Activate ()
· Deactivate()
Q- What is are different ways of Deactivating or disposing the object in JITA?
Using [AutoComplete] declarative statement and,
ContextUtil.DeactivateOnReturn=true.
Q – If the JITA is not set from Component Catalog, What will happen to [AutoComplete] Statement, ContextUtil.DeactiveOnReturn?
It will ignore for [AutoComplete] and exception will be thrown for ContextUtil.DeactiveOnReturn.
Q –What is idle time management?
As the objects in object pool can run for infinite time (if min pool size is mentioned), there is an idle time setting in component catalog to manage this.
Q – What is an Apartment? What are there different types?
An apartment in simple terms is a imaginary synchronization boundary i.e. if client object and Server object have incompatible threading characteristics then apartment is used. Now, if a thread uses COM and creates a object is assigned apartment (may be same or different).
Note: If client and server are in different process then automatically they are in different processes.
There three types are
· STA (Single thread apartment)
A single thread will be responsible for many compatible objects i.e. Single thread will pass message between different objects. Many STA is possible in a Process. There is message pipeline that is maintained by Thread.
· MTA (Multiple Thread apartment):
Many Compatible threads with many compatible objects.
· NTA or TNA (Neutral thread apartment)
??
Transaction
Q – What is Transaction? And what is ACID principle?
Transaction is collection of operation that either all succeeds or fails i.e. if all individual operations succeeds then Transaction is committed else even one failed operation will result in Transaction rollback.
It is a basic property of Transaction (ACID principle) - Atomic, Consistent, Isolation and Durability.
Q – What are resource managers?
These resources (such as SQL database, oracle database, Message Queue etc that have following features –
· They can participate in COM+ transactions
· It notes down all the changes done by each transactional application and can commit or rollback only when it is told so.
· It has property of en-listing i.e. it knows that particular transaction needs it, so it will en-list.
· It maintains data in Durable and isolated from other transactions.
· It also votes for transaction result, i.e tells weather it is ready for commit.
Q – What is Transaction Root? What is Two-phase Commit process?
Transaction Root is a COM+ object, that is first to take part in particular transaction.
Two phase Commit:
At the end of Transaction the COM+ steps back and checks for combined votes ,if all votes are positive then two phase Commit starts –
Phase One(prepare phase) :
All participating Resource managers are asked, if they can commit the transaction.
Phase Two (commit/rollback phase)
If Answer to question is ‘Yes’, then all resource managers are asked to ‘commit’.
If Answer to question is ‘No’ from even one of the resource manager, then all resource managers are asked to ‘rollback’.
Q –What is DTC (Distributed Transaction coordinator)?
It is system services (windows provided) tightly coupled with COM+. It coordinates the activity during two phase commit.
The DTC on the root machine instructs all the DTC to collect the resource manager vote for first phase .The root DTC collects all the votes and starts phase two by instructing all the DTC to either commit or rollback the transaction.
Q –What are the different attribute of Transaction, with meaning?
They are
Required NEW - The Context will run in new transaction always. i.e. always new transaction is created.
Required - The Context will run in the context of Creator, if creator has transaction else new transaction will be created.
Supported - The Context will run in context of Creator, if creator has transaction else not in any transaction.
Not Supported - The Context will not be part of any transaction.
Disabled - ???
Q –What are DONE, CONSISTENT, ABORT bit? Explain there working?
They are –
DONE bit – It is used for JITA indicating that object has done its work and can be deactivated.
CONSISTENT bit – It is used for vote of transaction.
ABORT bit- To abort the transaction.
Working:
At creation of Root object the DONE and CONSISTENT bit of Root is set to false and ABORTS to true. As the Root object creates another object again DONE, CONSISTENT=false and ABORT =true for this object and it continues for all child objects.
Now , as a object is completed with transaction and if it is happy about it ,the CONSISTENT bit is set to true and at the end object is deactivated with DONE bit =true. Same action of DONE and CONSISTENT bit is repeated for all objected.
At last, for Root object the CONSISTENT and DONE bit is evaluated. At any given object evaluation, any of DONE or CONSISTENT bit is evaluated to be false ,corresponding ABORT bit is also set to false and the transaction is rolled back.
Q – What are the ContextUtil method that influence the DONE and CONSISTENT bit?
ContextUtil Method
Done bit
Consistent bit
Transaction State
Object state
SetComplete()
True
True
Committed
Deactivate
SetAbort()
True
False
Abort
Activate
EnableCommit()
False
True
Commit
Deactivate
DisableCommit()
False
False
Abort
Deactivate
Q- What are the Granulites in which COM+ Component can participate in Security?
The gratuity with respect to entire component, interface or method level allocation for particular role.
Q What is the master control switch? What is different level of Authentication? What is different level of Impersonation?
The Check box in Security tab “Enforce access checks . . .” is a master controller.
Levels of Authentication :
None : No checks are done
Connect : Only at first call the Authentication is checked ,but once connection is established COM+ will remain out.
Call: Identity is checked for every method call but the data is not checked.
Packet: Each packet is authenticated but the packet data can still change .
Packet integrity : With packet authentication the checksum is also done.
Packet Privacy: With checksum the encoding is also done.
Impersonation Level :
Anonymous :Least Security impersonation level
Identity : Only on server identity
Impersonate : Only on clients identity on same machine .
Delegate : clients identity in any machine.
Topic 4 -Using COM Component from NET
Q – How COM Components can be used by .NET?
A proxy RCW (Runtime callable wrapper) is placed between COM and .NET to interoperate . There are two ways –
- Use command line tool tlbimp.exe (type library importer) .
- Using Add reference in VS.NET .
Q – What PInvoke ,how it is used ?
Topic 5-Deployment
Private Assemblies Deployment
Q – What are the different ways in which private assemblies can be deployed? What are various ways to find out dependences of application?
Simply copy the required .exe and the required .dll to folder of interest.
The dependencies can be found by using ildasm.exe or .NET configuration wizard .In ildasm just drag the application and .NET configuration use Application option.
Q- What is probing? What is binding? How does CLR probe the application dependencies?
Searching for all the depended elements for an application is termed as probing. When depended element is found the CLR binds with application. CLR probes with following sequence
AppBase/
AppBase/
AppBase/PrivatePath/
AppBase/Private Path/
Here AppBase = Installed application folder
Q – What are the ways to set the Probing path inn .NET?
The probing path can be set using –
-
- .NET configuration tool ,specifying additional path
Application/
Q- How will you diagnose for failure of probing?
The tool fuslogvw.exe can be used to display for the failed assembly.
Deploying Shared Assemblies
Q What is strong name? How it is generated? What is the process of verification used by CLR?
Strong name consists of Simple Name, Version number (
It is generated using sn –k
The Strong name consists of public key token that is stored by Assembly manifest. And the Assembly as private key that is obtained by hashing and encoding the public key and is stored with Assembly.
When the CLR verifies an assembly, it reads the public key from assembly manifest using the algorithm (i.e. hashing and encoding) to get private key.
The private key of Assembly and the algorithm generated is compared and validated.
Q- How shared assembly be added to GAC ?
Following are the ways –
Through windows explorer - Open windows/assembly folder then drag the DLL and drop it.
Through .NET Configuration -Open the .Net Configuration folder right click the Assembly Cache item and add the DLL.
Through gacutil : In VS.NET command prompt gacutil /I
Q What is the binding policy for Shared assembly ?
In order to bind the shared assembly CLR uses three XML based files
Application Configuration files – It will have the path of assembly with version information.
Publisher Policy Resolution – It will have version of the assembly that needs to be referenced for correct working.
Administrator policy Resolution – The binding rules are specified in machine.config file .
- Now, the CLR uses above XML files to located the proper assembly .
- If the Assembly is loaded then CLR will nor attempt to load
- If the assembly is in GAC then it is loaded from GAC.
Q – Explain Side by Side Execution scenario ? Explain how to configure these ?
Side by side execution means multiple version of same DLL . It can be configured by
With .Net configuration tool
- Application Configuration files (.config file client side) (Application tree)
- Administrator Policy (machine.config client side)
(Configured Assembly)
- Publisher policy (with dll server side)
(new dll and then al.exe to compile)
Q – What is delay signing in Assembly? How it is done?
Delay singing of Assembly is a way to delay the verification by GAC and executing component of strong name. The Strong name has private ,public key has one of its requirement. But in delay signing the
sn –p publicprivate.snk public.snk will be issued and in
assembly.cs
[assembly:AssemblyDelaySign(true)]
[assembly:AssemblyKeyFile(“public.snk”)] is issued. By which the executing component will delay the verification (off).
Now,in order to make GAC delay the verification following is issued –
Sn.exe -Vr
Sn.exe –R
Turn on velification
Sn.exe –Vu
Note :al.exe also can be used for same.
Q What are the type of Setup and Deployment project does VS.NET Supports ?
- Setup Project – For Setting up Window Application, Window Service ,Console Application.
- Web Setup Project – ASP.NET Web application and Web Services
- Merge Module - It is an .msm file. They the package that are merged with the installer packages of the particular application.
- Cab projects - These are the cabinet files that create the package in compressed format that can be used for copying in floppy or CD.
Q- What are the various type of editors the VS.NET 2003 provides for Deployment ?
Following are the editors that VS.NET provides –
- File System Editors - Used to manipulate the target machine folder. These are the special names that this editors provides e.g. USER’S Desktop, Application Folder, Program Files, Common Files etc.
- Registry Editor - This is an editor that provides the facility to specify the key , sub key and values. We can also import the registry files.
- File Type Editor – This editor enables to associate the file extension with action in the application. for e.g. the .qty or .txt should open or print etc.
- UI Editor – The Setup UI at Start, Progress and End can be specified. Both administrative and User interface can be manipulated.
- Launch condition editor – The minimum condition that needs to be evaluated while installing is calculated.
- Custom Editor – Certain important functionality like executing a script or database manipulation can be done. There are 4 Phases Install, Commit, Rollback, Un Install..
Setup and Web Setup supports all type of editors but merge module does not supports UI Interface and Launch condition. The CAB does not support any of these.
Q – What are the ways in which Web Project can be deployed?
It can be deployed –
- Copying manually.
- Using Copy Project command in VS
- Using Win Installer package
Q –What is Boot strap executable ? Is the .NET Framework Required for any Installation to work ?
In the Setup folder there will be setup.exe (bootstrap) executable. These bootstrap will look for MSI Installer ,if not present then it will be installed using insallMsiA.exe or installMsiW.exe and then instruct the installer to insall.
Yes! .Net framework is required.
Q- How can the setup project be configured ?
It can be configured using Configuration set up i.e. right clicking the project property. Following can be configured –
- output file name
- Package to done – As CAB ,loose uncompressed file ,in set up file.
- Bootstrap- Specifies weather setup.exe to be created or not.
- Compression – type of compression (by Speed or by Size) .There is a trade off for each type of sepcifaction.
Topic 5-WebService in .NET
Q –What are the Technologies that web service depends?
There are Four essential paradigm that Web service depends-
- Discovery (UDDI Disco)
- Description (WSDL,XML Schema ,DOCS)
- Message Formatting (SOAP)
- Encoding (XML)
- Transporting (HTTP,SMTP and so on)
SOAP
Q – What is SOAP? What are the basic building blocks?
It is a XML based messaging protocol. It Contains
- Essential envelope MUST.
- Optional header
- Essential body MUST
- Optional fault
Hence ,
Q – Explain Soap
Soap
Authenticate
Security Digest information
Routing information
Transaction
Payment information
mustUnderstand=1 attribute is used in Header tag to denote the client should adhere to the header information.
Actor=URI is the intermediary (i.e. not an end point of message) .
Q –What is Soap Body Element used for? What are the categories of Soap binding and use style Messages ?
Body element of Soap contains message that the user wants to pass. It can be categorized has –
- Procedure oriented Message i.e. RPC Message
It is two way communication of message . It contains request and response . In request the method and parameter signature is present.
- Document orientated message
It is basically one way communication containing XML document as parameter.
Use Style are
Encoding and literal ,So in effect there are –
- RPC Encoding
- RPC literal
- Document encoding
- Document literal
And in addition document literal wrapped
Q – What are RPC and Document messages? What are encoding and literal?
The RPC is the Remote procedure call i.e. the procedure call in remote machine and the result or response back to current machine.
The document is the message or the document that is send /received from/to remote machine.
RPC Encoding –
It is Straight and simple but cannot be validated after converting into SOAP and not WS-I compliant
RPC literal -
It is simple and WS-I compliant but cannot be validated easily.
Document Encoding -
Not used and not WS-I compliant
Document literal –
It can be validated as schema is in Soap message and is Ws-I compliant but bit complicated.
Document literal Wrapped
It can be validated as schema is in Soap message and is Ws-I compliant but very complicated. It does not support overloaded web service method.
Hence best is Doc/lit wrapped i.e..Net Web service uses.
Q –What is
Under Body element there can be fault code that describes the fault code ,fault string(description) ,fault factor (url of fault) and details. Major fault code are
- versionMisamatch code
- mustUnderstand violation
- Client
- Server
Q- What is Soap Encoding ? What encodingStyle attribute ?
The Method by which Soap serialize and de-serialize the data is called encoding technique. The encodingStyle attribute will specify the style for either entire document or for an element. The URI of encodingStyle can specify the Schema.
Web Service Description Language (WSDL)
Q What is WSDL ? What is Syntax of typical WSDL file?
It is an XML based way to describe the Web service, so that client can extract the proxy class out of it.
It has Syntax
Definition :
Types
Message
It contains various method and parameters in the method.
PortType
It contains various
Message Operation Types –
With the various combination and order of
WriteStartAtribute
Start collection of attribute
WriteStartDocument
Write Xml 1.0 prolog
WriteStartElement
Writes specified Xml start tag
WriteString
Writes string content
Attributes of XmlTextWriter
Formatting
It can be None,Intended
Intentation
Intentchar
Gets or sets the white space char
Q- What are the various limitations of XmlWriter ?
- Cannot validate the character
- Cannot check for duplicate attribute
- It does not validate against any Schema.
XmlDocument
Q- What are XmlDocument class? Explain its different properties and methods?
It is confined to XMDOM Core 2.0 specification . it is used to create, manipulate, search specific or collection of xml node/nodes. All the operation are done in Memory. i.e. Entire XML file is loaded in memory and then manipulated.
Some important properties –
Property
Description
DocumentElement
Get root node of document
InnerXml
Get or sets the Markup of document element
Some important method-
Method
Description
CloneNode
Clones the Document
CreateAttribute
It create attribute
CreateCDataSection
It create CData
CreateCommnet
It create Comment
CreateElement
It create Element
CreateNode
It create node
GetElementById
Get Elements by given id
GetElementsbyTagName
Return the list of Elements that matches Tag
Load,LoadXMl
ReadNode
Reads the XmlNode of current object
Save
Q-What is XmlNode Class ? What are various attributes and Method?
It is base class of Document (XmlDocument) and is an abstract class .
The attributes are –
Properties
Description
Attirbutes
Collection of attribute of current node
ChildNodes,FirstChild
HasClildNodes
Indicates weather current node has child
InnerText
Get or Sets the text of current node
InnerXml
Get or Set the Xml
Method of XmlNode-
InsertAfter –
InserBefore-
SelectSingleNode-
SelectNode-
RemoveChild-
RemoveAll –
XPath and XNavigation
Q- What is XPath? How various expression are given in XPath?
It is XML technology that is used to search path in the XML document in Random fashion.
Various XPath –
/Books/Book/Author – Select Author from the Root
//Author-Select nodes of Author
/Books/*/Author – Grand child of all author where child can be anything
/Books/Book/@pages – pages attributes under Book
//@pages – all pages attribute
//Book/@* - all attribute under Book node
/Books/Book/Publisher[.=”Addison “] – All Publisher named Addison under Books
or
/Books/Book/[./Publisher=”Addison “]
/Books/Book[./Pages>=100]
All pages greater than 100
/Books/Book[Starts-With(Title, ’A’)]] - All books start ing with ‘A’
Few more functions are –
Concat() – joins two string
Contains () – Detetime weather one string contains other
Count()- Count occurrence of element
Last() – Last element in the colletion
Normalize-space()
Not()- Negates the argument
Number()- converts argument to number.
Position() – Node with its parent
Starts-with() –
String-length() –
Substring()-
Q- What is XPathNavigator ? How to obtain the object ?
XPathNavigator is a class that provides with the functionality to move in the XML document faster. It can be created with –
XPathDocument , XmlDocument,XmlDocument.
Q – How will you get XML Schema from XML document ? How will you validate ? How would you validate the XML
XML Schema can be obtained from XML document
- Loading Xml document has DataSet and then using ReadXMLSchema or InferXMlScheam
- To use xsd.exe
The main difference between InferXMLSchema and ReadXmlSchema is that Infer will take additional parameter to ignore the namespace.
Validatioin is done by using XMLValidatingReader Class.
Using SQL Server to generate XML
Q – How SQL Server can be used to generate XML ?
Various XML clauses are –
FOR XML RAW
Each element will have
FOR XML AUTO
Each element will have Table Name in element and each field as attribute
FOR XML AUTO ,ELEMENTS
Each element will have Table Name in element and each field as Element
FOR XML EXPLICT
User defined XML Tags
FOR XML AUTO,XMLDATA
Functionality of AUTO + XMLSCHEMA also
Through SQLCommand.ExecuteXmlReader() can also be used to generate XML with above FOR XML Clause.
Windows Services
Basics :
Q –What is windows service ? What are there general characteristics ?
Window Services are the background processes that conforms to Service Control manager(SCM) . The SCM is a part of Windows OS that unifies the way various services work.
Following are the Characteristics of Window services –
1- Conforms to SCM – The SCM exposes set of well known interfaces .These are implemented by Services to conform to basics functionality of Window servicing. Some of the important message are Start, Stop, Continue, Pause. Etc
2- Lack Of User interface – Most of WS (windows service) do not have UI and work at background.
3- Specific User Identity – Either System User Identity or Specific User Identity. It may not be logged on USER. Each WS has its own user identity.
4- Separate Window Process-
5- Special Install Procedure
Q – Explain the Architecture of Windows Service ?
It contains five main component –
- Service database
It consists of
· Path of Service
· Security settings
· Start up parameter
- Service Installed
· The name that uniquely identifies while instaaling
· Accounts password and username.
· WS process is created
· WS Started
- Service Control Manager(SCM)
· Accepts install and uninstall of Service
· Starts WS while window is started or on demand
· Enumerates installed WS
· Transmits Start, Stop, Pause etc to Service
· Locks and unlocks WS Database
- Service in Execution
- Service Controller
· Start, Stop, Resume, Pause, Query, install, uninstall.
Q- What are the various Windows services support class that is provided in FCL (framework class library) ?
The name space is
System.ServiceProcess
The Classes are
- ServiceBase – It includes base functionality for Services.
- ServiceProcessInstaller and ServiceInstaller- Using installutil.exe the Services can be installed
- ServiceController – To connect to service and perform various operations such as Start, Stop, Continue etc
.
Q –What are the main properties and method of ServiceBase Class?
The Properties are –
Properties
Description
AutoLog
“true” then it logs the call in Application event log to onStart(),OnStop(),OnPause(),OnContinue() methods
CanPauseAndContinue
“true “, The service can pause and continue.
CanStutDown
“true”,When system shutdown the Service should be notified
CanStop
“true” ,the service can be stopped if started
EventLog
“true”,Logs into Event log Customized message on OnStart() and OnStop().
ServiceName
Name of the service
The Methods are –
Method
Description
OnContinue
The SCM sends a continue message the method is called
OnPause()
The SCM sends a pause message the method is called
OnStart()
OnStop
Run()
Main entry point for service to run
Q –What are important Classes that helps in installing WS ?
These classes are –
- ServiceProcess.ServiceProcessInstaller – These class creates record for all the WS in an Application into WS database. We can have just one instance of this class /Application.
- ServiceProcess.ServiceInstaller – These class writes WS information into WS database . There can be many instances of this class per application i.e. per WS there is one instance.
- Configuration..Install.Installer –It acts an entry point for Installation. It can contain instance of ServiceProcessIntaller and many instances of ServiceInstaller
Q- What are the important properties of ServiceProcessInstaller and ServiceInstaller Class?
Properties of ServiceProcessInstaller –
Account
Type of account under which user runs.The values can be LocalSystem,LocalService,NetworkService,User
Password ,Username
For Account=”User” ,then specify Password
Properties of ServiceInstaller –
DisplayName
The user read able Name .
ServiceName
Specifies unique name which system identifies
ServiceDependOn
Specifies the array of WS that must run before this service runs.
StartType
Automatic,Disabled,Manual . When the Service stars .
Q What are the Ways to monitor the WS ?
Two ways –
- Windows MMC
- VS.NET Server Explorer ->Service
Q What are the different utility for WS ?
Installutil.exe
To install the WS
Net
To Enumerate various services
- NET START
To Start
- Net Start
To Pause
- NET PAUSE
To Resume –
- NET CONTINUE
To Stop
- NET STOP
SC.exe (only in XP,2003)
To Start, Stop ,Pause ,continue ,Configure, query etc
Q – Explain ServiceController class with various properties and methods ?
The Class is used to access functionality of already created Windows service ,the functionality can be accessed programmatically.
The basic properties are -
Properties
Description
CanPauseAndContinue
True indicates service can be paused and resumed
CanShutdown
True indicates that service should be notified while shutting down
CanStop
True means service can be stopped after start
DisplayName
Friendly Name of the Service
MachineName
Name of Computer in Which WS is working
ServiceName
Name of WS
ServiceDependsOn
Set of Services on which Servcie depends on
ServiceType
How the ES is used.
InteractiveProcess –Can communicate with desktop
Win32Process – runs in its own process
Win32ShareProcess – Share process with other WS.
Status
Retrives Status of WS.
The basic methods are –
Method
Description
Close()
Disconnects the WS with Application
Continue()
Continue the WS .
ExecuteCommand()
Execute Custom Command in WS
GetServices()
Gets The list of Services on Machine
Pause()
Pauses the WS
Refresh()
Refresh all properties with latest
Start()
Starts WS
Stop()
Stops the WS
Tracing and Debugging
Tracing and Debugging
Q -How will Tracing and Debug be enabled using VS.NET ? What are the Methods and property?
The Tracing and Debug can be enabled by using DEBUG symbol in VS editor. Only Tracing (i.e. TRACE) will be enabled in Release mode.
Some of the Properties are –
AutoFlush
Specifies flush should be called after every write
IntendedLevel
Specify indented level
IntendedSize
Specifies number of Spaces
Listerners
Specifies listeners that are monitoring
The Methods are – (All method are Static)
Assert()
Checks the condition and displays the error if condition is false
Close()
Flushes the output buffer and closes the listener
Fail()
Display the error message
Intend()
Increase the current level of intend by one
Unintend()
Decrease the Intended level by one
Write(),WriteIf(),WriteLine(),writeLineif()
Writes the content to listener, if the condition is true(writeIf)
Q-What are the types of listeners?
There are three types of listener and they are available in System. Diagnostics namespace
Customize listener – TraceListerner .
DefaultTraceListner - An object of this class is automatically added to Listerner collection. It write message to OUTPUT window
TraceListrerner – Write message to any stream Class.
EventLogListerner – Write message to Event log
E.g
Trace.Listerners.Add(new EventLogTraceListner());
Trace.Listerners.Add(new TraceListerner(stream));
Q – What are the ASP.NET Tracing facility ? How web.Config file is set?
In addition to above trace and debug the ASP.NET has facility to view the trace using Trace.axd url .
Following is the setting that can be done
requestLimit=”10”
pageOutput=”false” /true
traceMode=”SortByTime” /SortByCategoery
localOnly=”true”/false
/>
enabled – Tracing is enabled
requestLimit – Limit of Request for which data has to shown
pageOutput – to show in same page
traceMode- to Sort by time or Sort by Category
localOnly - to show the page to client or Not.
The page can be viewed by
Localhost//virtualdirectory/trace.axd
Debugging
Q How to handle the Exception Messages? What is the tool for debugging ?
Debug->Exception can handle it.
Tool is
Dbgclr.exe
Q –What are the Steps to setup a machine for remote debug ?
Steps are -
- in remote machine the mdm.exe should be running
- If it is not present ,then install VS.NET with Remote Component setup enabled
- Ensure that you are the member of Debugger User Group, for ASP.NET application you must have admin privilege on remote M/C.
- On Local m/c ,Set Enable Remoting Debugging Enabled to true. The Exe that is being debugged must be in Sharable folder.
- Add Remote Debug Machine option with the name of the machine.
Q – How will you debug DLL files and Client side script ?
DLL files can be debugged by attaching the DLL.
The Client script debugging can be done –
- IE can only be debugged
- The Script debugging should be enabled in IE (Tools ->Ie Options-> Advance Tab)
- Attach ieExplorer to the debug
Q- How to debug WS ,Remoting ?
WS,Remoting can be debugged by Attach process.
COM+ Debugging ??
Q – What are the Trace switches ? what are the Types ?
There are BooleanSwitch and TraceSwitch .
BooleanSwitch – It has two modes Off and On and default is On.
TraceSwitch –It has five level ,
0 – off
1 – Only Error
2 – Error ,Warining
3 – Error ,Warning,Info
4 – Error,Waring,Info,Verbose
Important Properties
Level – Trace level enumeration
TraceError – returns true if Level is set to 4 otherwise false
Traceinfo – returns true if Level is set to Info or verbose
TraceVerbose – returns true if Level is verbose
TraceWarnig – Info is set to true.
To add in Web.config file
Q – What are the Conditional compilations? What is the attribute that is used to define it?
There are various conditional compilations –
# if #else #elif and #endif
#define and #undef
#warning and #error
#line
#region and #endregion
The attribute is [Conditional(“DEBUG”)]
Note : The method should return void for the above attribute.
Q – What is the EventLog class ? What are the important methods and properties ?
EventLog class is used to log the event log messages into log. The important method and properties are –
CreateEventSource()
Create event source for application to write
Delete()
Removes the log message
DeleteEventSource()
Removes the application event source form event log
Entries
Get the content of Event log
Exists()
Determines weather specific log exists
Log
Specifies name of the log to write and read
LogDisplayName
Represents friendly name for the event log
SourceExits()
Checks if source Exits
WriteEntry()
Writes to log file
Subscribe to:
Comments (Atom)