Naming service reference to get namespace-like behavior

· April 8, 2008

In my current project we are accessing a legacy system using Microsoft Transaction Integrator. Luckily for us we don’t have to write any of that stuff, that is done by another team who exposes the objects and methods in the legacy system as web services.

However - they have chosen to encapsulate each object.method as one web service. Since we will have about 50 methods to call it we be … 50 web service references for us to keep track on.

That is not a problem if it wasn’t for the namespacing. There are a lot of wsGetBusinessCodes and wsUpdateInsurance namespaces running around in our code.

Yesterday we found a “solution” to how to organize the web service references on our, the client, side - and still let the server side publish the web service how they like. The solution is quite simple;

as it turns out you can include points (“.”) in the name of a web service reference. This gives us an opportunity to name the service reference in a namespace-like manner. For example we use:

Dim a as TI.SystemName.ObjectName.MethodName.Class

When we add many references in the same way they will be organized in a nice way. Simple and powerful - that how we like it.

Twitter, Facebook