Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Guys

I am trying to call my WCF Service using the code below but I am getting error message which says: The type or namespace name 'WCFCarService' does not exist in the namespace 'SilverlightCarServiceClient.WCFSilverlightReference' (are you missing an assembly reference?)
I have also tried to add it as reference and Silverlight does not accept projects created outside silverlight to be added.

C#
public MainPage()
       {
           InitializeComponent();
         SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService client = new SilverlightCarServiceClient.WCFSilverlightReference.WCFCarService();


The service reference added is WCFSilverReference.

Please help.
Thanks
TB
Posted

Can you have a look at SOAP message of the web service to see if 'WCFCarService' exists within the message in the first place?
 
Share this answer
 
v2
Comments
Techbee 4-Jun-10 17:33pm    
I have looked at the SOAP message and it contains the WCFCarService. I have even created an ASP.Net client to test the service and it is working fine. When I checked the Service reference it does not contain the WCFCarService which is strange because I confirmed that the service reference has been properly created.
Abhinav S 5-Jun-10 4:17am    
Silvelight suppports the Basic WS profile (http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html). In case you've used some constructs that don't conform to that, the web service wont be correctly generated in Silverlight.
Did you create your web service correctly? If you're doing a WCF service, you have to first create a .net web service, and then within that project, you have to create a Silverlight-compatible WCF service.
 
Share this answer
 
Comments
Techbee 4-Jun-10 17:36pm    
Not sure if it makes a difference but here is how I did it: I created the WCF application and then I added a Silverlight application. I have also tested the WCF service with an ASP.Net client which worked fine without any difficulties.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900