Tuesday, October 7, 2008

Whether to Make Exceptions unchecked

Typically we throw all these BlaUnknown exceptions when creating things.

Like when creating a Device, you need a DeviceType to exist. So the createDevice() method throws a DeviceTypeUnknown exception.

These make method calls very clunky because you have to catch all of these exceptions.

I thought of making them unchecked because you expect these things to exist when you are creating a device, and if they don't, its an internal runtime error.

Shafiek pointed out two reasons against this:
if it does happen, it's could be the result of another user deleting something - in which case this should be conveyed to the current user.

WebServices Need to know what exceptions will be thrwon.

Monday, September 22, 2008

Jars required for jboss ejb client

set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-aop-jdk50-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-aspect-jdk50-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-ejb3-client.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jboss-ejb3x.jar
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT_DIR%\jbossall-client.ja



Jars required for jaxws ws client

set CLASSPATH=%CLASSPATH%;.\jaxws\FastInfoset.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\activation.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\http.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-impl.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxb-xjc.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-rt.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jaxws-tools.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr173_api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr181-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\jsr250-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\resolver.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\saaj-api.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\saaj-impl.jar
set CLASSPATH=%CLASSPATH%;.\jaxws\sjsxp.jar


set CLASSPATH=%CLASSPATH%;%JBOSS_DIR%\lib\endorsed\xercesImpl.jar
Adding basic authentication to ws client

JAXWS

TriprequestService service = new TriprequestService();
Triprequest port = service.getTriprequestPort();
BindingProvider bp = (BindingProvider) port;
Map map = bp.getRequestContext();
map.put(BindingProvider.USERNAME_PROPERTY, "shafiek1");
map.put(BindingProvider.PASSWORD_PROPERTY, "password");
map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://qapo:8888/trex-pn/triprequest");


JAXRPC

stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,
username);
stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,
password);

Wednesday, June 18, 2008

wireless security

If wireless is encrypted, does this mean people on the same network as me cannot read the contents of my packets? ie. If I logon to a site that uses basic http security, over an encrypted wireless connection, can other ppl easily see my username and password?

I think that when your wireless connection is encrypted, you have your own encrypted channel. Ie. others logged on to same wireless network cannot read your packets over the air.

Tuesday, May 6, 2008

check if a column exists using sqlserver metadata

if exists ( select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='PTGatewayInBreak' and COLUMN_NAME='Foo' )

alter table PTGatewayInBreak drop column foo

Tuesday, April 29, 2008

Run unit tests before you commit!

Shafiek merged from my RD branch and some unit tests weren't working. I had released without running the unit tests.

Monday, April 21, 2008

Validate documents you give to 3rd partys

Jay from Maximas found one of my documents was invalid according to the schema. This could have been avoided if I had've run all documents I produce through a validator.