Thursday, October 15, 2009

Things to post about:

Using USPS Web Tools
Learning just enough XQuery to query XML data from a SQL Server database

Thursday, October 8, 2009

ASP.NET Ajax Web Services [ScriptMethod(UseHttpGet = true)]

HTTP POST Is Slower than HTTP GET, but It Is Default in ASP.NET Ajax

ASP.NET Ajax, by default, makes HTTP POST for all web service calls. HTTP POST is more expensive than HTTP GET. It transmits more bytes over the wire, thus taking precious network time, and it also makes ASP.NET do extra processing on the server end. So, you should use HTTP GET as much as possible. However, HTTP GET does not allow you to pass objects as parameters. You can pass numerics, strings and dates only. When you make an HTTP GET call, Atlas builds an encoded URL and makes a hit to that URL. So, you must not pass too much content that makes the URL become larger than 2048 characters. As far as I know, that's the max length of any URL. In order to enable HTTP GET on a web service method, you need to decorate the method with the [ScriptMethod(UseHttpGet=true)] attribute:

[WebMethod] [ScriptMethod(UseHttpGet=true)] 
public string HelloWorld()
{
}

Wednesday, October 7, 2009

DZone The heart of the Java development community

I'm following DZone on Twitter after getting an email today from a grad student at Delaware I worked with as an undergrad the summer I did research. He's contributed a few articles, and even though I don't code in Java on a daily basis, I did come across a different article that raised some good questions about what it means to be a software developer, and specifically, what responsibility comes along with the "developer" part of that, Staying Current: A Software Developer's Responbility. Two questions that he asks (and looks for in potential teammates) really stuck out to me:

* What language(s) that are gaining popularity, but not yet mainstream, have you written Hello World in?
* Do you read books or blogs looking for new ideas at least (on average) once every two weeks?

I've discovered for myself that the idea behind the first question is an essential part of the job, and that discovery on a daily basis is key to learning "Hello World" knowledge about new stuff. Although I haven't actually written Hello World in a new language, there are definitely basic things I've learned everyday about new technologies I didn't/don't know anything about, but which help to nudge the door open and keep it open for them. But I've definitely realized the benefit of examining a problem thoroughly, perhaps even excessively, if there's something in it for me, especially if it concerns something in particular that's in my blind spot as a gap in my knowledge; its crucial that I'm assertive about honing any missing fundamental knowledge, and even more crucial about gaining new knowledge.

Tuesday, September 29, 2009

TWENTY YEARS, only a few tears.

TWENTY YEARS, only a few tears.

helped my "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level..." this morning


It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Instead of moving my web.config from the sub-directory to the root, I copied it, and thus, there were two of the same file, one in the root, and one in the sub-directory. In my case, deleting the file from the sub-directory solved the problem, but the explanation below is a slightly more abstract explanation of the nature of the error that I found helpful.

Particularly #2:
"2. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unathorized users).

But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-

<location path="Admin">
   <system.web>
      <authorization>
         <allow roles="administrators" />
         <deny users="*" />
      </authorization>
   </system.web>
</location>

However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-

<configuration>
   <system.web>
      <authorization>
         <allow roles="administrators" />
         <deny users="*" />
      </authorization>
   </system.web>
</configuration>

Thus you can protect the sub-directory from unauthorized access."

helped my HTTP Error 500.22 this morning

Breaking Changes for ASP.NET 2.0 applications running in Integrated mode on IIS 7.0

AppCmd Migrate Config and HTTP Error 500.22