[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

wcf restful service

Posted on 2013-01-25
4
Medium Priority
?
537 Views
Last Modified: 2013-01-28
How do you set up a wcf restful service so that if I call the service like so

http://domain/service.svc/patient/1

that it knows it is a get or a post?
0
Comment
Question by:JDEE8297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 920 total points
ID: 38822144
To be more precise, you are calling the service.svc service, but you are accessing the patient/1 resource.
You can access that resource with several HTTP methods: POST, PUT, GET, DELETE, etc.
GET is used for retrieving the resource, so the request message body is empty, while the response message contains the resource data
POST is used to send (create) the resource, so the request message contains the resource data, while the response message is empty
0
 

Author Comment

by:JDEE8297
ID: 38826068
so that does that mean if you call the service like so


service.svc/patient

and call it from jquery as a post method, and pass in the json object on the post, that backend code will know which method to send it to in the service and handle it accordingly.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 38826591
The backend will know what to do with the resource 'service.svc/patient/1', based on the HTTP method. That's the correct usage of REST.
In summary: the URL contains the resource (the subject), and the HTTP method contains the action (the verb).
0
 

Author Closing Comment

by:JDEE8297
ID: 38826612
thank you. :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question