<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Eduzine© - WCF</title>
    <link>http://eduzine.edujini-labs.com/</link>
    <description>Articles from Edujini Team</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:" />
    <generator>Serendipity 0.8.2 - http://www.s9y.org/</generator>
    <pubDate>Mon, 12 Feb 2007 20:04:05 GMT</pubDate>

    <image>
        <url>http://www.edujini-labs.com/images/newmasthead.gif</url>
        <title>RSS: Eduzine© - WCF - Articles from Edujini Team</title>
        <link>http://eduzine.edujini-labs.com/</link>
        <width></width>
        <height></height>
    </image>
<item>
    <title>Exploring Windows Communication Foundation - Part 2</title>
    <link>http://eduzine.edujini-labs.com/archives/22-Exploring-Windows-Communication-Foundation-Part-2.html</link>
<category>SOA</category><category>Web Services</category><category>.Net</category><category>WCF</category>    <comments>http://eduzine.edujini-labs.com/archives/22-Exploring-Windows-Communication-Foundation-Part-2.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=22</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=22</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;p&gt;
In our second article of the series &amp;quot;Exploring Windows Communication Foundation&amp;quot;, we explore the customization of
the service and working with faults and errors. Specifically, we look at the following:
&lt;/p&gt;&lt;ul&gt;
  &lt;li&gt;Hosting the service in IIS/ASP.Net Runtime&lt;/li&gt;
  &lt;li&gt;Customizing the details of a service contract, like the name of contract, namespace-URI to which it belongs etc&lt;/li&gt;
  &lt;li&gt;Customizing the details of an operation contract, like the name of contract, it's parameters, order etc&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h2&gt;Downloads&lt;/h2&gt;
&lt;p&gt;The code for the project is available for download at &lt;a href=&quot;http://downloads.edujini-labs.com&quot;&gt;Edujini Downloads&lt;/a&gt; in the &lt;a href=&quot;http://www.edujini-labs.com/pafiledb/index.php?act=category&amp;id=6&quot;&gt;Windows Communication Foundation&lt;/a&gt; category.

&lt;/p&gt;
 
&lt;h2&gt;Hosting WCF Service in IIS/ASP.Net&lt;/h2&gt;

&lt;p&gt;
To host a service in IIS/ASP.Net, we need to do the following:
&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt;Install IIS, if not already installed.&lt;/li&gt;
  &lt;li&gt;Register ASP.Net 2.0 with IIS, if not already registered.&lt;/li&gt;
  &lt;li&gt;Register WCF with IIS and ASP.Net 2.0.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
If you have installed IIS and .Net Framework 2.0 Redistributable in this order, you do not need to register ASP.Net Runtime.
You can check if ASP.Net Runtime is registered with a website or not by checking the properties of the website as shown below:
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_iis_01.jpg&quot; alt=&quot;iis website properties&quot; title=&quot;iis website properties&quot; /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_iis_02.jpg&quot; alt=&quot;iis asp.net runtime&quot; title=&quot;iis asp.net runtime&quot; /&gt;

&lt;p&gt;
If the ASP.Net Runtime is not registered with IIS, execute the following on the commandline for the registration:
&lt;/p&gt;

&lt;pre&gt;%windir%\Microsoft.Net\Framework\v2.0.50727\aspnet_regiis.exe -i
&lt;/pre&gt;

&lt;p&gt;
To register the WCF with IIS and ASP.Net 2.0, execute the following on the commandline:
&lt;/p&gt;

&lt;pre&gt;ServiceModelReg.exe -i -x
&lt;/pre&gt;

&lt;p&gt;
The application &lt;code&gt;ServiceModelReg.exe&lt;/code&gt; can be found in the folder
&lt;code&gt;&amp;quot;%windir%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation&amp;quot;&lt;/code&gt;.
The &lt;code&gt;-i&lt;/code&gt; option is for registering WCF with IIS and ASP.Net Runtime and &lt;code&gt;-x&lt;/code&gt; option is to execute the
custom action scripts also. The two important things that the registration does are registering &lt;code&gt;.svc&lt;/code&gt; extension
with IIS asking it to be handled by ASP.Net 2.0 Runtime and the registering &lt;code&gt;.svc&lt;/code&gt; extension with the ASP.Net
Runtime to be handled by its &lt;code&gt;IHttpHandler&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
The next step is to create an ASP.Net Website. Let's call it &lt;code&gt;ShoppingCart&lt;/code&gt;.
To the website created, add a new WCF service and name
it &lt;code&gt;ShoppingCartService.svc&lt;/code&gt;.
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_website_svc_01.jpg&quot; title=&quot;adding wcf service&quot; alt=&quot;adding wcf service&quot; /&gt;

&lt;p&gt;
Incase you do not find the template for adding a new WCF service, don't be disheartened. You can simply add a new text file
and name it &lt;code&gt;ShoppingCartService.svc&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Open the &lt;code&gt;ShoppingCartService.svc&lt;/code&gt; file if not already opened. Modify it to have the following contents:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;%@ ServiceHost Debug=&amp;quot;true&amp;quot; Service=&amp;quot;ShoppingCartLibrary.ShoppingCartImpl&amp;quot; %&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Create the folder &lt;code&gt;Bin&lt;/code&gt; inside your project. Add the assembly &lt;code&gt;ShoppingCartLibrary&lt;/code&gt; that we created
in our previous article. If you don't have it, you can get it from
&lt;a href=&quot;http://eduzine.edujinionline.com/archives/21-Exploring-Windows-Communication-Foundation-Part-1.html&quot;&gt;the previous article&lt;/a&gt;.
For all those working with Visual Studio, you may wish to delete the class &lt;code&gt;ShoppingCartService&lt;/code&gt; created
automatically for the code-behind, placed in &lt;code&gt;App_Code&lt;/code&gt; folder. We don't need it.
&lt;/p&gt;

&lt;p&gt;
Modify the configuration file &lt;code&gt;web.config&lt;/code&gt; to include the following content:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;system.serviceModel&amp;gt;
        &amp;lt;behaviors&amp;gt;
            &amp;lt;serviceBehaviors&amp;gt;
                &amp;lt;behavior name=&amp;quot;HttpGetBehaviour&amp;quot;&amp;gt;
                    &amp;lt;serviceMetadata httpGetEnabled=&amp;quot;true&amp;quot;/&amp;gt;
                &amp;lt;/behavior&amp;gt;
            &amp;lt;/serviceBehaviors&amp;gt;
        &amp;lt;/behaviors&amp;gt;
        &amp;lt;services&amp;gt;
            &amp;lt;service name=&amp;quot;ShoppingCartLibrary.ShoppingCartImpl&amp;quot;
                behaviorConfiguration=&amp;quot;HttpGetBehaviour&amp;quot;&amp;gt;
                &amp;lt;endpoint binding=&amp;quot;mexHttpBinding&amp;quot;
                    contract=&amp;quot;ShoppingCartLibrary.IShoppingCartService&amp;quot; address=&amp;quot;&amp;quot;/&amp;gt;
            &amp;lt;/service&amp;gt;
        &amp;lt;/services&amp;gt;
    &amp;lt;/system.serviceModel&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Hurray! The service has been deployed. Browse to the location &lt;code&gt;http://localhost/ShoppingCart/ShoppingCartService.svc&lt;/code&gt;.
If you see the output as shown below, the scriptmaps are not registered appropriately.
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_website_svc_02.jpg&quot; alt=&quot;uncompiled output&quot; title=&quot;uncompiled output&quot; /&gt;

&lt;p&gt;
In that case (or uncompiled output), execute the following on the commandline:
&lt;/p&gt;

&lt;pre&gt;ServiceModelReg.exe -s:W3SVC/1/ROOT/ShoppingCart
&lt;/pre&gt;

&lt;p&gt;
Refresh the page in browser. Now, you should be able to see an output as shown below:
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_website_svc_03.jpg&quot; alt=&quot;service output&quot; title=&quot;service output&quot; /&gt;

&lt;h2&gt;Updating the client&lt;/h2&gt;
&lt;p&gt;
The next step is to update the client (proxy class and configuration) to connect to our new service.
&lt;/p&gt;

&lt;p&gt;
Ah! We don't need to regenerate everything. Open the client application configuration file and modify the endpoint-address
(in the section &lt;code&gt;configuration/system.serviceModel/client/endpoint&lt;/code&gt;, the attribute &lt;code&gt;address&lt;/code&gt;) with
a value of &lt;code&gt;http://localhost/ShoppingCart/ShoppingCartService.svc&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
The client should give identical results as what we got while working with self-hosted service (created in previous article).
&lt;/p&gt;

&lt;h2&gt;Service Customization&lt;/h2&gt;

&lt;p&gt;
Let us now look at important aspect of decoupling the WCF contract names and .Net names (data-types and/or parameters).
&lt;/p&gt;

&lt;p&gt;
In general, we do not want to have dependency on the field/parameter/data-type names that we choose in .Net and
what we publish to the world. Not only it may put under risk the application but also may be mandatorily required.
Say, for example, if we need to have a parameter by the name &lt;code&gt;in&lt;/code&gt; or &lt;code&gt;for&lt;/code&gt;, we cannot have it
because these are keywords in C# (technically speaking, yes we can have it in C# but what about C++.Net or VB.Net?).
As such, we would like to remove this interdependency.
&lt;/p&gt;
&lt;br /&gt;
&lt;h3&gt;Service Contract Name&lt;/h3&gt;
&lt;p&gt;
The first requirement that we look at it isolating the service name and the namespace-URI to which it belongs, and
the name of the interface.
&lt;/p&gt;

&lt;p&gt;
The &lt;code&gt;ServiceContractAttribute&lt;/code&gt; has two properties - &lt;code&gt;Name&lt;/code&gt; and &lt;code&gt;Namespace&lt;/code&gt; that can
be used to control this. The default of values of the two are the name of the interface and &lt;code&gt;http://www.tempuri.org&lt;/code&gt;.
Let us change them to &lt;code&gt;Shopping-Cart-Service&lt;/code&gt; and &lt;code&gt;http://www.edujinionline.com/ns/wcf/tutorial/scart&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Update the interface &lt;code&gt;IShoppingCartService&lt;/code&gt; to as given below (code in bold are the changes done):
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;
using System.ServiceModel;

namespace ShoppingCartLibrary
{
    &lt;b&gt;[ServiceContract(Name=&amp;quot;Shopping-Cart-Service&amp;quot;,
        Namespace=&amp;quot;http://www.edujinionline.com/ns/wcf/tutorial/scart&amp;quot;)]&lt;/b&gt;
    public interface IShoppingCartService
    {
        [OperationContract]
        bool CheckUserExists(string username);

        [OperationContract]
        DateTime? GetLastTransactionTime(string username);
    }
}
&lt;/pre&gt;

&lt;p&gt;
Starting the hosting application that we created in the previous article.
Browse to the location &lt;code&gt;http://localhost:8080/ShoppingCartService?wsdl&lt;/code&gt;. You will notice that the WSDL
generated is conspicuously short and has reference to another WSDL. Browse to
&lt;code&gt;http://localhost:8080/ShoppingCartService?wsdl=wsdl0&lt;/code&gt;. You will notice that all definitions of types,
messages and operations (in portTypes section) now belong to the new namespace-URI that we gave.
&lt;/p&gt;

&lt;p&gt;
Also notice that the new name of the portType is now &lt;code&gt;Shopping-Cart-Service&lt;/code&gt; instead of &lt;code&gt;IShoppingCart&lt;/code&gt;.
Note that portType section is the one that defines the service-contract (operations and related messages). Also the bindings
are now also from the type &lt;code&gt;Shopping-Cart-Service&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
However, if we need to change the name of the service (in service section of WSDL) and the namespace-URI of the same, we
need to change the service-behaviour rather than the contract details.
The default value of the same are the name of the implementation class and http://tempuri.org.
Let us update them to &lt;code&gt;Shopping-Cart-Impl&lt;/code&gt; and
&lt;code&gt;http://www.edujinionline.com/ns/wcf/tutorial/scart/impl&lt;/code&gt; respectively.
&lt;/p&gt;

&lt;p&gt;
We shall make use of the &lt;code&gt;System.ServiceModel.ServiceBehaviorAttribute&lt;/code&gt; to specify the name and namespace-uri
of the service.
&lt;/p&gt;

&lt;p&gt;
Update the class &lt;code&gt;ShoppingCartImpl&lt;/code&gt; to as given below (code in bold are the changes done):
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;
using System.ServiceModel;

namespace ShoppingCartLibrary
{
    &lt;b&gt;[ServiceBehavior(Name=&amp;quot;Shopping-Cart-Impl&amp;quot;,
        Namespace=&amp;quot;http://www.edujinionline.com/ns/wcf/tutorials/scart/impl&amp;quot;)]&lt;/b&gt;
    public class ShoppingCartImpl : IShoppingCartService
    {
        //Other code not shown
    }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;Operation Names&lt;/h3&gt;

&lt;p&gt;
Similarly, to change the value of the operation, one can make use of &lt;code&gt;Name&lt;/code&gt; property of
&lt;code&gt;System.ServiceModel.OperationContractAttribute&lt;/code&gt;. Let us update the name of the operations from their default
names to &lt;code&gt;UserExists&lt;code&gt; and &lt;code&gt;LastTransactionTime&lt;/code&gt; respectively.
Update the interface &lt;code&gt;IShoppingCartService&lt;/code&gt; to as shown below:
&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;
using System.ServiceModel;

namespace ShoppingCartLibrary
{
    [ServiceContract(Name=&amp;quot;Shopping-Cart-Service&amp;quot;,
        Namespace=&amp;quot;http://www.edujinionline.com/ns/wcf/tutorial/scart&amp;quot;)]
    public interface IShoppingCartService
    {
        &lt;b&gt;[OperationContract(Name=&amp;quot;UserExists&amp;quot;)]&lt;/b&gt;
        bool CheckUserExists(string username);

        &lt;b&gt;[OperationContract(Name=&amp;quot;LastTransactionTime&amp;quot;)]&lt;/b&gt;
        DateTime? GetLastTransactionTime(string username);
    }
}
&lt;/pre&gt;

&lt;h3&gt;Action URIs for input and output messages&lt;/h3&gt;

&lt;p&gt;
Launch the hosting application and browse to &lt;code&gt;http://localhost:8080/ShoppingCartService?wsdl=wsdl0&lt;/code&gt;.
Look at the updated operation names. However, the &lt;code&gt;Action&lt;/code&gt; of input and output
messages doesn't look too good. Let us update them to
&lt;code&gt;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExists&lt;/code&gt; and
&lt;code&gt;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTransactionTime&lt;/code&gt; (input), and
&lt;code&gt;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExistsOut&lt;/code&gt; and
&lt;code&gt;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTransactionTimeOut&lt;/code&gt; (output) respectively.
&lt;/p&gt;

&lt;p&gt;
The properties &lt;code&gt;Action&lt;/code&gt; and &lt;code&gt;ReplyAction&lt;/code&gt; may be used to customize the action-URI for
the input and output operations.
Again, make changes to the interface as shown below (code in bold are the changes done):
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;
using System.ServiceModel;

namespace ShoppingCartLibrary
{
    [ServiceContract(Name=&amp;quot;Shopping-Cart-Service&amp;quot;,
        Namespace=&amp;quot;http://www.edujinionline.com/ns/wcf/tutorial/scart&amp;quot;)]
    public interface IShoppingCartService
    {
        [OperationContract(Name=&amp;quot;UserExists&amp;quot;,
            &lt;b&gt;Action=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExists&amp;quot;,
            ReplyAction=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExistsOut&amp;quot;&lt;/b&gt;)]
        bool CheckUserExists(string username);

        [OperationContract(Name=&amp;quot;LastTransactionTime&amp;quot;,
            &lt;b&gt;Action=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTranactionTime&amp;quot;,
            ReplyAction=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTranactionTimeOut&amp;quot;&lt;/b&gt;)]
        DateTime? GetLastTransactionTime(string username);
    }
}&lt;/pre&gt;

&lt;p&gt;
Similarly, the order in which the operations should appear in the WSDL can be defined by setting the property
&lt;code&gt;Order&lt;/code&gt; of the &lt;code&gt;System.ServiceModel.OperationContractAttribute&lt;/code&gt; appropriately.
By default, the WCF engine would show the operations in the order it retrieves from the IL (using reflection).
&lt;/p&gt;

&lt;h3&gt;Parameter Names&lt;/h3&gt;

&lt;p&gt;
Let us say that our shopping cart works with email address as far the interface to the world is concerned.
Internally, we would like to refer to it as username, like we have been doing so far.
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;System.ServiceModel.MessageParameterAttribute&lt;/code&gt; can be used to customize the name of the input parameters
as well as that of the output paramter in the response.
Update the code to look as follows (code in bold shows the changes made):
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;
using System.ServiceModel;

namespace ShoppingCartLibrary
{
    [ServiceContract(Name=&amp;quot;Shopping-Cart-Service&amp;quot;,
        Namespace=&amp;quot;http://www.edujinionline.com/ns/wcf/tutorial/scart&amp;quot;)]
    public interface IShoppingCartService
    {
        [OperationContract(Name=&amp;quot;UserExists&amp;quot;,
            Action=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExists&amp;quot;,
            ReplyAction=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/UserExistsOut&amp;quot;)]
        &lt;b&gt;[return: MessageParameter(Name=&amp;quot;ExistsInfo&amp;quot;)]&lt;/b&gt;
        bool CheckUserExists(
            &lt;b&gt;[MessageParameter(Name=&amp;quot;email&amp;quot;)]&lt;/b&gt; string username);

        [OperationContract(Name=&amp;quot;LastTransactionTime&amp;quot;,
            Action=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTranactionTime&amp;quot;,
            ReplyAction=&amp;quot;http://www.edujinionline.com/wcf/tutorials/scart/actions/LastTranactionTimeOut&amp;quot;)]
        &lt;b&gt;[return: MessageParameter(Name=&amp;quot;TimeInfo&amp;quot;)]&lt;/b&gt;
        DateTime? GetLastTransactionTime(
            &lt;b&gt;[MessageParameter(Name=&amp;quot;email&amp;quot;)]&lt;/b&gt; string username);
    }
}&lt;/pre&gt;

&lt;p&gt;
With all these changes, we need to regenerate the proxy-client (using &lt;code&gt;svcutil&lt;/code&gt;). You will notice that the
default class file generated this time is &lt;code&gt;Shopping-Cart-Service.cs&lt;/code&gt;, which happens to be the
name of our service!
&lt;/p&gt;

&lt;p&gt;
Now, before proceeding ahead with any transaction, let us enable tracing to have a look at the message being transported.
Update the application configuration file for the host to have the following entries:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;configuration&amp;gt;
    &amp;lt;system.diagnostics&amp;gt;
        &amp;lt;sources&amp;gt;
            &amp;lt;source name=&amp;quot;System.ServiceModel.MessageLogging&amp;quot;
                switchValue=&amp;quot;Verbose&amp;quot;&amp;gt;
                &amp;lt;listeners&amp;gt;
                    &amp;lt;add name=&amp;quot;xml&amp;quot;
                    type=&amp;quot;System.Diagnostics.XmlWriterTraceListener&amp;quot;
                    initializeData=&amp;quot;..\..\..\wcf_scart.svclog&amp;quot; /&amp;gt;
                &amp;lt;/listeners&amp;gt;
            &amp;lt;/source&amp;gt;
        &amp;lt;/sources&amp;gt;
        &amp;lt;trace autoflush=&amp;quot;true&amp;quot; /&amp;gt;
    &amp;lt;/system.diagnostics&amp;gt;

    &amp;lt;system.serviceModel&amp;gt;
        &amp;lt;diagnostics&amp;gt;
            &amp;lt;messageLogging logEntireMessage=&amp;quot;true&amp;quot; maxMessagesToLog=&amp;quot;300&amp;quot;
                   logMessagesAtServiceLevel=&amp;quot;false&amp;quot;
                   logMalformedMessages=&amp;quot;true&amp;quot;
                   logMessagesAtTransportLevel=&amp;quot;true&amp;quot; /&amp;gt;
        &amp;lt;/diagnostics&amp;gt;
        &amp;lt; ... &amp;gt;
    &amp;lt;/system.ServiceModel&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Update the client application to as shown below (code in bold are the updates done):
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;

namespace ShoppingCartConsumer
{
    public class MainClass
    {
        public static void Main(string[] args)
        {
            ShoppingCartServiceClient client = new ShoppingCartServiceClient();

            string[] users = new string[] { &amp;quot;gvaish&amp;quot;, &amp;quot;edujini&amp;quot;, &amp;quot;other&amp;quot; };

            foreach(string user in users)
            {
                Console.WriteLine(&amp;quot;User: {0}&amp;quot;, user);
                Console.WriteLine(&amp;quot;\tExists:           {0}&amp;quot;, client.&lt;b&gt;UserExists&lt;/b&gt;(user));
                DateTime? time = client.&lt;b&gt;LastTransactionTime&lt;/b&gt;(user);
                if(time.HasValue)
                {
                    Console.WriteLine(&amp;quot;\tLast Transaction: {0}&amp;quot;, time.Value);
                } else
                {
                    Console.WriteLine(&amp;quot;\tNever transacted&amp;quot;);
                }
            }

            Console.WriteLine();
        }
    }
}&lt;/pre&gt;

&lt;p&gt;
Notice that there no longer exists the methods &lt;code&gt;CheckUserExists&lt;/code&gt; and/or &lt;code&gt;GetLastTransactionTime&lt;/code&gt;
in the proxy-client generated.
&lt;/p&gt;

&lt;p&gt;
Launch the &lt;code&gt;Service Trace Viewer&lt;/code&gt;, the application &lt;code&gt;SvcTraceViewer.exe&lt;/code&gt; found in the &lt;code&gt;bin&lt;/code&gt;
where the &lt;code&gt;Windows SDK for Windows Vista and .Net Framework 3.0 Runtime Components&lt;/code&gt; was installed.
Open the file &lt;code&gt;wcf_scart.svclog&lt;/code&gt; generated. Notice the important changes in the request sent and response received.
&lt;/p&gt;

&lt;img width=&quot;444&quot; height=&quot;150&quot; border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_trace_viewer_01.jpg&quot; alt=&quot;input message&quot; title=&quot;input message&quot; /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img width=&quot;444&quot; height=&quot;150&quot; border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/edujini_wcf_scart_02_trace_viewer_02.jpg&quot; alt=&quot;output message&quot; title=&quot;output message&quot; /&gt;

&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;
We looked at how to host the service in IIS/ASP.Net. We also looked at how we can isolate the .Net parameter and operation paramter
names. That's it for now. We would discuss about the faults and error-handling in WCF in the next article.
&lt;/p&gt;

    </content:encoded>
    <pubDate>Tue, 23 Jan 2007 12:47:34 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/22-guid.html</guid>
    </item>
<item>
    <title>Exploring Windows Communication Foundation - Part 1</title>
    <link>http://eduzine.edujini-labs.com/archives/21-Exploring-Windows-Communication-Foundation-Part-1.html</link>
<category>Web Services</category><category>.Net</category><category>WCF</category>    <comments>http://eduzine.edujini-labs.com/archives/21-Exploring-Windows-Communication-Foundation-Part-1.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=21</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=21</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;p&gt;
Starting with this article, we shall explore various aspects of WCF.
&lt;/p&gt;

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
Microsoft .Net Framework 3.0 introduces, among other components, Windows Communication Foundation or simply, WCF. The framework
allows us, the development community, to build more service-oriented application. It incorporates several Web Service related
specifications, mostly driven by W3C and OASIS consortiums. I will just list a few of them:
&lt;/p&gt;&lt;ol&gt;
 &lt;li&gt;SOAP 1.1, 1.2 with Basic Profile 1.1&lt;/li&gt;
 &lt;li&gt;WSDL 1.1&lt;/li&gt;
 &lt;li&gt;MTOM&lt;/li&gt;
 &lt;li&gt;WS Policy and WS Policy Attachments&lt;/li&gt;
 &lt;li&gt;WS Metadata Exchange&lt;/li&gt;
 &lt;li&gt;WSS SOAP Message Security 1.0, 1.1&lt;/li&gt;
 &lt;li&gt;WSS SOAP Message Security Username Token Profile 1.0, 1.1&lt;/li&gt;
 &lt;li&gt;WSS SOAP Message Security X.509 Token Profile 1.0, 1.1&lt;/li&gt;
 &lt;li&gt;WS Addressing 2005/08&lt;/li&gt;
 &lt;li&gt;WSS SOAP Message Security Kerberos Token Profile 1.1&lt;/li&gt;
 &lt;li&gt;WS Secure Conversation&lt;/li&gt;
 &lt;li&gt;WS Reliable Messaging&lt;/li&gt;
 &lt;li&gt;WS Coordination&lt;/li&gt;
 &lt;li&gt;WS Atomic Transaction&lt;/li&gt;
 &lt;li&gt;WS Federation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
Starting with this article, let us tour various key aspects of WCF.
&lt;/p&gt;

&lt;h2&gt;Downloads&lt;/h2&gt;
&lt;p&gt;The code for the project is available for download at &lt;a href=&quot;http://downloads.edujini-labs.com&quot;&gt;Edujini Downloads&lt;/a&gt; in the &lt;a href=&quot;http://downloads.edujini-labs.com/index.php?act=category&amp;id=6&quot;&gt;Windows Communication Foundation&lt;/a&gt; category.
&lt;/p&gt;

 
&lt;h2&gt;Case Study&lt;/h2&gt;

&lt;p&gt;
We shall take a simple shopping cart as a case-study. We start with simple data-types and slowly build on to work
with custom, more complex data-types. In the sequence of articles, we shall explore various key aspects of WCF.
The minimum features that I wish to explore in the series are:
&lt;/p&gt;&lt;ul&gt;
 &lt;li&gt;Publishing WCF Service&lt;/li&gt;
 &lt;li&gt;Writing WCF Client&lt;/li&gt;
 &lt;li&gt;Customising the operation contract details, say decoupling the .Net and contract names or pushing part
 of the content in &lt;code&gt;Headers&lt;/code&gt; of the Soap-&lt;code&gt;Envelope&lt;/code&gt;
 &lt;/li&gt;
 &lt;li&gt;Working with faults and errors&lt;/li&gt;
 &lt;li&gt;Working with custom data-types&lt;/li&gt;
 &lt;li&gt;Working with generic data in operations&lt;/li&gt;
 &lt;li&gt;Working with interface-types in operations&lt;/li&gt;
 &lt;li&gt;Working with collections in operations&lt;/li&gt;
 &lt;li&gt;Working with large data in operations&lt;/li&gt;
 &lt;li&gt;Working with sessions and transactions&lt;/li&gt;
&lt;/ul&gt;
Yeah.. it's a long list, but I'll try to fulfil my promise. No, all the articles are not ready right now.
Will keep posting as and when ready, and also update this article with references to them.
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
Ok.. so, let's start!
&lt;/p&gt;

&lt;p&gt;
We will need the following items to work with WCF:
&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;displaylang=en&quot;&gt;Microsoft .Net Framework 2.0 Redistributable&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;displaylang=en&quot;&gt;Microsoft .Net Framework 2.0 SDK&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043&amp;displaylang=en&quot;&gt;Microsoft .Net Framework 3.0 Redistributable&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=C2B1E300-F358-4523-B479-F53D234CDCCF&amp;displaylang=en&quot;&gt;Microsoft Windows SDK for Windows Vista and .Net Framework 3.0 Runtime Components&lt;/a&gt;
              You may download the complete image &lt;a href=&quot;http://download.microsoft.com/download/1/b/3/1b3f749d-e215-482c-a004-5d9c26c75c92/6.0.6000.0.0.WindowsSDK_Vista_rtm.DVD.Rel.img&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;If you are working with Visual Studio, download the &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D&amp;displaylang=en&quot;&gt;Visual Studio Extensions&lt;/a&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h2&gt;Service Definition&lt;/h2&gt;

&lt;p&gt;
Our shopping-cart service, to begin with, publishes the following operations:
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;bool      CheckUserExists(string username);
DateTime? GetLastTransactionTime(string username);
&lt;/pre&gt;

&lt;p&gt;
The job of the first operation is to check whether or not the user is registered in our database or not.
The second operation returns the date and time of last transaction done by the last user, if any. Yes, you note
the operation correctly, the return type is not &lt;code&gt;System.DateTime&lt;/code&gt; but &lt;code&gt;System.DateTime?&lt;/code&gt;,
the C# syntax for &lt;code&gt;System.Nullable&amp;lt;System.DateTime&amp;gt;&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
To publish any service in WCF, we require four steps in general:
&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;#Step1&quot;&gt;Service contract definition&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Step2&quot;&gt;Contract implementation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Step3&quot;&gt;Service configuration&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#Step4&quot;&gt;Service hosting&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h2&gt;&lt;a name=&quot;Step1&quot;&gt;Service Contract Definition&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
In WCF, service contract is the term used for the final service being published. Note that a service may have one or more related
operations, referred to as operation contracts in WCF.
&lt;/p&gt;

&lt;p&gt;
If you are working in Visual Studio, create a new project of type &amp;quot;Class Library&amp;quot;. Yes, you read it right, it is
&amp;quot;Class Library&amp;quot; and &lt;i&gt;not&lt;/i&gt; &amp;quot;WCF Service Library&amp;quot;.
&lt;/p&gt;

&lt;p&gt;
We start by creating an interface &lt;code&gt;IShoppingCartService&lt;/code&gt; as follows:
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using DateTime;

namespace ShoppingCartLibrary
{
    public interface IShoppingCartService
    {
        bool CheckUserExists(string username);

        DateTime? GetLastTransactionTime(string username);
    }
}
&lt;/pre&gt;

&lt;h2&gt;&lt;a name=&quot;Step2&quot;&gt;Contract Implementation&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
The next obvious step is to provide implementation to the service. We create a class &lt;code&gt;ShoppingCartImpl&lt;/code&gt;
that implements the interface &lt;code&gt;IShoppingCartService&lt;/code&gt;.
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using DateTime;

namespace ShoppingCartLibrary
{
    public class ShoppingCartImpl : IShoppingCartService
    {
        public bool CheckUserExists(string username)
        {
            if(username == &amp;quot;gvaish&amp;quot; || username == &amp;quot;edujini&amp;quot;)
            {
                return true;
            }
            return false;
        }

        public DateTime? GetLastTransactionTime(string username)
        {
            if(username == &amp;quot;gvaish&amp;quot;)
            {
                return DateTime.Now.AddDays(-3);
            }
            if(username == &amp;quot;edujini&amp;quot;)
            {
                return DateTime.Now.AddHours(-3);
            }
            return null;
        }
    }
}
&lt;/pre&gt;

&lt;h2&gt;&lt;a name=&quot;Step3&quot;&gt;Service Configuration&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
We need configuration at two levels:
&lt;/p&gt;&lt;ol&gt;
  &lt;li&gt;Using attributes, we need to tell WCF about the &lt;a href=&quot;#config1&quot;&gt;service
     contract and operation contracts&lt;/a&gt;. The information would be used to define service, operations, messages and types&lt;/li&gt;
  &lt;li&gt;Using configuration entries, we need to tell WCF about the &lt;a href=&quot;#config2&quot;&gt;implementation class to be
     used and binding details&lt;/a&gt;. These details would be used for hosting purpose.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h3&gt;&lt;a name=&quot;config1&quot;&gt;Contract Configuration&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
If you are using Visual Studio, add a reference to the assembly &lt;code&gt;System.ServiceModel.dll&lt;/code&gt; from GAC.
Add the attribute &lt;code&gt;System.ServiceModel.ServiceContractAttribute&lt;/code&gt; to the interface. It tells the WCF that
there is a service associated with the corresponding type.
Add the attribute &lt;code&gt;System.ServiceModel.OperationContractAttribute&lt;/code&gt; to the methods in the interface. It informs the
WCF about the operations to be published in the service. It will take care of messages and types associated on its own.
&lt;/p&gt;

&lt;p&gt;
So, our final code looks as follows:
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using DateTime;
using ServiceModel;

namespace ShoppingCartLibrary
{
    [ServiceContract]
    public interface IShoppingCartService
    {
        [OperationContract]
        bool CheckUserExists(string username);

        [OperationContract]
        DateTime? GetLastTransactionTime(string username);
    }
}
&lt;/pre&gt;

&lt;h3&gt;&lt;a name=&quot;config2&quot;&gt;Service Configuration&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;
We shall provide these details to our &lt;a href=&quot;#Step4&quot;&gt;hosting application&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Compile the files to the assembly. I name it &lt;code&gt;ShoppingCartLibrary.dll&lt;/code&gt;. If you are compiling
the code at the commandline, do not forget to add reference to &lt;code&gt;System.ServiceModel.dll&lt;/code&gt;.
&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Step4&quot;&gt;Service Hosting&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;
Having defined our service completely, we need a runtime (engine) to host the service - an application that can allow
the clients to connect and invoke the operations. For this, we shall create a console application. The application
has just one class, &lt;code&gt;MainClass&lt;/code&gt;, with the &lt;code&gt;Main&lt;/code&gt; method.
&lt;/p&gt;

&lt;p&gt;
For Visual Studio users, we name the project as &lt;code&gt;ShoppingCartHost&lt;/code&gt;. Rename the class
&lt;code&gt;Program&lt;/code&gt; to &lt;code&gt;MainClass&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Add reference to &lt;code&gt;System.ServiceModel.dll&lt;/code&gt; and to the &lt;code&gt;ShoppingCartLibrary.dll&lt;/code&gt;
Write the following code to the &lt;code&gt;MainClass&lt;/code&gt;.
&lt;/p&gt;

&lt;pre&gt;using System;
using System.ServiceModel;

using ShoppingCartLibrary;

namespace ShoppingCartHost
{
    public class MainClass
    {
        public static void Main(string[] args)
        {
            Uri uri = new Uri(&amp;quot;http://localhost:8080/ShoppingCartService&amp;quot;);

            using(ServiceHost host = new ServiceHost(typeof(ShoppingCartImpl), uri))
            {
                host.Open();

                Console.Write(&amp;quot;Hit &amp;lt;enter&amp;gt; to stop service...&amp;quot;);
                Console.ReadLine();
            }
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;
Now, we need the service configuration as mentioned &lt;a href=&quot;#config2&quot;&gt;earlier&lt;/a&gt;.
Write the following code to the application configuration file.
&lt;/p&gt;

&lt;pre lang=&quot;xml&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;
&amp;lt;configuration&amp;gt;
    &amp;lt;system.serviceModel&amp;gt;
        &amp;lt;behaviors&amp;gt;
            &amp;lt;serviceBehaviors&amp;gt;
                &amp;lt;behavior name=&amp;quot;HttpGetBehaviour&amp;quot;&amp;gt;
                    &amp;lt;serviceMetadata httpGetEnabled=&amp;quot;true&amp;quot;/&amp;gt;
                &amp;lt;/behavior&amp;gt;
            &amp;lt;/serviceBehaviors&amp;gt;
        &amp;lt;/behaviors&amp;gt;
        &amp;lt;services&amp;gt;
            &amp;lt;service name=&amp;quot;ShoppingCartLibrary.ShoppingCartImpl&amp;quot;
                behaviorConfiguration=&amp;quot;HttpGetBehaviour&amp;quot;&amp;gt;
                &amp;lt;endpoint binding=&amp;quot;mexHttpBinding&amp;quot;
                    contract=&amp;quot;ShoppingCartLibrary.IShoppingCartService&amp;quot; address=&amp;quot;&amp;quot;/&amp;gt;
            &amp;lt;/service&amp;gt;
        &amp;lt;/services&amp;gt;
    &amp;lt;/system.serviceModel&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Compile your code. Start the console application. You should see your server up and running.
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/host_application.jpg&quot; title=&quot;host application&quot; alt=&quot;host application&quot; /&gt;

&lt;p&gt;
Browse to the location &lt;code&gt;http://localhost:8080/ShoppingCartService&lt;/code&gt;.
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/browse_location.jpg&quot; title=&quot;browse location&quot; alt=&quot;browse location&quot; /&gt;

&lt;p&gt;
Hurray! We are ready with our first service. Let's now design a client to consume the service.
&lt;/p&gt;

&lt;h2&gt;Client Application&lt;/h2&gt;
&lt;p&gt;
For our client, we need two items: the proxy client code and the configuration items. No no, you don't write any of them.
You can generate them using the WCF tool &lt;code&gt;svcutil.exe&lt;/code&gt;. You can locate this tool in the folder where your Visual Studio
IDE is installed (default location being %PROGRAMFILES%\Microsoft Visual Studio 8\Common7\IDE) or where you install
the .Net 3.0 SDK is installed (default location being %PROGRAMFILES%\Micrsofot Windows SDK\v6.0\bin).
&lt;/p&gt;

&lt;p&gt;
Ensure that the location to &lt;code&gt;svcutil.exe&lt;/code&gt; is in your path. Invoke the following at commandline.
&lt;/p&gt;

&lt;pre&gt;svcutil.exe /nologo /config:App.config http://localhost:8080/ShoppingCartService?wsdl
&lt;/pre&gt;

&lt;p&gt;
It will generate two files: &lt;code&gt;ShoppingCartImpl.cs&lt;/code&gt; and &lt;code&gt;App.config&lt;/code&gt;. We just need a &lt;code&gt;MainClass&lt;/code&gt;
with &lt;code&gt;Main&lt;/code&gt; method on the client side to consume the service published. Write the following code to the class:
&lt;/p&gt;

&lt;pre lang=&quot;cs&quot;&gt;using System;

namespace ShoppingCartConsumer
{
    public class MainClass
    {
        public static void Main(string[] args)
        {
            ShoppingCartServiceClient client = new ShoppingCartServiceClient();

            string[] users = new string[] { &amp;quot;gvaish&amp;quot;, &amp;quot;edujini&amp;quot;, &amp;quot;other&amp;quot; };

            foreach(string user in users)
            {
                Console.WriteLine(&amp;quot;User: {0}&amp;quot;, user);
                Console.WriteLine(&amp;quot;\tExists:           {0}&amp;quot;, client.CheckUserExists(user));
                DateTime? time = client.GetLastTransactionTime(user);
                if(time.HasValue)
                {
                    Console.WriteLine(&amp;quot;\tLast Transaction: {0}&amp;quot;, time.Value);
                } else
                {
                    Console.WriteLine(&amp;quot;\tNever transacted&amp;quot;);
                }
            }

            Console.WriteLine();
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;
Don't forget to add reference to &lt;code&gt;System.ServiceModel.dll&lt;/code&gt;. Build your project.
Execute the client. You should get an output similar to shown below:
&lt;/p&gt;

&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/dotNet/wcf/client_application.jpg&quot; title=&quot;client application&quot; alt=&quot;client application&quot; /&gt;

&lt;p&gt;
Note that this is only a start... so, please have a little patience if you are looking for advanced topics.
&lt;img src=&quot;http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/1.gif&quot; alt=&quot;:)&quot; title=&quot;:)&quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;
We chose to have an interface as our service contract. In general, we can have a class directly as a service contract.
However, it is always a good idea to have an interface and then provide an implementation. In this way, we can keep and
maintain the declaration of the contract and implementation of the contract independently and modularly.
&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;
With WCF, it is possible to publish and consume web services in a very simple way. Although publishing a web service
is not as simple as in ASP.Net. However, as may be seemingly noticeable, the WCF may turn out to be much more flexible
than ASP.Net service. One of the flexibilities that we saw was to host it outside ASP.Net Runtime.
&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
    </content:encoded>
    <pubDate>Mon, 22 Jan 2007 21:00:21 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/21-guid.html</guid>
    </item>
</channel>
</rss>
