<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Mohamed Ibrahim Mostafa's Blog</title>
	<atom:link href="http://www.mohamedibrahim.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mohamedibrahim.net/blog</link>
	<description>Technical issues, problems, errors, findings &#38; resolutions covering Microsoft Dynamics CRM, software development, Microsoft .NET, C#, VB.NET, Commerce Server, Integration, E-Commerce, Scribe, Online shops and more general technology and consultancy posts.</description>
	<pubDate>Thu, 11 Mar 2010 13:50:37 +0000</pubDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating and Using Silverlight app settings (Web.config Configuration Applicatioin Settings) to change WCF service address after deployment.</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:47:30 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[General Development]]></category>

		<category><![CDATA[Silverlight]]></category>

		<category><![CDATA[Configuraiton]]></category>

		<category><![CDATA[Deployment]]></category>

		<category><![CDATA[ServiceReferences.ClientConfig]]></category>

		<category><![CDATA[Settings]]></category>

		<category><![CDATA[xap]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=149</guid>
		<description><![CDATA[The Problem:
&#8212;&#8212;&#8212;&#8212;
A) WCF Address (EndPoint address value):
Have you ever wanted to change the WCF service address (endpoint address) in your silverlight application after deployment. Imagine that you built a silverlight application and deployed it on your test server. The application was tested and confirmed issues and bug free. Now you want to re-deploy the application [...]]]></description>
			<content:encoded><![CDATA[<p>The Problem:<br />
&#8212;&#8212;&#8212;&#8212;<br />
A) WCF Address (EndPoint address value):<br />
Have you ever wanted to change the WCF service address (endpoint address) in your silverlight application after deployment. Imagine that you built a silverlight application and deployed it on your test server. The application was tested and confirmed issues and bug free. Now you want to re-deploy the application to the Live server but the WCF service address (end point address) is different which is probably quite common. It might also be that the address is the same but the port on which the WCF service is listening is different. In this case, you will need to change the value of the WCF endpoint address and re-build. So what happened to configuration files! They are a standard now in all Microsoft environments.</p>
<p>B) configuration application settings (like the one in web.config):<br />
In addition to this, your silverlight application might well need to have some configuration settings that you can change their values without having to re-build and re-deploy the whole application because of a small change in a connection string or appSetting value. Again, AppSettings in good old web.config files in ASP.net applications were the best solution in this case.</p>
<p>The problem is there is no clear web.config file in silverlight as the whole code is compiled into a (.xap) file which any html or aspx page can call.</p>
<p>Solution:<br />
&#8212;&#8212;&#8212;<br />
In my silverlight application, I had a connection string value that I need to use in my silverlight application (pass it to the webservice). Hence, I wanted the flexibility to change the WCF endpoint address and the connection string configuration value (or any other application setting). I started looking for a solution but I found that most work arounds were either two long or too complicated. As always, I like simple things and I don&#8217;t like over complications. I have to say though that most if not all work arounds that I found were useful for me to come up with this solution. I am not sure but I believe (and hope) the following solution is unique as I have searched for quite a while to find anyone suggesting this idea but I couldn&#8217;t find any.</p>
<p>Solution part 1: Changing WCF address and endpoint values in &#8220;ServiceReferences.ClientConfig&#8221;.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Anyway, the first thing we need to do is to understand that &#8220;ServiceReferences.ClientConfig&#8221; that all silverlight applications have and use if they are connecting to a WCF sercvice, is just a simple XML file. Actually, not only an XML file but also a configuration file for the application.</p>
<p>You also need to know that the silverlight xap (*.xap) file that silverlight generates is a simple compressed (zipped) file. For this reason, you actually can rename the file to (something.zip) from (something.xap) and then you can access its content. The content of the xap file includes AppManifes.xaml, your application dlls and most importantly &#8220;ServiceReferences.ClientConfig&#8221;.</p>
<p>Now, when I tried to unzip it, change the content of one of its files and then re-zip it and rename it back to (something.xap), this has corrupted it. My application failed. I am not sure why. This was the case despite the fact that most posts about unpacking, unzipping and re-packaging the .xap file works.</p>
<p>What actually works is the following:<br />
Rename the something.xap file to something.zip file. Open the zip file without unzipping (just double click on it) and then copy the file you want to edit, which in our case is the &#8220;ServiceReferences.ClientConfig&#8221; and paste it in a different location. Edit it and make all the changes you need to it and then copy it and paste back into the something.zip file. Replace the exisitng file there. Now go to something.zip and rename it back to something.xap.</p>
<p>Whatever change you have made should now work.<br />
Solution part 2: The simplest way for adding application settings to a silverlight application.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Now since ServiceReferences.ClientConfig is just an xml configuration file, you can actually edit it in visual studio and simply add your application settings.</p>
<p>Your file will look something like this:</p>
<p>&lt;configuration&gt;<br />
    &lt;system.serviceModel&gt;<br />
        &lt;bindings&gt;<br />
            &lt;basicHttpBinding&gt;<br />
                &lt;binding name=&#8221;xrmServiceBasicHttp&#8221; maxBufferSize=&#8221;2147483647&#8243;<br />
                    maxReceivedMessageSize=&#8221;2147483647&#8243;&gt;<br />
                    &lt;security mode=&#8221;None&#8221;&gt;<br />
                        &lt;transport&gt;<br />
                            &lt;extendedProtectionPolicy policyEnforcement=&#8221;Never&#8221; /&gt;<br />
                        &lt;/transport&gt;<br />
                    &lt;/security&gt;<br />
                &lt;/binding&gt;<br />
            &lt;/basicHttpBinding&gt;<br />
        &lt;/bindings&gt;<br />
        &lt;client&gt;<br />
            &lt;endpoint address=&#8221;<a href="http://localhost:1234/MyWCFService.svc">http://localhost:1234/MyWCFService.svc</a>&#8221; binding=&#8221;basicHttpBinding&#8221;<br />
                bindingConfiguration=&#8221;xrmServiceBasicHttp&#8221; contract=&#8221;XrmService.IXrmService&#8221;<br />
                name=&#8221;xrmServiceBasicHttp&#8221; /&gt;<br />
        &lt;/client&gt;<br />
    &lt;/system.serviceModel&gt;<br />
  &lt;appSettings&gt;<br />
    &lt;add key=&#8221;ConnectionString&#8221; value=&#8221;data source=ABC01;initial catalog=DB01;integrated security=SSPI;persist security info=False;packet size=4096&#8243; /&gt;<br />
  &lt;/appSettings&gt;<br />
&lt;/configuration&gt;</p>
<p>Now that you have added your application setting (connection string) to your ServiceReferences.ClientConfig, you need to use it in your silverlight code behind (.xaml.cs) file.</p>
<p>Remember, ServiceReferences.ClientConfig is just an XML file (already said that many times!). Hence, you can write a very simple and straight forward function that parses your ServiceReferences.ClientConfig xml file and returns the appSetting value of your application setting.<br />
A function to return an AppSetting value from your clientconfig file can look something like this:</p>
<pre>private string getAppSetting(string strKey)
        {
            string strValue = string.Empty;
            XmlReaderSettings settings = new XmlReaderSettings();           
            settings.XmlResolver = new XmlXapResolver();
            XmlReader reader = XmlReader.Create("ServiceReferences.ClientConfig");
            reader.MoveToContent();
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element &amp;&amp; reader.Name == "add")
                {
                    if (reader.HasAttributes)
                    {
                        strValue = reader.GetAttribute("key");
                        if (!string.IsNullOrEmpty(strValue) &amp;&amp; strValue == strKey)
                        {
                            strValue = reader.GetAttribute("value");
                            return strValue;
                        }
                    }
                }
            }
            return strValue;</pre>
<pre>        }
Finally in your code, to retrieve the AppSetting value for the appSetting key (ConnectionString) that you created, you can just call the above function like this:</pre>
<p>client.SetConnectionStringAsync(getAppSetting(&#8221;ConnectionString&#8221;));<br />
And One last thing, remember when you create the WCF service client object, don&#8217;t explicitly call the WCF service address, as it is already in your ClientConfig file.</p>
<p>So, just call the end Point Configuration Name (endPointConfigurationName) that you want to use. Just like this:</p>
<p>MyServiceClient client = new MyServiceClient(&#8221;MyServiceBasicHttp&#8221;);</p>
<p>&#8212;&#8212;&#8212;-</p>
<p>I hope this helps. I really think it is an effective way to get your AppSetting values.</p>
<p>If you got any questions, please comment below (Kindly don&#8217;t use the contact page for questions on posts please)</p>
<p>Also, please let me know (via a comment below) if you want a copy of this application code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/27/creating-and-using-silverlight-app-settings-webconfig-configuration-applicatioin-settings-to-change-wcf-service-address-after-deployment-servicereferencesclientconfig-servicereferences-clientconfig/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Problems with Deploying WCF services on IIS 7.0 (or IIS 6, IIS) and other deployment options and scenarios (visual studio .NET and Windows Activation Services)</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 19:21:05 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[Handler Mapping]]></category>

		<category><![CDATA[IIS]]></category>

		<category><![CDATA[Modules]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=143</guid>
		<description><![CDATA[There are 3 main ways to deploy Windows Communication Foundation - WCF services to consume:
1- IIS
2- Windows Activation Service a.k.a WAS
3- Visual Studio .NET for development and dev testing purposes as part of a visual studio solution.
For full details about Windows Communciation Foundation deployment scenarios, categories and structure please refer to this MSDN article: http://msdn.microsoft.com/en-us/library/cc512374.aspx
This [...]]]></description>
			<content:encoded><![CDATA[<p>There are 3 main ways to deploy Windows Communication Foundation - WCF services to consume:</p>
<p>1- IIS<br />
2- Windows Activation Service a.k.a WAS<br />
3- Visual Studio .NET for development and dev testing purposes as part of a visual studio solution.</p>
<p>For full details about Windows Communciation Foundation deployment scenarios, categories and structure please refer to this MSDN article: <a href="http://msdn.microsoft.com/en-us/library/cc512374.aspx">http://msdn.microsoft.com/en-us/library/cc512374.aspx</a></p>
<p>This post is focusing on issues and problems faced with WCF running on IIS.</p>
<p>Recently, I had a working WCF service that I wanted to deploy on one of my client&#8217;s web servers. The webserver is a simple Windows 2008 web server with obviously web server role turned on.</p>
<p>After publishing the WCF service, I logged on the web server&#8217;s IIS 7 management console and started creating the webservice as a separate website. Please note that you may be able to create the web service as a web application under the default website or any website if you want (haven&#8217;t tried it before but should work). But do NOT do this if your default website is a Microsoft Dynamics CRM application server. Reason being that if you do add a webservice under Microsoft Dynamics CRM website, you will probably cause problems and major issues with authentication, client policies, cross domains, etc, etc..</p>
<p>So, I created my WCF service as a new website. tryied to browse to the service .svc file (webservice.svc for example) but I got an error 404, no https handler avaialble to process this request. Error details says: &#8220;The page you requested has a file name extension that is not recognized, and is not allowed.&#8221;</p>
<p>Looking in my handler mappings, I found out that there is no resource Dlls or managed code, to handle responses for *.svc request type. Normally you should have one of three *.svc mappings:<br />
1- svc-Integrated handling *.svc - handler is System.ServiceModel.Activation.HttpHandler<br />
2- svc-ISAPI-2.0-64 handling *.svc - handler this time is IsapiModule<br />
3- svc-ISAPI-2.0 handling *.svc - handler is also IsapiModule.</p>
<p>If you dont have these handler mappings (although you normally should), make sure you add them manually. If you try to add them and can&#8217;t find any of the modules: IsapiModule or System.ServiceModel.Activation.HttpHandler, then go to Modules and make sure these two modules are enabled and avaialble.</p>
<p>This fixed my issue. But, you may have another problem:</p>
<p>- Make sure that in windows features, you have both WCF options under .Net framework are ticked. So go to Control Panel &#8211;&gt; Programs and Features &#8211;&gt; Turn Windows Features ON/Off &#8211;&gt; Features &#8211;&gt; Add Features &#8211;&gt; .NET Framework X.X Features. Make sure that .Net framework says it is installed, and make sure that the WCF Activation node underneath it is selected (checkbox ticked) and both options under WCF Activation are also checked. These are:<br />
* HTTP Activation<br />
* Non-HTTP Activation<br />
Both options need to be selected (checked box ticked).</p>
<p>- Make sure that the website is running as ASP .NET 2.0</p>
<p>- If you are still having problems, try Registering WCF From The Command Prompt . You can do this by running the following command from a command prompt (In Windows 7 you need to run command prompt as administrator - right click on shortcut and then click run as administrator).<br />
To register WCF from the command prompt, use the following commands:</p>
<p>Navigate to WCF folder:</p>
<p>cd %SYSTEMROOT%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation</p>
<p>Where %SYSTEMROOT% is usually by default C:/Windows/</p>
<p>Then run this command:<br />
ServiceModelReg.exe /i /x</p>
<p>Alternatively just run the following command:<br />
%SYSTEMROOT%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /i /x<br />
- If this still doesn&#8217;t work, please try the steps listed in this blog post: <a href="http://bloggingabout.net/blogs/jpsmit/archive/2007/01/17/wcf-http-404-when-hosted-in-iis.aspx">http://bloggingabout.net/blogs/jpsmit/archive/2007/01/17/wcf-http-404-when-hosted-in-iis.aspx</a></p>
<p>I haven&#8217;t tried any of these steps before but some people found it useful.<br />
All solutions are provided as is with no guarantees.</p>
<p>Please write a comment with any questions or experience you have with deploying WCF on IIS 7<br />
Hope this helps.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/24/problems-with-deploying-wcf-services-on-iis-70-or-iis-6-iis-and-other-deployment-options-and-scenarios-visual-studio-net-and-windows-activation-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction to LLBLGenPro - All you need to know to get started with LLBLGen Pro - Hello World! LLBLGen Pro</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/18/introduction-to-llblgenpro-all-you-need-to-know-to-get-started-with-llblgen-pro-hello-world-llblgen-pro/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/18/introduction-to-llblgenpro-all-you-need-to-know-to-get-started-with-llblgen-pro-hello-world-llblgen-pro/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 20:13:50 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[General Development]]></category>

		<category><![CDATA[business Data]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Data Layers]]></category>

		<category><![CDATA[LLBLGen Pro]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=139</guid>
		<description><![CDATA[In one of my latest projects, I found the client extensively using LLBL Gen Pro which I have never used before. After few hours of playing around with it, I managed to find my way round it just enough to the level that I need to get the basic functionality working.
Hence, for this reason, I [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my latest projects, I found the client extensively using LLBL Gen Pro which I have never used before. After few hours of playing around with it, I managed to find my way round it just enough to the level that I need to get the basic functionality working.</p>
<p>Hence, for this reason, I thought I will write a post to show the basic and first steps for using LLBL Gen Pro to be used as an introduction by anyone who is, like me few weeks ago, was completely new to LLBLGen Pro.</p>
<p>As it is always the case in most of my posts, I focus on the basic start up functionality straight to the point but if you need further detailed instructions and guides on LLBL Gen Pro then I definitely suggest you start with the online documentation and especially the concepts article. <a href="http://www.llblgen.com/documentation/2.6/Concepts/concepts_entitylistview.htm">http://www.llblgen.com/documentation/2.6/Concepts/concepts_entitylistview.htm</a></p>
<p>For the full LLBL Gen Pro 2.6 Documentation, go to their online user documentation at: <a href="http://www.llblgen.com/documentation/2.6/hh_start.htm">http://www.llblgen.com/documentation/2.6/hh_start.htm</a></p>
<p>The main feature of LLBLGen Pro is that it automatically creates a data layer for any application to use. The data layer provides full access and complete data management DML And DDL features for you allowing complete control of the specified Database.</p>
<p>LLBLGen Pro generates this Data layer for a variety of database types including full support for the following data bases: Firebird, IBM DB2, MS Access, My SQL, Oracle 8,9,10 and 11, Sybase, PostgreSQL and of course almost all Microsoft SQL Server version such as SQL Server 7, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server Express and MSDE drive. wow! You literally don&#8217;t need to write any code, it&#8217;s a full data layer created for you to access any database from any of the above types.</p>
<p>LLBLGen Pro generates the code as a .NET project built in your chosen development language (C# or VB.NET). LLBLGen Pro accesses your database using servername and login id and password in case of DB specific Authentication or just windows authentication if your database allows that. It will then generate the code along with the web.config that already has the connection string to your Database.</p>
<p>Now to use LLBLGen Pro you need to do the following:</p>
<p>First thing to do is obviously to install LLBLGen Pro and add the license file to its installation folder. Next is to run the application from the start menu.</p>
<p>Once LLBLGen is loaded, you need to create a new project. Go to File &#8211;&gt; New project. Fill in the details as follows:<br />
Name: Project name, Create: User, Location: Location where to create the LLBLGen project file.</p>
<p>Select the database driver (database type), database server name and  Authentication type, then hit Connect.</p>
<p>Once connected to the server, you will get the list of available catalogs (DataBases) within this database server.</p>
<p>Select your chosen Database(s) (you can select more than one) and then click Create.</p>
<p>Once you have done that, the project is now created and saved at the selected location.</p>
<p>Next step is to go and add the tables, views and stored procedures. To do this, right click on Entities and click on add new entities mapped on tables. To add views, right click on Entities and add entities mapped on views, and so on.</p>
<p>Once you have added all your tables and views, they will be all created as Entities. i.e. converted to classes in LLBLGen Pro generated code.</p>
<p>Now you got the project ready for generating the code, there are much more detailed configuration that you can do if you want to create complex code, but for most straight forward data layers, this project configuration is enough.</p>
<p>Now go to Project &#8211;&gt; Generate, and you will get the code generation screen. This is where you need to specify the details about the generated code and the project holding it.</p>
<p>The Generate Project Window has 3 tabs. For simplicity and straight forward, not complicated, first project, you only need to fill in the General Settings details. They are the main and most used settings. You can use more complex ones later if you want to.</p>
<p>Target Language: Language to generate the LLBLGen Pro code in (I only tried C#).<br />
Target Platform: Which .NET framework (.NET 3.5 for latest)<br />
Root namespace: Namespace for the generated project<br />
Template Group: Choose self servicing. This is the default and straight forward option in my view.<br />
Destination Root folder: Folder where all generated code files will be created.</p>
<p>Everything is ready now, Click Generate!</p>
<p>Done.</p>
<p>The generated code can be found at the destination root folder specified in the previous step. You will see that the generated code is of type class library. Now go to your solution and add the generated project (Right click on solution &#8211;&gt; add existing Project &#8211;&gt; new LLBL generated project).</p>
<p>Next and final step in this LONG post is to just add another project that you want to use to work with the data layer that LLBLGen Pro has just created for you as a new project.</p>
<p>Using LLBLGen Pro classes is easy and straight forward but this is the subject of another post, if anyone is interested?!</p>
<p>Please comment if you want me to blog on using LLBLGen Pro generated code basics and introduction.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/18/introduction-to-llblgenpro-all-you-need-to-know-to-get-started-with-llblgen-pro-hello-world-llblgen-pro/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Problem Running WCF on Visual Studio 2008 and Windows 7 - could not find host - page timeout</title>
		<link>http://www.mohamedibrahim.net/blog/2010/01/05/problem-running-wcf-on-visual-studio-2008-and-windows-7-could-not-find-host-page-timeout/</link>
		<comments>http://www.mohamedibrahim.net/blog/2010/01/05/problem-running-wcf-on-visual-studio-2008-and-windows-7-could-not-find-host-page-timeout/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:06:33 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[WCF]]></category>

		<category><![CDATA[Administrator]]></category>

		<category><![CDATA[Timeout]]></category>

		<category><![CDATA[Visual Studio .NET]]></category>

		<category><![CDATA[Web Service]]></category>

		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=137</guid>
		<description><![CDATA[This post is about a problem that I have had recently with visual studio .Net 2008, WCF and Windows 7.
I have a working WCF service (add to the solution by another person) which I am trying to run from within my visual studio 2008. Normally, you should go to your project, right click on it [...]]]></description>
			<content:encoded><![CDATA[<p>This post is about a problem that I have had recently with visual studio .Net 2008, WCF and Windows 7.</p>
<p>I have a working WCF service (add to the solution by another person) which I am trying to run from within my visual studio 2008. Normally, you should go to your project, right click on it and click on add service reference. You should then search for services within the solution and add the WCF service which is in the same solution. This will even work if it is in a different solution as long as the WCF service is in a Visual Studio solution that is currently open.</p>
<p>When I try to search for this service and add it, I got timeout error, error downloading service information and if I try to run the service itself by navigating to it from Visual studio, the wcfservice.svc file itself does not open. It comes out with could not find host, page cannot be displayed and timeout errors.</p>
<p>After spending sometime trying to find out what is causing it, I found out that I have miraculously forgot to run Visual studio 2008 as Administrator. Basically, when you want to run visual studio 2008, you need to right click on its shortcut icon (in the task bar in windows 7) and click on Run As Administrator. This way, you will be running Visual studio as an administrator. Even if you are an administrator on the machine, you will not be running visual studio as admin if you just click on it to open.</p>
<p>I know this issue sounds simple and not a lot of people will have that but, I believe the post might be helpful to someone. I can&#8217;t recall having this problem on Windows server 2003, windows server 2008, windows vista or even winsows XP! It&#8217;s only happening on this development machine which was built for me using Windows 7.</p>
<p>If you want to stop having to right click on the shortcut icon and click on run as administrator everytime, there is a simple way to make an application to run as administrator by default permanently. Go to visual studio .net shortcut on the start menu (or the other application that you want it to always run as administrator), right click on the visual studio application icon, and click on properties. In the application properties, click on compatibility tab and then check the privilege level option that says &#8220;Run this program as administrator&#8221;.</p>
<p>This should get you to always run visual studio or any other application always as an administrator.</p>
<p>Please comment if you found this post useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2010/01/05/problem-running-wcf-on-visual-studio-2008-and-windows-7-could-not-find-host-page-timeout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introduction and Notes about WCF, Silverlight and Creating a Silverlight application that consumes - invokes a WCF service via async (asynchronous) web service call</title>
		<link>http://www.mohamedibrahim.net/blog/2009/11/03/introduction-notes-about-wcf-silverlight-and-creating-a-silverlight-application-that-consumes-invokes-a-wcf-service-via-async-asynchronous-web-service-call/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/11/03/introduction-notes-about-wcf-silverlight-and-creating-a-silverlight-application-that-consumes-invokes-a-wcf-service-via-async-asynchronous-web-service-call/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:31:00 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[Silverlight]]></category>

		<category><![CDATA[WCF]]></category>

		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Web Service]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=132</guid>
		<description><![CDATA[This post is an introduction and a collection of some useful information, notes and facts about WCF in genreal, Silverlight and running a silverlight web application that uses a WCF service via asynchronous web service call.
- The first fact that you need to know is that:
The only option for web service calling in Silverlight is [...]]]></description>
			<content:encoded><![CDATA[<p>This post is an introduction and a collection of some useful information, notes and facts about WCF in genreal, Silverlight and running a silverlight web application that uses a WCF service via asynchronous web service call.</p>
<p>- The first fact that you need to know is that:</p>
<p>The only option for web service calling in Silverlight is asynchronous and Silverlight framework does not provide any API for synchronous call. Saying that, there are few work arounds for synchronous web service calls from silverlight to a WCF service. Personally, I haven&#8217;t tried or need to use any of these. If you are interested, you can look at one of these posts:<br />
 * <a href="http://weblogs.asp.net/razan/archive/2010/01/14/emulating-synchronous-web-service-call-in-silverlight.aspx">http://weblogs.asp.net/razan/archive/2010/01/14/emulating-synchronous-web-service-call-in-silverlight.aspx</a><br />
 * <a href="http://marcgravell.blogspot.com/2009/02/async-without-pain.html">http://marcgravell.blogspot.com/2009/02/async-without-pain.html</a><br />
 * <a href="http://petesbloggerama.blogspot.com/2008/07/omg-silverlight-asynchronous-is-evil.html">http://petesbloggerama.blogspot.com/2008/07/omg-silverlight-asynchronous-is-evil.html</a><br />
- The greatest advantage of calling methods asynchronously is because it enables the application to continue doing useful work while the method call runs. If there is any delay from the WCF service in sending back the required data, Async calls ensures that your client application is not hanging there freezing and doing nothing until the Windows Communication Foundation (WCF) services returns the requried data. WCF and clients can participate in asynchronous operation calls at two distinct and different levels of the application. This makes WCF applications flexibile to maximize throughput balanced against interactivity.</p>
<p>- Visual Studio .NET 2008 gives you two project templates to create a WCF project:<br />
 1- &#8220;WCF Service Application&#8221; and<br />
 2- &#8220;WCF Service Library.&#8221;</p>
<p>WCF Service Application is the conventional web service application similar to ASP.NET web service but in this case built on Windows Communication Foudnation technology.</p>
<p>WCF Service Library project is different. The output of this project is a compiled dll file(s) along with a dll.config configuration file. The produced output can then be added to a client service application or project, deployed as a separated secure web service or as part of a larger hosted web service.</p>
<p>- When creating a WCF service for a silverlight application, you can simply add the WCF service to the test Web project which is added by default by Visual Studio when you create a new Silverlight 3 project. You can do this by right clicking on the silverlight web project (test project usually called .Web) and then click on add new item. In the new item window, always choose in this case silverlight enabled WCF service as this adds one line to your web.config. On the other hand, you can add the WCF service as another project to the same solution or even a separate solution which is the more practical approach as normally the web service is separate and hosted independantly from its client(s).</p>
<p>- If the WCF client application is not silverlight, opt to use the asynchronous approach in your operation implementation especially in the case when the service implementation makes a blocking call, such as doing Input/Output IO work.</p>
<p>Generally, even if you have a choice to choose between a synchronous and asynchronous call, always try to opt for the asynchronous one.</p>
<p>MSDN (and Microsoft) specifies the essential cases that you need to use Asynchornous calls to WCF as follows:</p>
<p>* If it is a silverlight application (the only option you have really!).</p>
<p>* If you are invoking operations from a middle-tier application.</p>
<p>* If you are invoking operations within an ASP.NET page, use asynchronous pages.</p>
<p>*- If you are invoking operations from any application that is single threaded, such as Windows Forms or Windows Presentation Foundation (WPF).</p>
<p>In all these cases, always try to opt to Async calls rather than synchronous if this is an option.<br />
- WCF is Microsoft&#8217;s attempt of unifying web and distributed services. WCF services can work with a variety of client applications including php, ruby, etc. and any client that can use basicHTTP binding.</p>
<p>- WCF is regarded as the successor to conventional Microsoft web services and communication technologies such as: DDL, DCOM, Remoting, Web Services, WSE, etc.. This is especially because WCF is built with the aim to provide &#8220;SOA&#8221; or Service Oriented Architecture for distributed applications.</p>
<p>- WCF can have messages sent in a variety of channels including HTTP, TCP, MSMQ, Named pipe, etc.</p>
<p>- WCF runtime resides under the System.ServiceModel namespace.</p>
<p>- In most cases WCF has a much better and faster performance ranging between 25%-50% in some cases. Refer to this MSDN article for some comparisons: <a href="http://msdn.microsoft.com/en-us/library/bb310550.aspx">http://msdn.microsoft.com/en-us/library/bb310550.aspx</a></p>
<p>- The throughput of WCF is inherently scalable from a single processor to a quad processor.</p>
<p>- The WCF model unifies the feature wealth of ASMX, WSE, Enterprise Services, MSMQ, and Remoting. This way, developers only have to master a single programming model.</p>
<p>- WCF can be hosted in IIS Servers, Windows services and standalone apps like windows forms, console apps.</p>
<p>- WCF provides a DataContractSerializer which allows complex data types and private attributes to be serialized and sent. Being Serializable means, the object can be hydrated, dehydradted from a stream/bunch of bytes, into a living class instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/11/03/introduction-notes-about-wcf-silverlight-and-creating-a-silverlight-application-that-consumes-invokes-a-wcf-service-via-async-asynchronous-web-service-call/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configure Microsoft SQL Server to allow remote connection and remote SQL Management Studio access</title>
		<link>http://www.mohamedibrahim.net/blog/2009/10/10/setup-configure-microsoft-sql-server-to-allow-remote-connection-remote-sql-management-studio-access/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/10/10/setup-configure-microsoft-sql-server-to-allow-remote-connection-remote-sql-management-studio-access/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 18:31:38 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[Microsoft SQL Server]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Remote Connection]]></category>

		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=127</guid>
		<description><![CDATA[To get straight to the point. I have been trying to setup Microsoft SQL Server 2008 to allow remote connection and specifically I wanted the SQL server to allow SQL Server Management Studio on a different computer completely outside the network to be able to access this remote SQL Server and manage it fully without [...]]]></description>
			<content:encoded><![CDATA[<p>To get straight to the point. I have been trying to setup Microsoft SQL Server 2008 to allow remote connection and specifically I wanted the SQL server to allow SQL Server Management Studio on a different computer completely outside the network to be able to access this remote SQL Server and manage it fully without having to login on the remote Dedicated standalone SQL server. I also wanted to be able to access this server remotely from visual studio .net on the client machine. Please be aware that I am trying the extreme settings here of getting client (management studio or visual studio) to connect to the host server (SQL Server) where the client is on a completely different network from the host. i.e. This is a 100% Internet only remote connection not within the same network, lan, or even trusted domains, forests, etc..</p>
<p>There are a lot of setup steps that you need to do but remember there are two main parts of this setup:</p>
<ol>
<li>configure SQL Server to accept remote connection and,</li>
<li>Setup and Configure the firewall running on this server machine to allow inbound incoming connections.</li>
</ol>
<p>Step 1 is straightforward and there are a lot of MSDN and Technet articles that explain it. But anyway, to make this post informative here are the main steps:</p>
<ul>
<li>Go to Programs -&gt; SQL Server -&gt; SQL Server Configuration tools -&gt; SQL Server Configuration Manager.</li>
<li>Make sure that the SQL Server Browser service is running under (SQL Server Services).</li>
<li>Go to SQL Server Network Configuration, open the SQL Server instance that you want to use. Make sure that the TCP IP Protocol is enabled.</li>
<li>right click on this TCP/IP protocol node and click properties. Go to IP Addresses tab. Make sure that the server IP Address is: 1) on the list of IPs, 2) is Active, 3) is enabled.</li>
<li>You can either: a) let your SQL server to listen on all server ports for any incoming SQL server connection OR b) you can specify which exact port to listen to. For a) set TCP dynamic Port to &#8220;0&#8243; and leave the TCP port value blank. To achieve b) set dynamic value to blank and the TCP port to the port number that you want the server to listen to.</li>
<li>Restart the SQL Server instance service from SQL server Services node (All this configuration is still done from within the SQL Server Configuration Manager).</li>
<li>Go to the SQL server instant in management studio -&gt;right click -&gt; properties -&gt; connections -&gt; Allow remote connections to this server.</li>
<li>Also, Go to the SQL server instant in management studio -&gt;right click -&gt; properties -&gt; Security -&gt; Allow SQL Server and Windows authentication mode.</li>
<li>Look at this article for more details: <a href="http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/ec77d275-99c7-4cc0-b60d-707bde6f8c67/">http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/ec77d275-99c7-4cc0-b60d-707bde6f8c67/</a></li>
</ul>
<p>Step 2 is the step I struggled with. Basically, I was unable to connect and didn&#8217;t know whether it is a Firewall problem or a problem with my configuration of the SQL server (step 1). Best way to troubleshoot that, allow ALL incoming inbound connections on your firewall. Try to connect remotely to the server (using the SQL Server management studio or Visual Studio .NET), if it works, then your issue was the Firewall. If it doesn&#8217;t, then it is an issue with SQL server configuration. PLEASE REMEMBER to disallow incoming inbound connections after you did this test!!!</p>
<p>For step 2, you need to do the following to setup and configure your windows server Firewall to accept and allow incoming connections to the host server on which you got SQL Server. So, Host Server Firewall configuration is as follows:</p>
<ul>
<li>Allow incoming TCP port number 1433</li>
<li>Allow incoming UDP port number 1433</li>
<li>Allow incoming UDP port number 1434</li>
<li>Allow incoming TCP port number 135</li>
<li>Add the program sqlservr.exe to the exceptions list. By default, sqlservr.exe is installed in C:\Program Files\Microsoft SQL Server\MSSQL10.InstanceName\MSSQL\Binn, where InstanceName is MSSQLSERVER for the default instance, and the instance name for any named instance.</li>
</ul>
<p>Once I have added all these ports to my exception list, i.e. opening all these ports for incoming traffic allowing access to my server, once I have done that, all my problems were solved and I managed to connect to the SQL server remotely via the Internet (not an internal network) where the client and host have no direct connections what so ever.</p>
<p>Some articles and useful resources related to step 2 (Firewall setup):</p>
<ul>
<li><a href="http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/ec77d275-99c7-4cc0-b60d-707bde6f8c67/">http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/ec77d275-99c7-4cc0-b60d-707bde6f8c67/</a> </li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc646023.aspx">http://msdn.microsoft.com/en-us/library/cc646023.aspx</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms175043.aspx">http://msdn.microsoft.com/en-us/library/ms175043.aspx</a></li>
</ul>
<p>One final note:  The format to input the server name in the SQL Management Studio connect to server object box is as follows:</p>
<p>&lt;IP&gt;,&lt;port&gt;\InstanceName</p>
<p>for example: 92.37.54.28,2345\InstanceName</p>
<p>If you selected the all ports option. i.e. dynamic port = 0 and TCP Port is blank (as in step 1 above), then the format will be something like that:</p>
<p>server name box should have: 92.37.54.28\InstanceName or just the IP address for the default instance (haven&#8217;t tried to setup a default instance though.. I have used named instances for added security.</p>
<p>That&#8217;s all for now. Hope this helps. Please write a comment if you have anything to add, correct me or if you have any related question. Please let me know if you need any help or support on this.</p>
<p>Thanks,</p>
<p>Mohamed Mostafa</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/10/10/setup-configure-microsoft-sql-server-to-allow-remote-connection-remote-sql-management-studio-access/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Search Engine Optimisatin (SEO) Top Tip. Help and Advice on SEO.</title>
		<link>http://www.mohamedibrahim.net/blog/2009/09/24/search-engine-optimisatin-seo-top-tip-help-and-advice-on-seo/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/09/24/search-engine-optimisatin-seo-top-tip-help-and-advice-on-seo/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:26:16 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[Search Engine Optimisation]]></category>

		<category><![CDATA[Blog]]></category>

		<category><![CDATA[Forum]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Tip]]></category>

		<category><![CDATA[Trick]]></category>

		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=125</guid>
		<description><![CDATA[I was recently doing on some Search Engine Optimisation work for some websites and I have given them an advice that i have personally used before and that have proved to be very effective. I am sharing this Tip with you for free! Please comment on this post with your opinion on whether or not this works [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently doing on some Search Engine Optimisation work for some websites and I have given them an advice that i have personally used before and that have proved to be very effective. I am sharing this Tip with you for free! Please comment on this post with your opinion on whether or not this works as it has worked well with me.</p>
<p>Do you want to get Top forums and Top blogs mentioning your website and linking to your website. When high traffic good quality forums and blogs start linking and pointing to your website, this will have an excellent impact on your website search results rank.</p>
<p>So how do you get them to do that, and for free?</p>
<p>Here is the tip and the trick.</p>
<p>Go and add your own posts on Forums that are related to your business. Choose the best and highest traffic forums, and simply add good quality posts related to your chosen &#8220;related&#8221; thread. Make sure your post is of good quality, to the point and is helpful. Simply add your website URL to the bottom of your post, in the signature area. You can even add another link to your website in your post if the link is related to the topic and will provide additional useful information to the forum/blog post topic.</p>
<p>It’s a brilliant free and top quality way of improving your website ranks.</p>
<p>This way, you will hit two birds with one stone:</p>
<ol>
<li>Advertising your own website on a high traffic forum. So people will start looking at your site and visit it.</li>
<li>Robots will see your links on good important forums and start giving you the thumbs up for good community links.</li>
</ol>
<p>If you find this tip useful, please comment with your experience on whether this works and how much impact it could have or if it have had a good impact on your own website.</p>
<p>Please also comment with your views and advice on Search Engine Optimisations (SEO) in general.</p>
<p>I will be creating more posts with more general advice and help on SEO. It will be like an Introduction to Search Engine Optimisation methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/09/24/search-engine-optimisatin-seo-top-tip-help-and-advice-on-seo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Methods to Bulk Delete Microsoft Dynamics CRM records and Using Scribe Insight to perform a Bulk Delete of all CRM records.</title>
		<link>http://www.mohamedibrahim.net/blog/2009/09/23/microsoft-dynamics-crm-bulk-delete-methods-using-scribe-insight-for-bulk-delete-dynamics-crm-records/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/09/23/microsoft-dynamics-crm-bulk-delete-methods-using-scribe-insight-for-bulk-delete-dynamics-crm-records/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 18:24:03 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Microsoft Dynamics CRM]]></category>

		<category><![CDATA[.NET]]></category>

		<category><![CDATA[CRM]]></category>

		<category><![CDATA[Dynamics]]></category>

		<category><![CDATA[Field]]></category>

		<category><![CDATA[SCRIBE]]></category>

		<category><![CDATA[Scribe CRM Adaptor]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=117</guid>
		<description><![CDATA[I&#8217;m sure many people needed to do a bulk delete operation on Microsoft Dynamics CRM 4.0. You may have uploaded thousands of records from an imported file or migrated them through Scribe or even used a .NET application to mass create records.
Unfortunately, and as far as I can see, there is no straight forward way [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure many people needed to do a bulk delete operation on Microsoft Dynamics CRM 4.0. You may have uploaded thousands of records from an imported file or migrated them through Scribe or even used a .NET application to mass create records.</p>
<p>Unfortunately, and as far as I can see, there is no straight forward way to do bulk records deletion on Dynamics CRM 4.0 using the out of the box functionality and interface of Dynamics CRM 4.0.</p>
<p>To bulk delete records in Dynamics CRM 4.0, you have the following main options:</p>
<ul>
<li>Get a third party tool or CRM add-on to bulk delete records. This option is a straight forward one but you might have to pay for purchasing or using the tool. It may also have security issues. I would not recommend it to my clients as most probably the tool is created by a small company or an individual which I don&#8217;t know. Hence, it will be rather difficult to put this tool on a live Production environment or client server. Let alone adding it to CRM Online or to a CRM hosted solution by a partner.</li>
<li>Use CRM SDK to write a .NET application (or a .NET console application) that will run and delete all records for a specified entity or entities. This is a more robust way of doing it, but it may take longer time and is probably not suitable for people who do not come from .NET development background.</li>
<li>Use Scribe Insight. This is what this post is about really.. Using Scribe Insight to bulk Delete Dynamics CRM records.</li>
</ul>
<p>Please Note: This is a work around. It is not supported by Scribe and the advice in this post is provided as is with no warranty. I have tried it and it works perfectly but can not guarantee it will have the same acceptable results in any other environment.</p>
<p>Here is what you need to do:</p>
<ol>
<li>Create a new Scribe workbench DTS (or Job). Point to your usual source file (even a sample one) and point to CRM: either IFD Forms for hosted CRM or direct connection.</li>
<li>Configure the targe: Create one delete step on the target.</li>
<li>Make sure that the option to &#8220;Allow multiple record matches on updates/deletes&#8221; is ticked under the All steps tab.</li>
<li>Under Step control tab, leave failure to go to next row but change all the success records (Success (0), Success (1) and Success (&gt;1) ) to End Job. Select success radio button at the bottom and write a message to your log such as: &#8220;All records Deleted&#8221;.</li>
<li>No Data links are important as you are only deleting.</li>
<li>On the Lookup link, just make the lookup condition impossible. Such as: where Account Name = 123456789 or whatever.</li>
<li>Run the DTS.</li>
</ol>
<p>The Job will read the first source line. Will then try to find this record at the target (remember it is update/delete). Since we have setup the lookup link to look for something &#8220;impossible to find&#8221;, the result of the update will be Success (0).</p>
<p>Once this happens, Scribe will go and delete all records for your chosen entity (or CRM table). This will be a complete bulk delete of all CRM records using Scribe.</p>
<p>Remember, it&#8217;s a work around&#8230; that works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/09/23/microsoft-dynamics-crm-bulk-delete-methods-using-scribe-insight-for-bulk-delete-dynamics-crm-records/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL Server Reporting Services Error cannot decrypt the symmetric encryption key &amp; website declined to show this web page</title>
		<link>http://www.mohamedibrahim.net/blog/2009/09/16/sql-server-reporting-services-error-cannot-decrypt-the-symmetric-encryption-key-website-declined-to-show-this-web-pag/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/09/16/sql-server-reporting-services-error-cannot-decrypt-the-symmetric-encryption-key-website-declined-to-show-this-web-pag/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 18:16:21 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[Reports Server]]></category>

		<category><![CDATA[Encryption]]></category>

		<category><![CDATA[Encryption Key]]></category>

		<category><![CDATA[Error]]></category>

		<category><![CDATA[Event Log]]></category>

		<category><![CDATA[Event Viewer]]></category>

		<category><![CDATA[IIS]]></category>

		<category><![CDATA[Report Server]]></category>

		<category><![CDATA[Report Viewer]]></category>

		<category><![CDATA[Reporting Services]]></category>

		<category><![CDATA[Reports Manager]]></category>

		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=108</guid>
		<description><![CDATA[One of our &#8220;big and important&#8221; clients has approached us with an issue with their system. The problem is that reports are not accessible from the .NET application and CRM that we have built for them. If you try to open reports from these, you get the error in Internet Explorer saying &#8220;Website declined to [...]]]></description>
			<content:encoded><![CDATA[<p>One of our &#8220;big and important&#8221; clients has approached us with an issue with their system. The problem is that reports are not accessible from the .NET application and CRM that we have built for them. If you try to open reports from these, you get the error in Internet Explorer saying &#8220;Website declined to show this webpage. The website requires you to login&#8221;. We were getting this error with everything related to reporting services. So when logged on the reports server machine, those urls:  <a href="http://localhost">http://localhost/reports</a> , <a href="http://localhost/reportserver">http://localhost/reportserver</a> , <a href="http://localhost/reportsmanager">http://localhost/reportsmanager</a> all come back with this error or with the error 403 forbidden &#8220;Error 403 Forbidden access&#8221;.</p>
<p>To rectify this issue, I went through all the usual possible routes such as authentication on IIS, reports server and reports website on IIS. Made sure that all the application and system users have the right access to the reports server. Checked the application pool for the reports server, all these looked find with nothing that has been unchanged. I have also tried to check the reports server configuration manager. Went through all the usual steps to check that it is running and configured properly and again these were all fine with the nice green tick next to each step of the reports server configuration manager. I have also checked services running on the server and the server even viewer. All windows services and SQL reporting server services were running correctly and can be restarted with no issue.</p>
<p> Then, a colleague of mine, tried to open reports from the management studio, and that was it. The error we got in the management studio was much more descriptive and helpful. The SSRS reports server management studio error said:</p>
<p>&#8220;<span style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Report server disabled&#8221;</span></p>
<p>The problem here is because that the Reporting Services encryption key has been invalidated, in other words corrupted. This encryption key is stopping reporting services from returning any reports or even displaying the reports manager, etc..</p>
<p>To fix this issue, and after some research, there were two solutions to solve this issue (again solutions found by my colleague, not me!):</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"><span style="text-decoration: underline;">Solution1</span>: <span style="color: #000000;">In SSRS 2005, there is the encryption section on the left hand side.  We need to go to this section and restore the encryption key using a backup encryption key. The encryption key should probably (and hopefully) have been backed up during the setup of the Reporting Services. This encryption key should be regularly backed up and stored in a safe location along with the encryption key password. If you got this backup encryption key, and to solve this error, we need to restore it from the Reporting Services Configuration Manager, encryption section.</span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"><span style="color: #000000;">If you you don&#8217;t have backup of it, then you will have to go for the other longer and more annoying option which is:</span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"><span style="text-decoration: underline;">Solution2</span>: <span style="color: #000000;">You have to delete the encrypted content. This will remove the connection strings from all the reporting services data sources. Hence, in this case and after removing the encryption and generating a new one, you need to reset the data sources in Report Manager. Datasources could be shared (linked) or could be a separate data source for each report. You will need and update all these data sources after you removed the encryption.</span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"> </p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"><span style="color: #000000;">Luckily! Our good client had the backup of the encryption key, so we only needed to do solution one (Thank God for that!). Well, to be fair, they searched on the server and found a file with extension &#8221; <strong>*.snk &#8220;</strong> on their server and it was the encryption key backup.</span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"><span style="color: #000000;">All SSRS encryption keys have file extension .snk.</span></p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt">That&#8217;s it.. problem solved. Thanks again to my colleagues work on these solutions.</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/09/16/sql-server-reporting-services-error-cannot-decrypt-the-symmetric-encryption-key-website-declined-to-show-this-web-pag/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Post code and Address lookup Using PAF for auto filling address details on websites</title>
		<link>http://www.mohamedibrahim.net/blog/2009/09/02/post-code-and-address-lookup-paf-auto-fill-on-websites/</link>
		<comments>http://www.mohamedibrahim.net/blog/2009/09/02/post-code-and-address-lookup-paf-auto-fill-on-websites/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 09:45:44 +0000</pubDate>
		<dc:creator>Mohamed Ibrahim Mostafa</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[General Development]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Address]]></category>

		<category><![CDATA[Auto-fill]]></category>

		<category><![CDATA[Lookup]]></category>

		<category><![CDATA[PAF]]></category>

		<category><![CDATA[Royal Mail]]></category>

		<guid isPermaLink="false">http://www.mohamedibrahim.net/blog/?p=94</guid>
		<description><![CDATA[I was recently researching how to implement post code and address look-up on websites and on Microsoft Dynamic CRM. This feature is widely used in auto filling address details when a customer input their post code and sometimes the house number. This is also used in some desktop applications, plug-ins to Microsoft Dynamics CRM, in [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently researching how to implement post code and address look-up on websites and on Microsoft Dynamic CRM. This feature is widely used in auto filling address details when a customer input their post code and sometimes the house number. This is also used in some desktop applications, plug-ins to Microsoft Dynamics CRM, in store locator functions, bank details verification and in applications where the customer inputs their post code and the system can accordingly specifies which region or area the customer falls into. For example, quote websites, i.e. websites offering quotes for nationwide website visitors, will most probably need to know which region the customer is part of so if he is from the North East of England, the server may be much cheaper for example than in London.</p>
<p>After a bit of research, I found out that there several UK post code suppliers. The major supplier is of course as expected Royal Mail. Royal Mail provides a service called <a title="Postcode Address File (PAF)" href="http://www.royalmail.com/portal/rm/content3?mediaId=56000705&amp;catId=400085" target="_blank">Postcode Address File (PAF®)</a>. The problem though is that Royal Mail will not give you any application, they will just give you some raw data on a CD and they will be sending you updates for this data every month, 3 months, 6 months and even some daily changes depending on your choice. The data is great and I think it does have almost all Britain&#8217;s postcode areas and addresses. Regular updates also ensures that the information is up to date. The raw data though needs to be manipulated by an application. Some hard coding will be required which is not too difficult to do but if you are not an experienced developer or have no development background, this will be an issue for you. I will try to address the coding of such functionality in Microsoft .NET (C# and VB.NET) in a later post.</p>
<p>Alternatively, I found out about quite a few online companies that provide solutions for the raw data. So, basically they create web-services which manipulate Royal Mail (PAF ) raw data and all you need to do is to write simple code to return the details you require. So you pass on the post code to them for example and they send you back the full address details. Many of them will even give you example code making your life easier. If you do not need this for a website, you can always opt for their other services such as an online application for you that you can login to and get the address information you require.</p>
<p>Pricing of these post code data providers varies with most of them if not all providing the service using credits. So each credit gives you one address information request. Credits are sold in packs with prices averaging around £50 for 750 credits pack. Do not buy the first one you see, ask around and shop around. Royal Mail though has a different licence structure with prices starting from £85 for a single workstation and £2 for every extract up to £££thousands of pounds for a multi-organisation multi-server licences. </p>
<p>If you need more information, recommendation and links to the best providers of this post code and address information services, please get in touch and I will get back to you. I have now managed to nail down the best providers and got good offer from them. Just get in touch!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohamedibrahim.net/blog/2009/09/02/post-code-and-address-lookup-paf-auto-fill-on-websites/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
