Today, I cleared MCTS:SQL Server 2008 Bussiness Intelligence ..I had been working with SSRS (Report builder 1.0) from past 2 Yrs and some portion of SSIS. But, lacked in SSAS and SQL 2008 Environmet, for which I exceuted internal project for my Company. It was second shot option that saved the day..Thanks microsoft for that. For prepration, I had gone thru - 1. Expert Cube Design Book 2. Worx Publication , Proffessional SSIS 2008 and MS Training guide of 70-448, Also i took measureup test I belive, the first time was an experience that gave me my limitation.
In Second shot,I looked the MS training kit seriously and Measureup m managed to pass.
Hurray! At last success. I passed 70-526 after second attempt,taking advantage of MS second shot. At first shot of the exam time. It was spins of Deployment and Print documnet that bowled me out. I scored 678, a mere miss.
Then, Praticed a lot for Deployment(Clickonce) and got through with PrintDocument,PrintPrivew Etc.
I think,prepration with MS Traning Guide is not enough. The Pratice with example is also neccessary.
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...
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.
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.
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.
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.
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.
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
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:
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= />
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.
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
- 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
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).
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
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.
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.
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.
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
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
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
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
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 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.
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.
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 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.
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 – 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 .
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.
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
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.
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.
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.
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)
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 , ... ... ... ... ... ...
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
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.
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
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
/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.
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.
- 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
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
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 .
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
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
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.
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