Tuesday, November 18, 2008

Bug in Visual Studio 2008 WSDL Interpreter

When I started working with Flat-WSDL we soon came to a phenomenon where our list types suddenly become converted to

ArrayType[]

instead of

List<arraytype>

It took a while to drill down the cause to the following.

A common wsdl:types section looks like this:

<wsdl:types>
<xsd:schema>
</xsd:schema ....>
<xsd:schema>
</xsd:schema ....>
</wsdl:types>

but whenever there is the following section in the WSDL

<wsdl:types>
<xsd:schema ....>
</xsd:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ....>
</xs:schema>
</wsdl:types>

you can not switch the ListTypes anymore. They will all be ArrayType[] . This applies for the ServiceReference as well as for svcutil that simply ignores the /ct: Parameter .

Both WSDL descriptions are perfectly valid as both tokens xsd: and xs: reference the http://www.w3.org/2001/XMLSchema Namespace and hence are synonyms.

I reported the bug to Microsoft using Connect (MSConnect ID:387245). But I heavily disagree with their answer, which basically says "It's not a bug it's a feature". You should find some samples wsdls there.

IT Hall of Shame

Oracle

Oracle column alias length limitation

The following SQL:

select 1 as "Why shouldnt you have a very long column name" from dual

will result in

"ORA-00972 identifier is too long"

The maximum length for a column alias in Oracle is 30 characters. Guys, we live in age of Terabytes!

Trying to pass a list as parameter

Try the following SQL:

select 1 from dual where 1 in (:var)

with :var = 1 (works)
with :var = 1,2 (no error but no result. The list is interpreted as float)
with :var = 1,2,3 (error Invalid number)

There is no way with standard SQL instruments to pass a list as parameter in Oracle.

Saturday, November 8, 2008

The Variant strikes back

Anders Hejlsberg, lead-architect of C# announced at the PDC 2008 that C# 4.0 will be enhanced towards a dynamic language. With the keyword "dynamic" you can declare a variable as a datatype that will be bound at runtime rather than compile time.
The background is, that it will make the use of COM components much more convient. Today you link your code against the exact version. If the version of your component is not installed on the remote computer your code will fail, even if the interface the installed component has not changed.
Reflection is in its usage for emergencies only and not suited for complex interfaces. Your code will become a huge mess if you try to handle complex objects.

So this is a HUGE break with current C# dogmas..

But wait a minute! Don't all of you, who know what's behind the letters "VB" feel strangely remembered? Something we thought we had burried a long time ago?

The VARIANT strikes back!

And to be honest, coming down the C, C++ path I feared and hated it, whenever sub-average VB programmer colleagues started using it in their code. The Variant or Dynamic liberates developers from spending a minimal time on thinking before start coding. They simply declare some global "Variants" and use them to store whatever comes along. Absolutely impossible to tell whats the content of the variable when you read the code. The absolut horror of everyone who has to maintain or debug this kind of code.

I clearly see the advantages of runtime binding, but I see the immense risks the same time.

Maybe you should pass some sort of qualification exam to get this type enabled.

"Anders Hejlsberg, Chef-Architekt der .Net-Programmiersprache C#, hat im Rahmen der Microsoft Professional Developer Conference (PDC) in Los Angeles neue Sprachfunktionen für C# 4.0 und die darauf folgende Version erstmals vorgestellt.
Die Hauptneuerung in C# 4.0 ist die Erweiterung in Richtung dynamischer Sprachen. Mit dem Schlüsselwort dynamic können C#-Entwickler in Zukunft eine Variable so deklarieren, dass die Bindung erst zur Laufzeit stattfindet." (Heise.de)

Microsoft rewrites Workflow Foundation from the scratch

In a keynote at the PDC 2008 conference the speaker Kenny Wolf announced that Microsoft is rewriting Windows Workflow Foundation from the scratch. The basic concepts will be retained but the implementation and all components will change fundamentally. It will be shipped with .Net 4.0 and will not be compatible with current Workflow Foundation Code.

One of my next articles in this blog would have been titled "Why I do not believe in Windows Workflow Foundation". I think I can skip this article now, as Microsoft obviously has come to the same conclusion.
First of all. If you want to do workflow driven development, the current Microsoft strategy is a mess in itself. Do I use Workflow Foundation, Workflow Foundation for Sharepoint, Biztalk or what? Currently we have 3 products offering more or less the same. But even even if you get behind the point of simply chosing Workflow Foundation things do not lighten up.
If you look closer at the word "Workflow" you will soon encounter some philosophic problems.
What is a workflow? Are we talking about program level workflow, about technical workflows or do we even talk about interactive workflows, are we talking about business processes, do I store my business object in the workflow object, when do I use sequential workflows or state machines....
Workflow Foundation fails to answer any of these questions and hence gives you no clear strategy what WF is aimed at. For me it felt like getting a tool box tossed at my head with a sticker on it saying "Find out what it's good for".
To the point where I used Workflow Foundation in technical workflow, things where working out but when I got to the point where I tried to implement an interactive workflow with just 4 states things were getting messy.
The whole communication concept with workflows is a mess, the Workflow controller is unbearable slow, the workflow designer shipped with Visual Studio 2008 was ***unusable*** before service pack 1. If you want to user persistence or tracking you end up rebuilding the database frequently, because errors come up that can not be solved differently.
The WCF-WF integration example published by Microsoft definitely belongs into the Hall of Shame. A calculator that needs a Start() and Stop() Method before/after it does calculate something. Jeeeez. Who dared publishing something like that? It clearly shows that both techniques where designed independently and were never designed to interact.

But with the new approach am looking forward to see what the result will be. I definitely believe that the future of development will be workflow driven. Software definitely needs to get to the point where my business process reflects in software. There and only there I benefit from workflow driven development.


"In einem Vortrag auf der PDC 2008 offenbarte Sprecher Kenny Wolf, dass Microsoft die Windows Workflow Foundation (WF) noch einmal von Grund auf neu schreiben wird. Die Konzepte einer Laufzeitumgebung, die aus einzelnen verbundenen Aktivitäten bestehende Workflows ausführt, bleiben zwar bestehen. Auch die Workflow-Dienste wie Persistierung und Ablaufverfolgung wird es weiterhin geben.
Die Implementierung und alle Bausteine (Laufzeitumgebung, Aktivitäten und Dienste) werden sich jedoch in der kommenden Version fundamental ändern. Die neue Ausgabe wird nicht mehr kompatibel sein zu den derzeit am Markt verfügbaren Versionen." (Heise)

Friday, October 10, 2008

Download ASP.Net Files with IIS

If you try to download .cs or .vb files from an IIS Server you will soon see the following error:


Server Error in '/' Application.
This type of page is not served.

if your file is located in a simple directory or

The page cannot be displayed

You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.

To solve this you first have to convert the directory into an application-directory.

To do so enter the "IIS Manager", right click the directory, select "Properties", go to the tab and click the "Create" Button. Then select the "Configuration" Button, browse to the appropriate extension and remove it (in this case the .cs extension). It will remove the extension registration for the given directory only.

If you now you try to download the file you probably get the following error:


The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.


The reason behind this is, that there is no MIME type registered with .cs files and IIS does not know how to handle it.

So again open the "IIS Manager", but this time right click on the server itself. Now click the button "MIME Types", press the "New" button and enter ".cs" as extension and "text/plain" as MIME Type. Then restart the affected web site (Default Web Site in my case) by clicking its stop and start button.

Now you should be able to download .cs files.

Wednesday, October 1, 2008

Cognos Impromtu 6 and Oracle 10 Client

works!

find the file cogdmor.ini (usually in %ProgramFiles%\Cognos\cer1\bin ) .

Find the section:

[DLL Names]

and Add the line:

OR1002-Win32=ORACLIENT10.DLL,10

(I am using 10.2.0.3 client)

Thursday, September 4, 2008

.Net and Oracle 10. Welcome to DLL Hell

Until Oracle 8 or 9 you installed the client, chose whether you want to use Oracle Driver (Oracle.DataAccess.dll) or the Microsoft Driver (System.Data.OracleClient) and you had a happy connection to your database.

Installing a OracleClient and connecting to a Oracle Database with was until a day in August 2008 a Non-Event. 15 minutes and off you go.

Now we upgraded our database backend to Oracle 10 as anything else is running out of maintenance.

"Ok", I thought. "Business as usual". "Install the latest client, turn on, works".

What I didn't know was that I was standing on the doorstep to Oracle DLL Hell.

First everything looked just smooth. After upgrading the client from Oracle 8 to 10, the connection with System.Data.OracleClient to our Production environment on Oracle 9 was just fine. No problems here.

The problems started when I first tried to connect with an Oracle 10 the same database only on Oracle 10.

4 out of five queries worked fine but then

"ORA-01405: fetched column value is NULL" System.Data.OracleClient

The error message means basically that I tried to fetch a null value into a PL-SQL variable.

Only Problem here. I use a common SQL here. So no fetch anywhere.

We now invested much much time in solving this problem, upgraded the server to latest patchlevel and lots of different things. Nothing helped. So the only way to solve this problem was to switch to the native Oracle .NET driver.

After switching to the native Oracle Driver (Oracle.DataAccess.dll) the problem was solved. Only problem that remained now, was that my version of the client 9 was not installed on the server and hence I would not be able to install the software on the server with that dll.

Ok, I thought. Lets get rid of my Oracle 9 and install a Oracle 10.2.0.3 client. The same client as installed on the server.

Sooner said than done. I chose "Application Developer" option and off I went.

But when I tried to add the reference to the Oracle .Net driver (Oracle.DataAccess.dll) using the "Add reference" dialog in Visual Studio .Net 2008 I found.... nothing. Obviously .Net Application Development is no longer in focus when installing the Oracle Client, but I knew that Oracle has special packages for .Net.

Installing Oracle Data Provider for .Net (10g).

Why the fuck the installer recommends to create a new Oracle Home instead of installing it where it belongs (the exsting Oracle Home of my 10.2.0.3 client directory)?

Very important: At the point where you can choose the target directory, make sure you select the existing client directory, by selecting the proper Oracle Home Name.

I cost me 1.5 days to find out, that by default, the installer creates a new Home Directory, where it simply doesn't do anything but to throw exceptions.

After installing the ODAC correctly you find it in your "Add reference" Dialog unter .NET components under "Oracle.DataAccess".

5 Cents on .NET and Oracle 10

The story is longer but here are my 5 cents:

  • Make sure the Oracle client version on your development and production machine are the same
  • To get a working .NET driver, you need to additionally install the Oracle Data Access Components for .NET which can be found here .
  • Make sure, you select the proper version of the ODAC for your client.
  • When the bloody Oracle installer asks you for the directory make sure you select the existing directory of your client.
Dear guys at Oracle. In the last 2 days I really learned to hate your "Oracle Universal Installer". The setups are full of flaws, misleading informations, bugs, crc errors, bad recommendations or unnecessary components.
And why the hell, the Developer Oracle Client Package does not include a .Net Driver?
By today I can call myself Oracle Client Setup Expert (OCSE), for a thing that should be what it is: a non-event