Thursday, September 10, 2009

Web Service Not Reading the Lmhost File?


I recently spent 1/2 of my work days trying to figure out a problem reported to me by a client. I am working on a three tiered application that has a windows forms application that communicates to a web service. The web service performs all the communication with the database which is located on a different server from the web service.

I was told that they could not longer upload or download data to or from the windows forms application. They also mentioned that they installed a firewall. .Net remoting can use tcp or http as the protocol and either of those can use soap and/or binary encoding. I read that firewalls block binary transfers of data... uh... not really. So with a grain of salt I began going down that path. I determined that the web.config file for the web service is where the encoding type is set (in the remoting section). I happened to have http with soap and binary. I commented out the binary line, and ran the program. BOOM! I got an error regarding incorrect binary string. So without changing the program quite a bit I cannot have the soap protocol only.

Well, it turns out that it had nothing to do with the binary format of the stream. The client's web server was not translating the server name they entered to the correct IP address of the database... So they entered the IP address of the database server. fixed. firewall still enabled.

What did I learn? There's a lot of garbage assumptions out there in Google space... So apparently in their setup, the web server was not reading and translating the server name from the lmhosts file. I wonder if Microsoft has any detail on that?