TechBubbles

Archive for August, 2008

Web slices and Accelerators in IE 8 Beta2

Introduction

The new version of Internet explorer IE 8 Beta2 providing some cool features like Web slices, Accelerators, Ajax Navigation and Developer tools. More you can find at IE 8 Beta 2 features for Developers.

Web slices in IE 8

In order to have your favorite sites up to date on your favorites is really time consuming. IE 8 brings you web slices  through which you can keep your favorite web sites up to date.

Webslices

It tracks the web site that you added to the web slices. A flash will appear when ever a update is in the site.

Subscribing to the available web slices in the web site is as simple as adding the sites to the favorites.

webslicesSub

Accelerators in IE 8

using Accelerators you can gain access to your favorite online services like searching,shopping and emailing in a click.

You  can search,map,email or translate , share content from any web page that you are currently viewing by just one click. Accelerators are being added to the IE gallery to enhance the user browser experience.

Accelerator

Select the content on the web page that you are browsing and right click on it Accelerator icon will appear as shown above with a set of options like email,map and Blog the text just by a click.

Adding Accelerators to your browser

You can add more accelerators to the browser by clicking on the Accelerator icon on the web page then find more accelerators the say add it will added to your favorite accelerators.

AcceleratorsAdding

Related Posts:

2 comments

Internet Explorer 8 Beta 2 Features for Developers with examples

Introduction

IE 8 Beta 2 provided the decent features to the  designers and developers community. If you write the code for IE 8 Beta 2 that can run on anywhere.

It means it is allowing developers and designers to develop applications with Interoperability and web standards.

  • CSS 2.1 complainer.
  • HTML 5.0 standards supported.
  • Ajax navigation and enhancements supported. 
  • Implementing DOM storage for HTML 5.0
  1. IE 8 is different from IE 7 in AJAX enhancements and Navigations

Ajax navigation

Enables the in place navigation when you are browsing maps for a particular location you may use the zoom option in the maps. Each and every zoom action will be stored in the travel history which is highlighted in oval.

2. DOM Storage in Connectivity events

 

When you are writing BLOG post or checking an e-mail aDOMstoraget airport if suddenly connections drops then it prompts you to save the typed data on offline. Prompt is highlighted in the oval.

It also allows you cross domain communication and messaging using HTML standards.

3. More Server Connections for better performance. currently allowing 6 earlier it is 2.

4. Document mode Compatibility- No need to write any code for to render the content which is developed in earlier versions of the Internet Explorer. By placing a simple meta tag instructs the IE 8 to render the earlier browser versions content in right format. So IE8 providing full document compatibility mode.

DocumentCompatibility

If at all the content not rendered properly in IE8 beta it suggest through compatibility button in address bar to best view version.

5. IE Developer tools- allows the developer to debug the java script and in place HTML and CSS changes. (Shift + F12 ) is the keyboard short cut for opening the debugger tool.

 tools

  

The developer tool looks like

debugger

You can view the page in different IE versions using the above tool. we can call this feature as site preview.

5. Profiling the web sites-

profiler

we can check application performance and bottle necks using above built in profiler.

6. Extending the service integration through web slices and Accelerators.

    Implementing the web slices and Accelerators is easy.

 

You can download the Internet explorer 8 beta 2 for exploring the features.

Related Posts:

2 comments

Validating XML Document Using XSD in C#.NET

Introduction

This post explains how to apply  XML Schema Definition Language(XSD) to Extensible Markup Language (XML) document. Basics of XSD.

Create an XML Document

  1. Start Visual Studio .NET
  2. Create a new XML File.
  3. Add the following data to the XML Document
<Employee EmployeeID="123">
   <EmployeeName>James Bond</EmployeeName>
</Employee>

  4.  Save the file as Employee.xml file 

Create the XSD Schema, and Link to XML Document

1. Start Visual Studio .NET

2. Create a new empty text file

3. Add the following XSD Schema definitions to describe the XML document.

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:element name="Employee">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="EmployeeName" type="xsd:string"/>
         </xsd:sequence>
         <xsd:attribute name="EmployeeID" use="required" type="xsd:int"/>
      </xsd:complexType>
   </xsd:element>
</xsd:schema>

4. Save the file as Employee.xsd 
5. Open the original Employee.xml file, and link it to the XSD schema as follows
<?xml version="1.0"?>
<Employee EmployeeID="123"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="Employee.xsd">
   <EmployeeName>Rugby jersey</EmployeeName>
</Employee>

6. Save the modified xml as EmployeeWithXSD.xml.

Validate XML Document

1. Load the EmployeeWithXSD.xml using XmlTextReader as follows:

XmlTextReader r = new XmlTextReader("C:\\EmployeeWithXSD.xml");
XmlValidatingReader v = new XmlValidatingReader(r);
v.ValidationType = ValidationType.Schema;
v.ValidationEventHandler +=
   new ValidationEventHandler(MyValidationEventHandler);
while (v.Read())
{
   // Can add code here to process the content.
}
v.Close();

// Check whether the document is valid or invalid.
if (isValid)
   Console.WriteLine("Document is valid");
else
   Console.WriteLine("Document is invalid");
public static void MyValidationEventHandler(object sender,
                                            ValidationEventArgs args)
{
   isValid = false;
   Console.WriteLine("Validation event\n" + args.Message);
}

2. Build and run the application to use the XSD schema to validate the XML 

    document.

Related Posts:

4 comments

XML Schema Basics(XSD)

Introduction

This post gives a basic overview of XML Schema and how to use in development. XML schema describes what XML document contains and content of the XML document what fields and sub elements it can contain.

Standards for Describing XML Document

  • DTD : was the First formulized standard.
  • XDR: Much comprehensive standard than DTD.
  • XSD: Currently de facto standard for describing the XML documents. There are two versions in use 1.0 and 1.1. An XSD schema it self is a XML document.

XSD Elements

Elements are building blocks for any XML document, element defines the structure of the XML document. The following is the syntax to define the element in XSD Schema.

Example:

<xs: element name=”abc” type=”xyz” /> 

  1. An Element must have the name property, the same will appear in the XML document.
  2. Type property describes about what can be contained in the element when it appears in XML document. eg: xs:string, xs:integer, xs:boolean or xs:date

Example:

Sample XSD

<xs:element name="Employee_dob"
                    type="xs:date"/>

Sample XML

<Employee_dob>
     2000-01-12T12:13:14Z
</Employee_dob>

Fixed and Default Properties

The XSD element can contain the Fixed or Default properties.

Default means that if no value specified in the XML document then application uses the default value specified in the XSD document.

Example:

<xs:element name="Employee_name" type="xs:string" default="unknown"/>

Fixed means the value in the XML document can only have the value specified in the XSD.

Example:

<xs:element name="Customer_location" type="xs:string" fixed="UK"/> 

Cardinality

Specifies how many times an element can appear can be called Cardinality. it is specified using the attributes minOccurs and maxOccurs. Both attributes can assigned a non-negative value.

The default value for minOccurs and maxOccurs is 1.

Example:

<xs:element name="Employee_hobbies"

                    type="xs:string"

                    minOccurs="2"

                    maxOccurs="10"/>

 

Employee_hobbies element must appear at least twice and not more than 10 times in the XML document.

 

Simple Types

We can define our own types by modifying the existing types.

example: Define a code, that may be an integer with a max limit.

<xs:element name="Employee" type="xs:string"/> 
Complex Types:  is a container for other elements which specifies child
elements an element can contain.
Example:
<xs:element name="Employee">
    <xs:complexType>
            <xs:sequence>
                <xs:element name="Dob" type="xs:date" />
                <xs:element name="Address" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
</xs:element> 
  1. Created a definition for element Employee
  2. <xs:complexType> is a container for other <xs:elements>
  3. Complex type do not have the type attribute and contains the <xs:sequence> element.
  4. The sequence element specifies that XML document must appear in the same order they are declared in the XSD Schema.
<Employee>
    <Dob> 2000-01-12T12:13:14Z </Dob>
    <Address> 39 spring field road London </Address>
</Employee>

Related Posts:

2 comments

Visual Studio 2008 SP1 Features

Introduction

Visual Studio 2008 service pack 1(SP1) and .NET Framework 3.5 SP1 offers the developers to develop rapid,responsiveness and stable applications. It allows the developers to develop applications that optimized for windows vista, SQL server, MS 2007 office system and the web.

Features Overview

  • WPF Designers
  • SQL Server 2008 support
  • ADO.NET Entity Designer
  • TFS enhancements
  • Performance enhancements

You can download the Visual Studio 2008 SP1.

Note: When you are installing Visual Studio 2008 on Windows Vista it fails the installation.

To Resolve this issue

1. Right-click the Sidebar icon in the notification area, at the far right of the taskbar.
2. Click "Exit".

Related Posts:

1 comment

WCF Sample in Visual studio 2008

Introduction

This post explains the procedure to develop the sample WCF Service and WCF Client  in Visual studio 2008. Get an overview on WCF and WCF Terms.

1. Start open  Visual studio 2008, Select new project option from file menu

WCF Start

2. Select the WCF ServiceApplication template from the project templates.

3. WCF Service describes the operations that perform in a service contract.

WCF-Service

4.Declare the service contract in Iservice.cs interface and implement in the above Service class.

WCF-Interface

5. To test this service, you will need to create a client and use it to call the

    service. You can do this using the svcutil.exe tool from the command line with

    the following syntax: Generating a client using svcutil.

  svcutil.exe http://localhost:53391/Service.svc?wsdl

WCFClient

6. The above command generates a code file and configuration file contains the client class. Add the two files to your client application and use the generated client class to call the service.

Generatedclient

7. Client class which call the service looks like

callingservice

8. The generated client configuration file looks like

ClientConfig

9. The service configuration file looks like

service-config

Conclusion

The above post explains shows the standard way to create a service and client and calling the service. The Next posts explains each feature in depth. 

Related Posts:

9 comments

Overview of .NET Remoting

Introduction

This post provides you the overview of .NET Remoting Framework. It allows the objects to interact with one another across the application domains.

Features

  • Communication channels for transporting messages across applications
  • Formatters are used for encoding and decoding the messages. supported formatters are

                 1. Binary encoding formatter – use when performance is critical

                 2. XML encoding formatter = use when Interoperability is essential

  •   Object activation and life-time support

           Object activation model falls into two categories

        1.Client-activated objects

       2.Server-activated objects

Remote Objects

An object is consider to be remote when the caller of the object is in different application domain. Object has to decorate with [serializable] custom attribute or they have to implement ISerializable interface to be considered as a remote. Remote objects have to be passed by value. Any object can be changed to remote by deriving from MarshalByRefObject.

Proxy Objects

Proxy Objects are created when client activates a remote object. Proxy object acts as a representative to remote object and ensures that all calls that made on proxy are  forwarded to the remote object.

Two types of Proxy Objects

1.Transparent Proxy

2.Real Proxy

when client activates a remote object, Framework creates a local instance of TransparentProxy class. All method calls on Transparent Proxy object are intercepted by CLR and forwards the call if the remote object is in same application domain.

Real Proxy object calls are intercepted by CLR and forwards the call even the remote object is in different application domain by calling its Invoke method.

Read more

Related Posts:

2 comments

Remoting in .NET Framework 2.0

Introduction

Remoting is  distributed application technology built in the Framework 2.0 with new features which allows the developer to build wide range of distributed applications. Overview of Remoting.

Introduced some new features in Remoting in .NET FW 20. The applications are now more secured and performanent.

Enhancement in the Channel infrastructure: The new channel IPC is introduced which enables the same box communication. It allows the communication between both server application and client application when both are in the same machine. This wont use any network layer when client and server communicate. IPC Channel is based on named pipes.

IPC channel don’t use ports unlike TCP and HTTP channels. The URI will look like ipc://test/server.rem.

.NET FW 2.0 supports three channels in communication – TCP,HTTP and IPC and it supports two formatters, Binary and SOAP.

.NET Remoting Server application can be in the following forms

  • Console application
  • Windows application
  • Windows Service
  • IIS(using HTTP and Binary Formatter)

Interface

Interface Implementation in Server Application

 

Client Application

Client 

Application Configuration file settings

 

App

We can limit the number of users by using this channel.

Related Posts:

1 comment

Web services security

Introduction

Securing a Web service is possible using WSE (Web Services Enhancements) for .NET. We can define the security requirements for both incoming and outgoing SOAP Messages this we can call it is a policy.

We can define the policy in two ways

1. Using WSE Settings 3.0 Tool

2. Adding the policy element to the XML file

Alternatively we can define the policy file either in development or deployment environment. It is more easy for an administrator to define a policy for an application when it is deployed using policy file.

Related Posts:

1 comment

WSE Settings 3.0 Tool

The WSE features can be enabled by using WSE 3.0 tool which is a graphical user interface in visual studio 2005. You have to download the WSE 3.0 for .NET to configure the WSE 3.0 tool.

To open the WSE Settings 3.0 tool from Visual Studio 2005.

  1. Open the Solution or project that you want to use the WSE with.
  2. Right click the project point to WSE Settings 3.0 and click

  WSEsettings

To use the WSE settings 3.0 Tool from the start menu

1. Click Start, point to Microsoft WSE 3.0, and then click Configuration Tool.

WSEStart

Read more

Related Posts:

2 comments

Next Page »