Petes techie blog

A blog written for two people. Me and You.

Accessing Reporting Services API Locally: User Denied Problem

| Comments

We deployed to a new server this morning with SQL Server 2008 running on it. Our software was trying to programmatically access the Reporting services api (found at: http://localhost/ReportServer/ReportExecution2005.asmx) This would work but if we used x then this would fail. This is because IIS doesnt allow you to access a domain if it is pointing back at the box you are on and if you wanted to use integrated authentication. This stuff is called loopback checking

To resolve this you need to make some changes to regedit: Follow the instructions found here: kb896861

This will enable you to set up hostnames that loop back to the local machine and will be allowed by IIS.

HTML5 Video Tag Gotcha - IE9

| Comments

If the tag doesn’t work in IE9, but the video if you access it directly (it should play in Windows Media Player) - make sure the mime-type is set correctly.

The mime type for .mp4 is video/mp4 Other browsers seem to cope with the bad mime type but IE9 refused to play the video. Its nice to see IE9 being a stickler for standards for a change!

HTML5 Video Tag - New Learnings

| Comments

We host quite a few videos on our website, currently they are stored as flv files and played through a flash player (We user JW Player), but we get quite a few requests of people using non-flash devices (ipad, iphone etc) who want to watch the video and so I am quite keen to use the new HTML5

There are 3 main formats to consider: WebM, Mpeg4 and OGG. I used ffmpeg to convert the flv file to .mp4(codec h264) and .ogv (codec: ogg theora) files but found the quality better on mp4 and the file size smaller. I havent tried WebM so will leave that for a later experiment.

Best practice recommends that you should have available all 3 formats for each video with Flash player to fall back on (using the H264 video as Flash supports it). We have too many videos to have lots of formats supported, I wanted to keep it as simple as possible ie only have 1 format so I went with H264 mp4. The reason is: Flash supports H264 but doesn’t currently support Ogg files or VP8 codec. All the devices that cant play flash support H264.

Until I develop an automated system that allows me to upload a video and get it automatically exported into the different formats I will stick with mpeg4.

Protocol Relative Urls

| Comments

We do development on our test boxes using http (on our intranet) but use https on our production servers. I also use googles cdn to host the jquery files I use. The question is do I use http or https to link to them, or use javascript to change the link or perhaps get the server to create the src link. The best solution is to use protocol relative urls! Heres an example:

<script type="text/javascript" src="//"></script>

Drop the protocol and just start with double slash. The browser will then use the same protocol as the current page. NOTE: if you do this with stylesheets (css files) then IE7 & IE8 will download these files twice, I’ll need to check whether IE9 has this problem. I only really link to javascript (and media) files externally so protocol relative files work for me.

Mime Types on IIS7

| Comments

I host quite a few mp4 videos on our webserver which runs IIS7. By default, IIS7 doesnt have the mime type set for mp4 and thus returns an error of 404 if you try to access the file. This is done for security reasons (so people cant access secure files by default eg .inc, .cs etc). Thats a valid point but mp4 is quite common as a format especially these days so why isnt that one made available?! Anyway, in IIS7 I came across quite a nice solution, you can additional mime types to the web.config. Here is a sample:

        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
        <mimeMap fileExtension=".m4v" mimeType="video/m4v" />

I like that, if we ever move to another server thats one less thing to have to remember to set up.

IIS 7 Enabling PUT Request

| Comments

Im doing some funky restful services and was setting it up on a laptop. BUT PUT requests werent working (always returning a 405 error - Method not allowed). The fix was to uninstall WebDav publishing as a feature of IIS. And then it worked straight away.

Some people were talking about Webdav is forcing you to make authorised requests for PUT but I was and it wasnt working. Simplest solution was to remove it as I didnt need it.

IIS 7 and Custom Errors

| Comments

Ive got a nice restful service going on (yay openrasta), works well in IIS6 but is giving me default error messages in IIS 7. To turn it off add the following to web.config:

   <system.webServer>        <httpErrors existingResponse="PassThrough" />    </system.webServer>

All happy again! I need to look into what other options there are for this setting but it gets me out of a fix for the time being