Tuesday, February 26, 2008

C# Web Service Timeout

Make sure you set the Timeout to "-1" for 'infinite", otherwise you may end up with timeout errors at any point in your application that calls the service.

C# Code
MyWebService.WebService webService = new MyWebService.WebService();
webService.Url = ConfigurationManager.AppSettings["WebService.URL"];
webService.Timeout = Int32.Parse(ConfigurationManager.AppSettings["WebService.Timeout"]);


Web.config
<add key="WebService.URL" value="http://myserver.com/MyWebService.asmx">
<add key="WebService.Timeout" value="-1">

Undefined Object JavaScript Controls
Web Resources (.axd)

I ran into an issue with some Web Controls which use Web Resources to find their associated .js files. The problem is that some software blocks Web Resources on the server.

URLScan
allow for .axd files

IIS
  1. Open IIS management snap-in ( e.g. run inetmgr.exe)
  2. Right click your website and choose properties
  3. Go to the "Home Directory" tab and click the "Configuration" button
  4. A dialog should pop out and you would see the mappings listbox
  5. Find the entry for the ".axd" extension and edit it by clicking the "Edit" button
    In the new dialog uncheck the "Verify if file exist" checkbox - which I suspect is causing the problem.

SiteMinder

I had to uncheck "Verify that file exists" for the "Wildcard application map" for SiteMinder (Website Properties->Home Directory tab->Configuration). Once I made the change, my browser started receiving webResource.axd If this does not work for you, create an empty file named 'webresource.axd' and place it in the root of your application. Then the file will exist and it won't matter what the settings are in IIS or SiteMinder.

Friday, February 8, 2008

Burning Heart - Filled with the Spirit

After accepting Christ as Lord in college and walking with Him (seeing His power), I walked away to live my life. I wanted money, security, knowledge, and to experience the world. After ten years of this I recall crying out to God, "Where did you go? When will you come back in my life?" I was certain of my salvation, because it was a promise of God and He never lies. But I had lost fellowship.

We moved and I got sucked into attending a church with my wife, expecting the same watered down messages I had heard in other churches. What I ended up hearing was the Word preached in Truth and I had to respond. How was it that I could believe I was saved without following Christ as Lord? I was broken in spirit as I read Psalm 51. The bride of Christ (me) had committed adultery with the world.

"If you love me, you will obey what I command." - what do you command? "Love God with all of your heart, mind, soul, and strength" - how do I love God? "God so loved you that he gave His only Son." - then let me give myself to You. What is in your heart? The things of this world. The things that I have and the things that I do. I surrendered everything to the Lord, placing Him above everything else.

It was then that self had died, and there was nothing for a moment. And in my heart I felt something. In the physical location of my upper left chest there was a feeling like menthol. That cool, burning feeling that was localized and small. But this was just the start. In a few moments my heart felt like it was wrapped with a heating pad turned on high. I couldn't move. I thought about calling 911, but trusted it was the Lord and calling for physical help for something spiritual would be pointless.

My mind felt like there were hands in my head, pulling apart the two lobes of the brain. I had felt this same feeling when trying to cram a bunch of information into my head. This went on for some time. Then I could feel something in my heart, difficult to describe - like fingers moving parts of it around. A new sensation started. I can only describe it as my heart filled with a glowing liquid which would pour out over the top and run down the sides. This flow was not in a blood flow rhythm, but more like the rhythm of breath. The "pouring" of the glowing liquid continued.

It was at the most intense moment of the experience that I felt as if sin had been removed from me. To say that I had not sinned would be a lie, but at the moment in time I understood what it was like to be 'me' without the sinful nature. What a wonderful feeling to taste of what is to come. To enter into the Kingdom of God.

I was doubled over, and the intensity grew until I begged the Lord to withdraw. I was afraid for my life, because I knew that my heart could not contain all of His Glory. The burning in my heart remained for the next 5 days with a high level of intensity, and for another 3 months it would burn during prayer, fellowship, worship, or temptation. I can understand how "every knee will bow and every tongue confess that Jesus Christ is Lord to the glory of the Father." Who is the fool that thinks they can stand before God?

Jeremiah 20:9
"...his word is in my heart like a fire, a fire shut up in my bones."

I wanted to share this experience with you, because I had an expectation that many others have had a similar experience. To my disappointment, testimony has been difficult to find. I was not seeking an experience. There was nothing preconceived or expected. Just an open Bible, and an attempt to do what the Lord commanded - love God.

I hope that you are able to experience the reality of a living Lord in your lifetime. Jesus isn't dead. He is alive and He sent out His Spirit into those who believe. This isn't my religion. The feelings are real. Real joy when there is nothing to be joyful of. Real peace when there is worry. I cannot point my finger to the instances of other spiritual fruit, but the Father may give out other blessings by His will.

Don't seek the gifts. Seek the Giver.

http://ezinearticles.com/?DL-Moody,-Rivers-of-the-Spirit&id=339618 "Immediately an overpowering sense of God’s presence flooded his soul. Almighty God had come to him. Without wasting a moment’s time Dwight locked himself in a nearby friend’s room so he could be alone with God. The room seemed ablaze with God. He stretched out on the floor and lay bathing his soul in the Divine. Of this communion and mountain top experience Moody later wrote, “I can only say that God revealed Himself to me, and I had such an experience of His love that I had to ask Him to stay His hand.”

http://www.carm.org/testimonies/biff.htm "I took that step of no return in coming to Him with my heart wide open intent on proving to Him that I did love Him and would rather die now under His feet than live without Him for the rest of my life. And as I took that step towards Him that tiny spark of love hidden in my heart for Him suddenly became a flame, and the flame suddenly burst forth into a blazing inferno of love...for 'me' (John 14:23)! All things became new (2 Cor.5:17)! And after 20+ years of reflection I know what happened to me: The Old me DIED, and the New me went to heaven! The 'Old Man' died...yet 'lived' - yet it wasn't "I" any longer ("Gal.2:20")! No one can come to the Father except they go through Christ and Him crucified first! And to come to God through Christ is to come to the foot of the cross and die with and for him there. The cross spells 'Death' to the entire Old Creation! And so, from out of the ashes of that old me glowed a little spark of love towards his God, put there when I first believed, and then came God's power and caused that spark to blaze up into a flaming fire reaching heaven itself."

Wednesday, February 6, 2008

.NET 2.0 Exception Handling in Threads

public static void Main()
{
new Thread (Go).Start();
}

static void Go()
{
try
{
...
throw null; // this exception will get caught below
...
}
catch (Exception ex)
{
Typically log the exception, and/or signal another thread
that we've come unstuck
...
}

From .NET 2.0 onwards, an unhandled exception on any thread shuts down the whole application, meaning ignoring the exception is generally not an option. Hence a try/catch block is required in every thread entry method – at least in production applications – in order to avoid unwanted application shutdown in case of an unhandled exception.

Check This Out!

More Links to Good Information