AWG Blogs

Friday, April 9, 2010

Use the User DSN When Debugging

Couldn't figure out why I kept getting "failed to call the odbc driver connection utility" when attempting to configure data tables in the DataSet designer in Visual Studio 2005 on a Windows 7 machine -- a duo that has incompatibility problems apparently.

I finally realized that the problem was that I had created a System DSN (like I always do) for the ODBC connection. I created a corresponding User DSN and it worked like a charm.

Friday, April 2, 2010

Virtual Host in Tomcat and NAT

Well, I didn't figure out how to separate the apps by port, but I did learn that it's possible to do so by IP -- by setting the name attribute in the Host tag of server.xml.

The problem appeared however when I attempted to port forward port 80 to the second host entry in the m0n0wall NAT configuration. Browsing to the site from outside the firewall kept bringing me back to the first host entry which by default was set to localhost. That will never do, because I don't want external users seeing the Tomcat management page or welcome page for that matter. That was the whole point of creating a separate app in a separate location on the hard drive (which was done by the way via setting the docBase attribute of the Context tag which goes under the Host tag. I was creating an Open Blue Dragon or openbd application and I didn't want it sitting under the default webapps virtual host.

I solved the problem by simply setting my new app, the second host in server.xml, to localhost, and assigning the default app a second IP (from a second NIC) for management purposes. I'm not sure why or how, but this fixed the problem. I can now access my ColdFusion web app from outside the firewall through port forwarding. And the managment app is only visible from the server itself.

Thursday, April 1, 2010

Don't forget the Share Permissions...

I was getting errors when attempting to access a Visual Source Safe DB configured as a share from the network:

error: Microsoft Visual SourceSafe
Unable to open user login file ....user.log

I thought how could this be, my computer user account is in the Administrator's group. I even tried copying a file to the ...data\loggedin folder, and got this error:

Destination Folder Access Denied
You need permission to perform this action

Silly me. The sharing permissions were not set up correctly.

To fix, open sharing on the VSS DB folder. Click Permissions. Add the Users group, and assign Full Control.

Tuesday, March 30, 2010

MIssing BIN DLLs from VS Website References

If you are ever in the predicament where after copying over a Visual Studio 2005 website to another machine and are not finished working out the dependencies, here's a tip: Make sure all the assemblies listed in the "add assembly" tags in the web.config can be found on the current machine first, or else none of the Bin folder DLLs will be added as references, no matter how hard you try.

I ran into this problem, and Visual Studio 2005 refused to add the Bin folder references, until those web.config assemblies had their match in the GAC. Go figure!

Tuesday, March 16, 2010

MyEDB SQL One Liner

In this case the use case is to reduce the quantity of each product variation ("ron" in myedb speak), i.e. items in a shopping cart, when the total transaction is finalized. The following code can be placed in a transaction inside a MySQL 5.x stored procedure:


update property natural join int_prop natural join entity_property natural join entity
inner join medb_transaction on entity.eid = medb_transaction.eiddst and entity_property.ron = medb_transaction.ron
and property.prop_group_id = medb_transaction.prop_group_id
set int_val = int_val - qty
where medb_transaction.eidsrc = 8 and property.prop_id = 15

The prop_id 15 is the ID of the 'quantity' property. eidsrc is passed as a parameter to the stored procedure and represents the user id (or "eid" for entity id in myedb speak ;) ).

Wednesday, March 10, 2010

New myedb.com Domain for Framework

My first post to describe my MyEDB (My Entity Database) framework/CMS was placed on a holding site at netfirms:

This is my stand-in site to promote my concept of an "Entity Database" which is more than a relational database -- it gives the DB designer more flexibility in setting up and tearing down entities. I call it and the supporting code framework MyEDB for My Entity DB.



It does away with the traditional notion of entity relationships, and just focuses on pure entities, no relationships and the headaches they cause Database designers. The purpose for relationships has evolved from an ingenuous desire to model entities and their relationships into being merely an optimization device. My framework gets rid of the pretense. All optimization is stored natively through the use of single type tables.

One added benefit of this static architecture is that of being essentially a low level database per se, but one that is accessible to database designers.

Combine this with an elegant PHP-based RESTful MVC framework, and all that's left is defining inputs and outputs and coding them. And the effort of coding the input/output wire-ups simply scales to the level of your requirements -- i.e. pay per requirement.
Requirements can be defined as any of the following:
- Create a form for Inserting, updating, or deleting an entity (e.g. a customer record)
- Create a new view of the entity, purely for display (e.g. a product, or any entity. Examine one of your Excel spreadsheets rows for examples of "entities")
- Build search functionality for all your entities or only a subset



Copyright 2010

Wednesday, February 24, 2010

Connecting to Web Service with .NET

I needed to connect to a remote Java WSRF Web Service having access only to the WSDL and login credentials. At first I tried using Visual Studio 2008, but found it doesn't support old style WSE so well, so had to revert to Visual Studio 2005, over which I installed Microsoft WSE 3.0.msi.

I then pointed wsdl.exe at the https://url?wsdl to generate the proxy class, which I put in the App_Code folder of a test web project. wsdl.exe caused the Service class to inherit from System.Web.Services.Protocols.SoapHttpClientProtocol. I had to replace this with Microsoft.Web.Services3.WebServicesClientProtocol to get the proper authentication interface.

I then had to manually add a wse3policyCache.conf file to get the policy setting intialized (see https://www-secure.symantec.com/connect/forums/newbie-help-adding-security-header-request-object#comment-3625021).

Then, following guidance in http://bytes.com/topic/net/answers/560786-how-add-soap-header-soap-message, I added a SoapHeader class as well as an attribute to the target proxy class method.

The SoapDocumentMethodAttribute Action attribute was set to a blank string so I had to set that to the fully qualified url of the method from the WSDL, i.e. .../PortType/TheMethod.

In the client code, I then just had to call myproxy.SetClientCredential(..), then I could use the proxy class without problems.