c# - Web services and client DLL -
i have web service , client dll. web service uses oracle database.
for testing client dll, copied web service , made point test database. copied client dll , added test web service using "add web reference".
what use 1 web service , 1 client dll able tell client dll use either use test or production database rather 2 identical web serivces , client dlls.
edit
i mis-stated issue. need use 1 client dll , 2 web services (one production version, 1 development/test version) , able to, somehow, tell client dll web services use. sample of how web service, client dll , client app used:
public class dssservice : system.web.services.webservice { public dssservice() { } [webmethod(messagename = "getfacility", bufferresponse=true, description = "blah.")] public facility getfacility(string sfdbid, string szip, string sfinno) { facility ofacility = ...; ... return ofacility; } .... }
client dll:
namespace dssconfig { string swsurl; public class config { public config() { } public void setwsurl(string surl) { swsurl = surl; } public facility getfacility(string sfdbid, string szip, string sfinno) { dssservice proxy = new dssservice(); proxy.url = swsurl; facility ofacility = proxy.getfacility(sfdbid, szip, sfinno); return ofacility; }
in client application, having dssconfig dll reference:
dssconfig oconfig = new dssconfig(); oconfig.setwsurl("http://myserver/webservice1/service.asmx"); oconfig.getfacility("blah", "blah", "blah");
what need change web service take parameter use construct connection string db.
then change client dll pass parameter part of call or connection.
then can configure client dll using technique pass parameter. suggestion perhaps derive class generated proxy in client dll , use in client code.
without specific implementation details can't more precise.
Comments
Post a Comment