Inscription
mardi 6 janvier 2009
Forum
 
WCF web service problem
Dernier message 02 sept. 2008 11:55 par eurowise. 1 Réponses.
Version imprimable
Tri:
SuivantSuivant
Vous n'etes pas autorisé a poster une réponse.
Auteur Messages
danielrail
New Member
New Member
Posts:13


--
01 sept. 2008 04:05  
Hi,

I'm getting the following problem when trying to create a WCF webservice that the Windows and ASP.Net clients will connect to.

Here's the error message returned from the webservice:

[Start quote]
Server Error in '/ClaimsWS' Application.
--------------------------------------------------------------------------------
The type 'WCFClaimsmaster', provided as the Service attribute value in the ServiceHost directive could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The type 'WCFClaimsmaster', provided as the Service attribute value in the ServiceHost directive could not be found.
[End quote]

When I do some research with regards to this error, what I find is that there is an assembly missing where those classes are compiled in. And, when I look in the webservice's bin folder(of any other folder), there isn't any assemblies that is directly related to the WCF webservice(other than the business layer and data layer assemblies). And, I simply used the Multi-tier Application option in the Code Complete solution wizard.

Any ideas how to fix this?

Also, I noticed that when selecting the Multi-tier Application solution wizard, the Windows and the ASP.Net projects do not reference the webservice for connectivity, but the database server directly, because I can turn off the webservice and still run the Windows and the ASP.Net applications.

Thanks for any help.

Daniel Rail

eurowise
Basic Member
Basic Member
Posts:107


--
02 sept. 2008 11:55  
Hi Daniel,

The reason you are getting the error is due to a namespace problem. The C# generated classes have a namespace as follows (I use the Products table in the Northwind database to illustrate the problem):

namespace NorthwindWCFWeb
{
public partial class WCFProduct : IWCFProduct

The svc generated file does not:
<%@ ServiceHost Language="C#" Debug="true" Service="WCFProduct" CodeBehind="~/App_Code/WCFProduct.cs" %>

You need to change it to:
<%@ ServiceHost Language="C#" Debug="true" Service="NorthwindWCFWeb.WCFProduct" CodeBehind="~/App_Code/WCFProduct.cs" %>

You also need to change the Config file service and endpoint sections from:
<service behaviorConfiguration="WCFProductBehavior" name="WCFProduct">
<endpoint address="" binding="wsHttpBinding" contract="IWCFProduct">

to:
<service behaviorConfiguration="WCFProductBehavior" name="NorthwindWCFWeb.WCFProduct">
<endpoint address="" binding="wsHttpBinding" contract="NorthwindWCFWeb.IWCFProduct">

You have to do for every service. We will see how we can fix that in the next release.

The win and web do not reference the web services . The win and web application instead use the BL and the DL layer to comunicate with the database. If you want to use the WCF portal, you will need to configure that manually, for the moment.


Regards

Philip
Vous n'etes pas autorisé a poster une réponse.

Active Forums 4.0