I have a WCF service by calling her UserService . UserService has a link to the class library. Let me call it DoWork.dll . DoWork.dll has a WCF service link to another service that we will call CompanyService .
Now, when I first tried calling UserService , I would have received an error message not configured for the endpoint. After reading over the network, I found that I needed to add CompanyService bindings and client information in the UserService web.config under the <system.serviceModel> node.
Here he is:
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IComapnyService" /> </basicHttpBinding> </bindings> <client> <endpoint name="BasicHttpBinding_ICompanyService" address="http://it-dev.company.local:81/Project/Copmpany/CompanyService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IComapnyService" contract="CompanyService.ICompanyService" /> </client>
I have a problem: contract="CompanyService.ICompanyService" shows an error:
The attribute 'contract' is not valid. The value of "CompanyService.ICompanyService" is not valid according to its data type "clientContractType". Enumeration constraint error.
Now, if I add the CompanyService link directly to the UserService WCF project, the error will disappear (obviously). However, I should not have done this. I tried to fully define the namespace in which the ICompanyService contract is ICompanyService , and this also does not work. I deleted the .suo file and rebuilt the project, and this also does not work (offered elsewhere on the Internet). In addition, if I type contract= , I get a drop-down list, but CompanyService.ICompanyService will not be found anywhere (only when I refer to the service directly in the UserService project).
I tried to configure it using Tools > WCF Service Configuration Editor , and this does not help.
I should note that everything seems to be working fine, but I don't like the fact that intellisense gives me a blue squiggly underscore and this error message. I have a feeling that I need something else in web.config to make it work, as UserService refers to DoWork.dll , which in turn refers to CompanyService , the contract of which I cannot see properly.
Any suggestions are greatly appreciated. Thanks in advance.
web-config wcf wcf-endpoint
BBauer42
source share