RSS

First Web Service ,XSLT XML Transform


Worked on my first Web Service today, wasn't much of a complex web service but I got some idea about WebServices and their working.
Was a simulation of a XML returned by a third party tool retrieving records from DB2,
        The objective involved getting rid of the extra nodes (data) returned in the XML from the 3rd party and just passing on the XML data recognised by the consumer application as a valid object.This was achieved by making my transformer app sit in between the Webservice and the consumer app.



The best option in this case was transforming the XML output from the 3rd party tool into XML recognised by the consumer application using XSLT as it allowed us to change the nodes (data) passed on to the consumer app by just changing the XLS file and not recompiling the whole of the transformer app (incase we had written a custom class to take care of parsing the output XML and returning only selected number of fields).




Will post a code snippet on the transformation code a bit later.Now I am almost done with the Cruisenet Doc ,will be posting that in a while here (by tomorrow most probably) and ofcourse the Nant and Nunit doc need to be completed and posted too :)

0 comments

Posted in

First Web Service ,XSLT XML Transform


Worked on my first Web Service today, wasn't much of a complex web service but I got some idea about WebServices and their working.
Was a simulation of a XML returned by a third party tool retrieving records from DB2,
The objective involved getting rid of the extra nodes (data) returned in the XML from the 3rd party and just passing on the XML data recognised by the consumer application as a valid object.This was achieved by making my transformer app sit in between the Webservice and the consumer app.


The best option in this case was transforming the XML output from the 3rd party tool into XML recognised by the consumer application using XSLT as it allowed us to change the nodes (data) passed on to the consumer app by just changing the XLS file and not recompiling the whole of the transformer app (incase we had written a custom class to take care of parsing the output XML and returning only selected number of fields).

Will post a code snippet on the transformation code a bit later.Now I am almost done with the Cruisenet Doc ,will be posting that in a while here (by tomorrow most probably) and ofcourse the Nant and Nunit doc need to be completed and posted too :)

MSIL Disassembler (Ildasm.exe) Assembly version over write problem


Faced a weird problem the other day ,I had changed some references in my project and while compiling I got an error of cannot copy XXXXXX.dll of version 1.0.3 into the output directory since it would overwrite the preexisting assembly ver 1.6.2.
           Didn't know what the exact problem was but knew that the problem could have arisen by the compiler trying to copy the older version assembly in the bin folder containing the new version dll but how could that be possible since I had just 1 reference of the assembly in my project so there was no 2nd reference in the picture at all.

         Using ILDAsm tool in the Tools provided by .NET helped me understand what the problem was and the resolution to it.



     Using the ILDAsm.exe I opened each assembly in the bin folder to gauge where the root of the problem was Thanks to the ILDAsm tool I realized that in one of the helper assemblies there was a reference to the other version of the assembly that was causing the problem. Hence to solve the problem corrected the version of the assembly being referenced and recompiled the project.



 Conclusion :- Looking at the tools provided by .Net and using them helped solve the problem faster than it would have normally taken!





My New Blog
0 comments

Posted in

MSIL Disassembler (Ildasm.exe) Assembly version over write problem


Faced a weird problem the other day ,I had changed some references in my project and while compiling I got an error of cannot copy XXXXXX.dll of version 1.0.3 into the output directory since it would overwrite the preexisting assembly ver 1.6.2.
Didn't know what the exact problem was but knew that the problem could have arisen by the compiler trying to copy the older version assembly in the bin folder containing the new version dll but how could that be possible since I had just 1 reference of the assembly in my project so there was no 2nd reference in the picture at all.

Using ILDAsm tool in the Tools provided by .NET helped me understand what the problem was and the resolution to it.

Using the ILDAsm.exe I opened each assembly in the bin folder to gauge where the root of the problem was Thanks to the ILDAsm tool I realized that in one of the helper assemblies there was a reference to the other version of the assembly that was causing the problem. Hence to solve the problem corrected the version of the assembly being referenced and recompiled the project.

Conclusion :- Looking at the tools provided by .Net and using them helped solve the problem faster than it would have normally taken!

My New Blog

Meeting Request


Getting that Meeting request object assembly that I wrote to work was the easy part , making it configurable with a web application was the headache.

To keep the consumer trasnperant from the internals of how I am creating the meeting request through code and sending it to the attendee needed a heck of time especially since I needed the current working directory for temporary storage of the ICalendar file.
Hence tried out the Directory.GetCurrentDirectory() method to get the CWD from the system but instead got c:\windows\system32. that's right you read it right "c:\windows\system32"
Was baffled by the result and googled a bit searching here and there for the answer to the mysterious result.
and was thinking abt the connection between the returned directory and my application when it struck me
my project was an Web Application and hence it was being executed by the ASPnet_WP.exe which inturn was being created by Inetinfo.Exe (IIS) which resides in the path and hence the return path.

Moral of the story :- Analyse the situation before looking for solution

0 comments

Posted in

Sending Meeting Request programmatically


Getting that Meeting request object assembly that I wrote to work was the easy part , making it configurable with a web application was the headache.

To keep the consumer trasnperant from the internals of how I am creating the meeting request through code and sending it to the attendee needed a heck of time especially since I needed the current working directory for temporary storage of the ICalendar file.
Hence tried out the Directory.GetCurrentDirectory() method to get the CWD from the system but instead got c:\windows\system32. that's right you read it right "c:\windows\system32"
Was baffled by the result and googled a bit searching here and there for the answer to the mysterious result.
and was thinking abt the connection between the returned directory and my application when it struck me
my project was an Web Application and hence it was being executed by the ASPnet_WP.exe which inturn was being created by Inetinfo.Exe (IIS) which resides in the path and hence the return path.
Moral of the story :- Analyse the situation before looking for solution

Nant Solution task or nant Exec ??


Had to revert back to exec task of nant and use the Devenv.exe to build the solution as I had some weird assembly referencing problems.

While building the solution it was looking for the references one level above the directory containing the assemblies

couldn't figure out what the problem was :( since I was short on time,had no option but to use the exec task and directly build the project solution, it solved my problem but I still need to figure out a solution to my earlier problem of wrong references

using Devenv solved the problem but not sure if that's one of the accepted approach and whether I should use an *external exe to build the solution than find a solution to the problem arisen out of using the solution task provide by nant



Am writing an article on howto implement Cruisenet and Nant in continous integration which will include the steps to follow to setup cruisenet and nant on your build server and how to implement the integration.

Hope this article will solve the problems faced by first timers and save a lot of their time from doing R n D :)









* By external I mean a .exe out of nant tasks , nant might be internally using Devenv.exe to compile the projects who knows.
0 comments

Posted in

Nant Solution task or nant Exec ??


Had to revert back to exec task of nant and use the Devenv.exe to build the solution as I had some weird assembly referencing problems.

While building the solution it was looking for the references one level above the directory containing the assemblies

couldn't figure out what the problem was :( since I was short on time,had no option but to use the exec task and directly build the project solution, it solved my problem but I still need to figure out a solution to my earlier problem of wrong references

using Devenv solved the problem but not sure if that's one of the accepted approach and whether I should use an *external exe to build the solution than find a solution to the problem arisen out of using the solution task provide by nant


Am writing an article on howto implement Cruisenet and Nant in continous integration which will include the steps to follow to setup cruisenet and nant on your build server and how to implement the integration.

Hope this article will solve the problems faced by first timers and save a lot of their time from doing R n D :)



* By external I mean a .exe out of nant tasks , nant might be internally using Devenv.exe to compile the projects who knows.

Nant project is an enterprise template project The remote server returned an error: (403) Forbidden.


Starting solution build. BUILD FAILED Error checking whether 'http://localhost/ProjectDirectory/projectname.csproj'

is an enterprise template project. The remote server returned an error:

(403) Forbidden. Total time: 0.3 seconds.

that's the error that I got when the nant build script tried to build the Web Project I tried out diff stuff but didn't succeed for quite some time maybe was missing something important,dint know what to do then something struck me, when we define a virtual directory we have diff options.



And one of the important ones there is "script source access" especially in our case as we are trying to access the files in the virtual directory and build them using nant scripts

The reason for this happening is that IIS has a strict access setting for the virtual directories that it hosts and it doesn't allow any scripts to access the files in the virtual directory's physical folder and hence the message The remote server returned an error: (403) Forbidden



one of the way to solve this problem is by checking the option of script source access in the virtual directories properties







Here is the place where you can check the option to allow script access to your code files for getting rid of the Nant forbidden error






0 comments

Posted in

Nant project is an enterprise template project The remote server returned an error: (403) Forbidden.



Starting solution build. BUILD FAILED Error checking whether 'http://localhost/ProjectDirectory/projectname.csproj'

is an enterprise template project. The remote server returned an error:

(403) Forbidden. Total time: 0.3 seconds.

that's the error that I got when the nant build script tried to build the Web Project I tried out diff stuff but didn't succeed for quite some time maybe was missing something important,dint know what to do then something struck me, when we define a virtual directory we have diff options.

And one of the important ones there is "script source access" especially in our case as we are trying to access the files in the virtual directory and build them using nant scripts

The reason for this happening is that IIS has a strict access setting for the virtual directories that it hosts and it doesn't allow any scripts to access the files in the virtual directory's physical folder and hence the message The remote server returned an error: (403) Forbidden



one of the way to solve this problem is by checking the option of script source access in the virtual directories properties



Here is the place where you can check the option to allow script access to your code files for getting rid of the Nant forbidden error

Nant Solution build Vs Individual build ?


Building the invidiual sub projects first and then referencing the compiled assemly (in build folder ) in the main project turned out to be a bad idea. After completing the build thought of testing (fortunately!! ) it for build success and a build failure.



For the failure I removed a much needed reference (one of the sub projects) from the main project and then checked in the project file and was expecting a build fail email from ccnet (CruiseNet) but was baffled to see a success mail instead.



A little bit of thinking on it got me to the much obvious reasons (was stupid of me not to have foreseen that) the process I was following was of building the sub-projects and pushing the compiled sub project assembly in the build folder and then the project would reference the sub project assembly from the build folder.

The problem was even though I had removed the reference from the main project file, my compiling of the sub project would automatically push the assembly in the build folder

and since we have to hard code the references it would find it and give a successful build even though it was a failure.



moral :- Use a solution task and build the solution instead of individual projects to automatically detect the references in the project.





0 comments

Posted in

Nant Solution build Vs Individual build ?


Building the invidiual sub projects first and then referencing the compiled assemly (in build folder ) in the main project turned out to be a bad idea. After completing the build thought of testing (fortunately!! ) it for build success and a build failure.

For the failure I removed a much needed reference (one of the sub projects) from the main project and then checked in the project file and was expecting a build fail email from ccnet (CruiseNet) but was baffled to see a success mail instead.

A little bit of thinking on it got me to the much obvious reasons (was stupid of me not to have foreseen that) the process I was following was of building the sub-projects and pushing the compiled sub project assembly in the build folder and then the project would reference the sub project assembly from the build folder.

The problem was even though I had removed the reference from the main project file, my compiling of the sub project would automatically push the assembly in the build folder

and since we have to hard code the references it would find it and give a successful build even though it was a failure.

moral :- Use a solution task and build the solution instead of individual projects to automatically detect the references in the project.

Vulnerability in Microsoft ASP.NET


Just came across a stale news on net posted in oct sometime anyways here it is :-



Microsoft has posted guidance that protects against a reported vulnerability in all versions of ASP.NET that could allow a Web site visitor to view secured content by using specially crafted requests to a Web server. For more information http://www.microsoft.com/security/incident/aspnet.mspx





0 comments

Posted in

Vulnerability in Microsoft ASP.NET


Just came across a stale news on net posted in oct sometime anyways here it is :-

Microsoft has posted guidance that protects against a reported vulnerability in all versions of ASP.NET that could allow a Web site visitor to view secured content by using specially crafted requests to a Web server. For more information http://www.microsoft.com/security/incident/aspnet.mspx

CruiseNet-Nant Build Intro







An important part of any software development

process is getting reliable complete builds out of the code that we

write as that might affect some other developers work or some other

developer may be depending on the correct functioning of your code to complete

his module/task.

Currently am working on build tools to achieve reliable builds or rather, well actually let me put it this way, to detect unreliable/failing builds and warn the developers regarding the same.

Integrating CruiseControl.net & Nant into my project :



Well to start with for the Cruisenet-nant intro :- Cruisenet & Nant are 2 seperate utilities/tools that can be used to make our team leaders/developers life very easy.

Nant is a build tool that can check out the code from the source control server onto the local m/c and build the project.The advantage that we have over here is in case a developer checks in a file but forgets to check in the related reference assembly ,the build will fail due to absence of the assembly. it has many different options like

  1. building the project assembly,

  2. running the nunit tests , (Nunit is a unit testing tool for .NET http://www.nunit.org/ )

  3. FXCop scripts etc (Code analysis tool http://www.gotdotnet.com/team/fxcop/)


which automates most of our need to do stuff after writing any new code especially if we are working in an offshore developement centre or if some other developer is depending on the code.

The features listed above are just the tip of the iceberg Nant is very powerful visit :

http://nant.sourceforge.net/ for more info on nant.


Will soon write up more in detail....

Changing Page Title on the fly ASP.NET


If I asked you to



change the title of your Web form

dynamically
, where would you look ??


you'd be forgiven for looking for a "title" or "text" property somewhere. The problem is, that mysterious property doesn't exist no prizes for guessing y!!.

Here's howto.



Step 1 >> switch to the HTML view on your Web form. Near the top of your page, you'll see the title tag, looking something like :


'<' title '>' WebForm1 '<'/title'>' .

Replace this with '<'title runat="server" id="PageTitle"'>'<'/title'>'.



The quotes are just added to get rid of the parser error i had

becoz of having a original Title tag in the post and plus one more in my code

sample , the code is without the quotes






Here, you're creating a title tag that runs on the server and has an ID, meaning you can manipulate it in code.

ie add a runat server attribute and an ID to the tag



Step 2 >> switch back to design mode; then, open up the code window behind your form. This declares the server title tag you've just added:



protected System.Web.UI.HtmlControls.HtmlGenericControl pageTitle;



so that its accessible in ur code behind.



Step 3 >> changing the page text. Behind the Load event of your page, or in response to some similar event, set the InnerText property of the PageTitle tag to your new page title. Here's my sample code:



PageTitle.InnerText = "Welcome! - Last Updated 20/05/2003";



And that's it Presto —one line of code and your page title has changed.




P.S One thing to note is that :- the moment you make any changes in the UI of the ASPX Page Visual studio gets rid of the < runat = "server">









0 comments

Posted in

Changing Page Title on the fly ASP.NET


If I asked you to



change the title of your Web form

dynamically



, where would you look ??

you'd be forgiven for looking for a "title" or "text" property somewhere. The problem is, that mysterious property doesn't exist no prizes for guessing y!!.

Here's howto.



Step 1 >> switch to the HTML view on your Web form. Near the top of your page, you'll see the title tag, looking something like :


'' WebForm1 '' .

Replace this with '''.



The quotes are just added to get rid of the parser error i had

becoz of having a original Title tag in the post and plus one more in my code

sample , the code is without the quotes



Here, you're creating a title tag that runs on the server and has an ID, meaning you can manipulate it in code.

ie add a runat server attribute and an ID to the tag

Step 2 >> switch back to design mode; then, open up the code window behind your form. This declares the server title tag you've just added:

protected System.Web.UI.HtmlControls.HtmlGenericControl pageTitle;

so that its accessible in ur code behind.

Step 3 >> changing the page text. Behind the Load event of your page, or in response to some similar event, set the InnerText property of the PageTitle tag to your new page title. Here's my sample code:

PageTitle.InnerText = "Welcome! - Last Updated 20/05/2003";

And that's it Presto —one line of code and your page title has changed.

P.S One thing to note is that :- the moment you make any changes in the UI of the ASPX Page Visual studio gets rid of the

To Post or Not to Post


What a better way to start my post than to post the Microsoft Exam thots here :)

Well, to tell the truth the thot of giving a MCAD exam gave jitters to me till the last moment ,even at the Prometric center while i was abt to click on the start button of the exam.



Had wondered earlier if the grey matter up there was in shape to handle the heavy project work loads, the studies inbetween project breaks but looks like there is something still up there :) as i passed out with flying colors was a bit of surprise to me too as was expecting arnd 800's ,but i guess the MSPress,kalani & Wrox books had prepared me for the exam & plus the missing out on parties with frnds and ditching outings with frnds to study paid out in the end :)



Ofcourse dont want to let go of the Tempo and plan to give the

70-320 and 70-229 exam soon


Marking this in a block quote so that it will always be a bold

statement for me whenever i read this post :)




lets c!!!!







0 comments

Posted in

To Post or Not to Post


What a better way to start my post than to post the Microsoft Exam thots here :)

Well, to tell the truth the thot of giving a MCAD exam gave jitters to me till the last moment ,even at the Prometric center while i was abt to click on the start button of the exam.


Had wondered earlier if the grey matter up there was in shape to handle the heavy project work loads, the studies inbetween project breaks but looks like there is something still up there :) as i passed out with flying colors was a bit of surprise to me too as was expecting arnd 800's ,but i guess the MSPress,kalani & Wrox books had prepared me for the exam & plus the missing out on parties with frnds and ditching outings with frnds to study paid out in the end :)
Ofcourse dont want to let go of the Tempo and plan to give the

70-320 and 70-229 exam soon


Marking this in a block quote so that it will always be a bold

statement for me whenever i read this post :)

lets c!!!!
Copyright © Shounak S. Pandit. Powered by Blogger.

Ads