Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Im new to wcf..
In my interface(IService1.cs) file I declare a method
C#
[OperationContract]
        int AddToPersonalData(string[] array);


In my Service.svc.cs file I implement the method like this
C#
public int AddToPersonalData(string[] array)
       {
           int counter = 0;
           foreach (string value in array)
           {
               PersonalDetailsData.PersonalData[PersonalDetailsData.counter, counter++] = value;
           }
           PersonalDetailsData.counter++;
           return PersonalDetailsData.counter;
       }


But when I access the method in my client project method signature is different.I did the same thing in visual studio 2008 and it worked fine.But problems occurs with visual studio 2010.

http://uploading.com/files/mb1c9f3d/Untitled.png/
Your answer will be appreciated
Thanks
Dhanushka
Posted
Updated 25-Apr-12 22:32pm
v3
Comments
Andy411 26-Apr-12 2:49am    
Did you update the servie reference on the clientside? (Project tree: Right click on the service in service references, "Update...")
Where does PersonalDetailsData come from? To debug, comment all out and only return only array.Count(). Just to be sure, that the problem doe not come from PersonalDetailsData. In WCF erormessages are sometimes a bit weird...
Dhanushka Madushan lk 26-Apr-12 4:23am    
Thanks but its not a error .. just the method signature is different ....

In client project, app.config should be written with proper signature as:

XML
<client>			
			<!--My Service-->
			<endpoint address="http://address/MyService/MyService.svc">
				binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
				contract="IMyService" />
</endpoint></client>
 
Share this answer
 
Comments
Dhanushka Madushan lk 26-Apr-12 4:22am    
I created a wcf service application So there is a web.config instead of app.config.
I did this in visual studio 2008 and it worked perfectly because web.config file auto updated. But in visual studio 2010 it don't.
Can you please explain why is that??
Im really sorry I have added a web reference instead of a service reference in the client project.
Thanks
Dhanushka
 
Share this answer
 

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