Reputation: 44312
I'd like to access a WCF method via url. For example:
localhost:8080/TestService.svc/MyMethod
When I do the above, I get a webpage cannot be found. In the Interface file, I have added the following above MyMethod.
[WebGet]
[OperationContract]
void MyMethod();
but that didn't change anything. Any ideas?
Upvotes: 0
Views: 1385
Reputation: 2173
I think the quickest solution is to use a factory. It seems likely they would want a restful service so if you follow this guide you wont even need to specify anything in the web.config. See the first answer on this question.
Bare Minimum Configuration for RESTful WCF
Upvotes: 0
Reputation: 737
How does your web.config look like? Are you using REST?
Have you looked at below post? Making a WCF Web Service work with GET requests
Upvotes: 1
Reputation: 10995
I don't think you can. You need to use REST to do what you want. Or use a Controller/Action (if this is MVC) that will create a proxy object to consume the service e.g.
ServiceClient client = new ServiceClient();
client.MyMethod()
Upvotes: 0