简体   繁体   中英

Add WCF Service Reference to Umbraco

Im currently using Umbraco 4.11 that is integrated to an asp.net mvc 3 application. Im trying to reference a wcf service in the umbraco project by selecting Add Service Reference in visual studio but I can not seem to access the service library once it is added. I tried to look into the object view browser and I couldn't find the object namespace for the wcf service. Am I missing something? Is this method of consuming wcf service in umbraco possible? I prefer not to use a separate project that uses a user control to access the wcf service since it seems to be tedious to do.

There is a warning when adding a service reference: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Could not load file or assembly 'umbraco, Version=1.0.4090.38017, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

You may want to setup the service reference in a separate project, then migrate the dll and the web.config settings. Then you should be able to access your web service via razor after adding using statements.

The problem is that the code file for the service isn't being generated because of a conflict with umbraco. You could alternatively generate the code file manually using svcutil.exe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM