Last post Oct 15, 2013 04:57 AM by Amy Peng - MSFT
Oct 13, 2013 09:03 PM|Sid_programmer|LINK
WCF Service: TestService\TestService.svc
WCF Method: Public String GetDetails(String Input)
Calling Service: I am adding the TestService.svc and I create a proxy object of ITestService. However I am not able to call GetDetails() using the proxy object and pass the string parameter. Instead Iam forced to create a ITestServiceInput object and pass
the "Input" and also the output is not coming as string but as ITestServiceOutput.
Why am I not able to just pass a normal string and get a string returned as output? Please let me know if I am doing something wrong.
Oct 13, 2013 11:07 PM|Rajat|LINK
Are you using data contract ?
Please don't use it make it normal. I hope it will resolve your problem.
Oct 14, 2013 05:09 AM|Illeris|LINK
Did you follow the steps as shown here : http://www.codeproject.com/Articles/42643/Creating-and-Consuming-Your-First-WCF-Service
When passing/getting native .NET objects you do not need any datacontracts. Only mark the service methods as "OperationContract" and the service as ServiceContract. That should do the trick.
Oct 15, 2013 04:57 AM|Amy Peng - MSFT|LINK
According to your description, I have created the following example, please try to refer to:
public interface ITestService
String GetDetails(String Input);
public class TestService : ITestService
public String GetDetails(String Input)
After running it in the browser, then we can call this TestService in the client as below:
static void Main(string args)
ServiceReference1.TestServiceClient client = new ServiceReference1.TestServiceClient();
string str = client.GetDetails("Good Work");
If you have any other problem, please let me know in your free time.