Dog Walling

November 5th, 2009

Just a quick shameless plug for a dog walking service in Bracknell I happen to have a small amount of involvmemt with. Check out For Your Paws.

Netbeans Web Service Client WSDL Location

February 24th, 2009

I’ve been working on a big project using Netbeans 6.1 recently. This project is basically acting as a middle man for data pumping web service. It acts as both a web service client and a web service provider.

The provider part has been drama free, but when you get to moving the client part away from your development environment, it seems that a fair few people run into the following problem: The WSDL file is referenced statically from your dev machine (i.e. “c:\netbeansproject\whatever\….\something.wsdl”).

I wanted to bundle the WSDL file that I built against with the application to make the application as self contained and portable as possible.

A few hours of googling told me that I had 3 options:

  1. Pass in the “wsdllocation” switch into wsimport
  2. Use a catalogue.xml file
  3. Specify the URL in code

Option 1 is all well and good. But Netbeans will overwrite that setting after restarting the IDE. That’s rather annoying. Also the working directory that the app runs in is a little hit and miss, so specifying a relative path for the WSDL location is tricky.

Option 2 seems to be a standard way of thinking. You just put the catalogue.xml in the meta-inf folder. But I’m deploying to a war file, not an ear file, so no meta-inf.

This leaves us with option 3, and when you spot how to do it this way it’s so obvious you’ll kick yourself. When you drag and drop the web service method into your code, the service will be created with the default no-parameter constructor. If you look at the code generated however you’ll see that there is another constructor that takes two parameters: URL wsdlLocation, QName service qName.

If you look at the default constructor, you can copy and paste the QName part over to your code. The URL can be more clever though. I put mine in a wsdl folder/package that’ll be inside the classpath of the application. That way you can make some that looks like this:

Quick Code


//find the URL for the WSDL
URL wsdlLocation = this.getClass().getResource("/wsdl/testService.wsdl");
//get our proxy
TestService s = new TestService(wsdlLocation,
new QName("http://timsweb.co.uk/TestService", "TestService"));

If you need to programmatically set the endpoint you can do something like this:
Quick Code


//find the URL for the WSDL
URL wsdlLocation = this.getClass().getResource("/wsdl/testService.wsdl");
//get our service proxy
TestService s = new TestService(wsdlLocation,
new QName("http://timsweb.co.uk/TestService", "TestService"));
//set the endpoint
((BindingProvider)s).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://timsweb.co.uk/Service/TestService");

Simple.

Them vs us

November 11th, 2008

At work we sit behind a proxy server. A very restrictive proxy server. Now I know the reason for this is so we can be ISO whatever certified on our security. But for the moment I’m going to pretend that it’s because we are not trusted.

This same poxy handles SSL connections such that we have an encrypted link to the proxy, and the proxy has an encrypted link to the server. All very well and good except the proxy can log everything that goes out. Online banking suddlenly seems really unsafe when you consider that your login credentials are being logged by that geeky man in IT. Do you really trust him?

This isn’t something that would bother most people, because most people wouldn’t notice. It bothers me though.

I’ve had an ADFing ’nuff

October 24th, 2007

I write this just after taking over an ADF project from a work mate. I had tried to dabble with Oracle ADF in the past, but it got side tracked by PHP work. Now I take over this new project and all of a sudden I need to learn ADF for real.

After 2 days of trying to change a check box (storing a ‘Y’ when on and a ‘N’ when off) to a set of radio buttons (showing ‘Parent’ for a value ‘P’, and ‘Child’ for a value ‘Y’), I think I have finally lost the plot.

It should be easy. I mean it’s a simple thing to want to do. But for some reason in Oracles attempt to make the framework quick and clever, then have forgotten that they should also make things simple. I’m a web developer. My desire is to find a little bit of html in a template and change it. I don’t want to change any functionality, only tweak a bit of UI.

So far I’ve managed to get some radio buttons that:

1. Can’t have labels different from their values, but do update and reflect what’s in the database.
2. Do have the correct labels, do update the database, but don’t display a checked button to reflect what is in the database.
3. Cause the entire page to crash with some meaningless exception that seems to bear no clue as to it’s source.

Tried looking at the documentation? You bet ya. It reads just like it’s been copied straight from the sales brochure. To quote:

At runtime, the generic Oracle ADF Model layer reads the information describing your data controls and bindings from appropriate XML files and implements the two-way “wiring” that connects your user interface to your business service. This combination enables three key benefits:

* You write less code, so there are fewer lines to test and debug.
* You work the same way with any UI and business service technologies.
* You gain useful runtime features that you don’t have to code yourself.

As soon as you want to go beyond the bits that they have deliberately made easy, your on your own.

To give oracle it’s credit, there are things it does very well. If I want to make a html table from a database table, then that’s great. But oh say I wanted to use the back button to navigate without it causing Steve Jobs to run off with your wife after crashing the entire application and truncating every database table (ok I am exaggerating, but it’s still bad)? Oh well that’s just 78 hours of blood sweat and tears.

I would be less than 78 hours, if only the IDE you have to use (Jdeveloper) would take less than 30 seconds to switch between the design and source views. Yes Jdeveloper does lots, but does it really need 300Mb of my memory and to run like a snail on super glue?

What about going on a course? Well I did once. What did it teach me? Well much the same as the documentation. Lots on how to do the easy things, but as soon as you want to stretch beyond that…BAM you’re on your own.

This perhaps seems like a harsh critic of all the hard work that has gone into ADF. I admit that I’m still learning. I’m very frustrated at the learning curve, but I’m am just a beginner. To be fair to Oracle, I make this promise: If at any point I change my mind and feel that is a useful tool, I will come back and write in big letters that I am sorry and point out how what I have said is wrong. In the mean time I’ll be stocking up on keyboards to replace the ones destroyed in ‘500 internal server error’ fits of rage.

PHP oci_bind_by_name with nulls

March 28th, 2007

Just came across a problem with oci_bind_by_name in php and inserting nulls. If I left named parameters blank, the qery would fail. If I tried:

oci_bind_by_name($stmt, "name", null);

It would moan about ‘only variables can be passed by reference’. Seems obvious now but at the time it really stumpted me. The solution is to make a var null, and pass that.


$null - null;
oci_bind_by_name($stmt, "name", $null);

Simple.

Getting in the (Coding) Zone

March 12th, 2007

You ever noticed when your coding, sometimes you really get into it. One moment it’s just after lunch and you want to add xml exporting functionality, the next thing you know it 7pm, your work makes have gone home and you have a complete multi-format generic data exporting engine. I love it when that happens!

Read the rest of this entry »

Beryl On Ubuntu

February 23rd, 2007

In my last post may moons ago I said XGL was too immature for easy installation/reliability. Well I was wrong. The clever old fold at Beryl have made a script to do all the hard work for you.

I edited it a little to stop it from installing nVidea drivers (as I already have some installed).

As an added bonus, it works quite well with dual head. Although there is one thing that Metacity did better with windows than Berly. When I dragged a maximised window from one screen to the other, it would move that window, making it maximised on the other display. Clever! And I miss it.

Anyway. Tally ho.

Oh. Almost forgot the link to the install page of beryl.

Why linux isn’t really making competition for Windows

October 17th, 2006

Simple. In Windows things just work. Sure they may take a while to load up and crash every now and then, but mostly things work.

Now compare this to linux. Today I’ve wasted my evening. What to achieve? Well what I set out to achieve and what I actaully did achieve are two very seperate things. I set out to get sound coming out of all of my speakers, not just the left and right channel. I got it working to an extent, but the sound had about a 10 second delay to the actual events triggering the sound. AND it didn’t appear to have the ability to do any mixing. Infact, after reverting back to the original config, there still seems to be mixing problems. Funny how you don’t think of that on Windows, IT JUST WORKS.

The other one was XGL. I think it’s still too imature for easy installation and config in Ubuntu. There are many tutorials around at the time of writing, but none seem to cover my situation of dual heads with twin view. Also they all seem to point in the direction of using different apt sources. Dapper has xserver-xgl and compiz in it’s repos now. My attempt to get them working however failed.

If it had been a windows app, I’d have ran an installer and hey-presto, IT JUST WORKS.

Bluetooth audio on Skype is another matter that frankly I don’t wanna get into right now.

Come on Linux. An OS should be working for me, not making me work for it!

How easy it is to bring down a network

July 29th, 2006

Yesterday at work, 1pm ish, came the first signs of something amiss. And by amiss, I mean the network completely grinding to a halt. Pings around the office failed 80% of the time, and the company generaly ground itself to a halt.

Every switch in the server room looked like it was trying to cope with the kind of traffic you’d expect for hosts of Paris Hilton’s home movie. A trip around the office and it seemed that this load wasn’t reserved for just the server room. Every switch I went past seemed to be flashing like mad. This wasn’t a just a small puddle in the corner of the network. This was a left the bath running then went on holiday flood.

But where was it coming from?

After a little bit of narrowing down, I figured that ’switch 2′ in the server room was taking the offending connection. Narrowing down further, taking out unplugging port 6 solves many of the problems.

But what did I unplug?

I can’t just follow the cable trough a patch panel and to the machine. Looking at the digram for the network it seems to be connected to terminal by the printer. There is only one computer by the printers. The printer server and TNS names host. It’s Whale. But unplugging it didn’t stop the flood. The diagram was wrong. Turns out it really lead to the conference room. No computers in there at the moment, so what’s flooding?

One switch in the middle of this room, lights going hell for leather. We unplug each cable until we find the flooding one, then we follow that cable to see where it leads. Well, it leads somewhere. It leads back into the switch. Port 1 plugged into port 4. The palm slaps the forehead. I wonder who did that?

More band stuff

June 22nd, 2006

Good news! Another gig is on the cards for Kinisfear. This time it’s at the Cellar bar in Bracknell (South Hill Park). The date is Tuesday the 11th July, but the actual time is to be confirmed.

Also Keith’s girlfriend (Rachel) has done a fantastic job with the pics from our last gig. Although only 4 have been done so far, they are great. You can see them on the Kinisfear link above. But for that extra ‘Tim looking stupid’ feeling, here’s a sample:

Tim Singing

Look silly don’t I?! On the off chance that a friend of mine sees this, COME TO THE GIG AND BUY ME A BEER! Seriously, come and watch!