Author Archives: Zafar Iqbal

which webservices are available in which version of SharePoint

We are working on a client application, which required to access data from SharePoint too. The best way to do that is to consume webservices exposed by SharePoint. While consuming them, we wanted to make sure which services are available in which version. We tried to find any matrix for that, but could not find one. So I thought of building it myself, so that others can reference it.

Continue reading

Why XML request is not properly parsed by WCF REST service?

Today we had a very rough day, one of us had created a WCF REST service, and other one was trying to consume it in his IOS application, but he was not getting the correct response. We tested that call using Fiddler, could not find any problem in that. We tried very hard to troubleshoot why was that happening, but no luck.

We enabled WCF trace and message logging, although we could not log the actual message body, but we were able to review the headers of both calls. We found several differences other than the user-agent, and we experimented with most of them.

Continue reading

log4net – another way to change log file location on runtime

In my previous post I wrote about the simplest way of specifying logging location, which limited the solution only to environment variables set on a particular machine. However if you wanted to expand on all types of special folders available in Windows then we will have to look for a different solution, fortunately support for that is also available within log4net.

Difficulty level of this solution is a bit high, but it provides nearly 60 locations to choose from, as it uses “Environment.SpecialFolder” enumeration.

Continue reading

log4net – changing log file location on runtime

In one of our application we are using apache log4net, initially we were logging to the “logs” folder, which was located in the application installation folder. When we were testing this application on different Windows operating systems, it was not generating logs when we ran our application under least privileges account.

Where should we log then?

Continue reading

google maps in a razor view

These days I was working on a ASP.NET MVC web application to show events on a map. I had to use Google Maps for that purpose. I looked around for a way to integrate these maps. Fortunately Google provides a JavaScript API, which was the best option for me to explore. Although you can use it without any key, but creating and using a key is a good practice. If you have one, Google provides you usage statistics, and can warn you on exceeding your limits. For creating a key you will have to launch Google API Console. After going through the initial reference documents, I was ready to try it in my own application.

Continue reading

what JavaScript date gives you?

In my previous post I was trying to format date, and I noticed that I was not getting it correctly. Why was that, I assembled a small script to test all accessor methods provided by Date. Here is that code.

var today = new Date();
var message = "All accessor methods of date \n\n\n" +
    "getDate(): " + today.getDate() + "\n" +
    "getDay(): " + today.getDay() + "\n" +
    "getFullYear(): " + today.getFullYear() + "\n" +
    "getHours(): " + today.getHours() + "\n" +
    "getMilliseconds(): " + today.getMilliseconds() + "\n" +
    "getMinutes(): " + today.getMinutes() + "\n" +
    "getMonth(): " + today.getMonth() + "\n" +
    "getSeconds(): " + today.getSeconds() + "\n" +
    "getTime(): " + today.getTime() + "\n" +
    "getTimezoneOffset(): " + today.getTimezoneOffset() + "\n" +
    "getUTCDate(): " + today.getUTCDate() + "\n" +
    "getUTCDay(): " + today.getUTCDay() + "\n" +
    "getUTCFullYear(): " + today.getUTCFullYear() + "\n" +
    "getUTCHours(): " + today.getUTCHours() + "\n" +
    "getUTCMilliseconds(): " + today.getUTCMilliseconds() + "\n" +
    "getUTCMinutes(): " + today.getUTCMinutes() + "\n" +
    "getUTCMonth(): " + today.getUTCMonth() + "\n" +
    "getUTCSeconds(): " + today.getUTCSeconds() + "\n" +
    "getYear(): " + today.getYear() + "\n" +
    "toDateString(): " + today.toDateString() + "\n" +
    "toGMTString(): " + today.toGMTString() + "\n" +
    "toLocaleDateString(): " + today.toLocaleDateString() + "\n" +
    "toLocaleString(): " + today.toLocaleString() + "\n" +
    "toString(): " + today.toString() + "\n" +
    "toTimeString(): " + today.toTimeString() + "\n" +
    "toUTCString(): " + today.toUTCString();
alert(message);

Continue reading

formatting dates using JavaScript

Today I was working on a task which involved manipulating dates on client-side using JavaScript. Initially I found myself quite dumb, and did not had a clue how to do it.

Then I started experimenting, which is how I learn small things. unusual results:

  • string is not a date
  • conversion to date is not easy on my format (mm/dd/yyyy)
  • formatting a date on a particular format is not easy too

So looked around, I found Datejs, which I did not wanted to use, as my task was not so much complex. Then I found some other good resources, who helped me complete this tasks.

Continue reading

List of books for SharePoint 2010

I was looking for some resources for learning SharePoint 2010, and stumbled upon some information mentioned on various places, I have collected them in one place and am posting it here for keeping it as a repository for not only myself, but share with others.

Although I have not gone through all of them, but plan to touch each one of them in future. If someone finds any interesting item, just let me know.

Continue reading

Prepare base Windows 2003 image using SysPrep

After installing Windows 2003 and required updates on your virtual machine, we now need to prepare it for easy duplication later. Now extract files from system preparation package, which we had previously downloaded. As we have installed Service Pack 2 for Windows 2003, so we will use only preparation package related to that.

SP-055 Now run “setupmgr.exe” from the extracted files. This is a setup wizard which will help you create your configuration set and answer file for automating your duplication process.

Continue reading

Installing Windows 2003 on virtual machine

Previously we had created our first virtual machine, and then I showed you how we can configure it further for our likings. Now we need to install any guest operating system on this machine. As we have to create an environment where we can emulate a full intranet system, with its own domain controller, so we need to install any server operating system which can support these things.

I know currently Microsoft is planning to release Windows 2008 Server, but I could only get my hand to a Windows 2003 media for installation. I will use our first virtual machine as a base machine, and would create other machines from this, just by creating another copy out of it. That way we don’t have to install things on each machine.

Continue reading