Costin_T
Costin_T

Reputation: 786

ServiceStack: Error calling service

I have implemented the a ServiceStack sample service, just like in the documentation - github.com/ServiceStack/ServiceStack/wiki/Create-your-first-webservice

The problem is that when I try calling it I get these errors:

"cannot convert from 'string' to 'ServiceStack.ServiceHost.IReturnVoid'"

and

The best overloaded method match for 'ServiceStack.ServiceClient.Web.ServiceClientBase.Get(ServiceStack.ServiceHost.IReturnVoid)' has some invalid arguments

My code for calling the service:

var client = new JsonServiceClient("http://host:8080/");
HelloResponse response = client.Get(new Hello { Name = "World!" });

Can anyone help? Thanks.

Upvotes: 2

Views: 1078

Answers (1)

Tyler Smith
Tyler Smith

Reputation: 1279

HelloResponse response = client.Get<string>(new Hello { Name = "World!" });

you have to specify the return type in generic methods like these.

Upvotes: 1

Related Questions