I'm trying to call a WCF service from a module I've developed by using the following code. The problem I have is that I want to define the WCF bindings in a web.config file located in the desktopmodules/[My module folder]. But I only got it working when I define the bindings in the webfolder root web.config file..
Is it possible to use sub-folder web.config files with DNN?
protected void Page_Load(object sender, EventArgs e)
{
WCFService.datacontracts._2007._06.GeneralRequestMessageHeader requestHeader
= new WCFService.datacontracts._2007._06.GeneralRequestMessageHeader();
WCFService.datacontracts._2007._06.GeneralResponseMessageHeader responseHeader;
requestHeader.Environment = "TEST";
requestHeader.MessageId = Guid.NewGuid();
requestHeader.TimeStamp = DateTime.Now;
requestHeader.RequestingSystem = "JA WCF call";
WCFService.datacontracts._2007._09.PackageType[] packageypes;
TestServiceClient client =
new TestServiceClient();
client.ClientCredentials.UserName.UserName = "test";
client.ClientCredentials.UserName.Password = "******";
responseHeader = client.GetAllPackageTypes(requestHeader, out packageypes);
foreach (WCFService.datacontracts._2007._09.PackageType package in packageypes)
{
Response.Write(package.Name + "\n");
}
}