I had a similar case. I had a class-library that called a web service, then I had an .EXE that called the class-lib's .DLL. I think it's the .EXE's config file that is used and not that of the .DLL config.
But as Richard said above, I had to fully-qualify the namespace. It's a bit of a pain.
Below is exactly what I changed. The pain is that I had to change it in two places,
one in the reference.cs that is generated when you create a service reference, and the other in the config file. Thus, everytime I change the web service and do an "Update Reference" I have to make the change to the C# code again.
1) You must actually change the ConfigurationName in the reference.cs as follows:
From: [System.ServiceModel.ServiceContractAttribute(Namespace = "http://TFBIC.RCT.BizTalk.Orchestrations", ConfigurationName = " RCTWebService.WcfService_TFBIC_RCT_BizTalk_Orchestrations")]
To: [System.ServiceModel.ServiceContractAttribute(Namespace = "http://TFBIC.RCT.BizTalk.Orchestrations", ConfigurationName = "TFBIC.RCT.HIP.Components.RCTWebService.WcfService_TFBIC_RCT_BizTalk_Orchestrations")]
2) and then also change the “contract” value in all related app.config (for .dll’s and .exe’s) as follows:
From:
<endpoint address=http://nxwtest08bt1.dev.txfb-ins.com/TFBIC.RCT.BizTalk.Orchestrations/WcfService%5FTFBIC%5FRCT%5FBizTalk%5FOrchestrations.svc
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITwoWayAsync"
contract="RCTWebService.WcfService_TFBIC_RCT_BizTalk_Orchestrations"
name="WSHttpBinding_ITwoWayAsync">
To:
<endpoint address=http://nxwtest08bt1.dev.txfb-ins.com/TFBIC.RCT.BizTalk.Orchestrations/WcfService%5FTFBIC%5FRCT%5FBizTalk%5FOrchestrations.svc
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITwoWayAsync"
contract=" TFBIC.RCT.HIP.Components.RCTWebService.WcfService_TFBIC_RCT_BizTalk_Orchestrations" name="WSHttpBinding_ITwoWayAsync">
Just to be clear - how did I know what the full namespace was?
The program's namespace was TFBIC.RCT.HIP. Inside that, the C# code has one additional
namespace statement:
namespace RCTHipComponents