Hello,
From your post, my understanding on this issue is: you want to know how to
consume a REST(Representational State Transfer) based Web service. If I'm
off base, please feel free to let me know.
REST is a term coined by Roy Fielding in his Ph.D dissertation to describe
an architecture style of network systems. REST is not a standard but an
architecture style. For instance,
1. The collection lives at http://localhost:8100/customers. HTTP GET
requests sent to this URI return the contents of the collection as a list
of URIs pointing to individual entries.
2. Each entry in the collection has a unique URI formed by appending the
customer ID to the collection URI. For example,
http://localhost:8100/customers/1 identifies the customer with ID 1.
3. Given an entry URI, we can retrieve an XML representation of the
customer by issuing an HTTP GET request to the entry URI.
4. We can modify an entry by using PUT to apply a new representation to an
existing entry URI.
5. Adding an entry is accomplished by sending the contents of the new entry
to the collection URI using HTTP POST. The URI for the new entry is
returned by the HTTP location header in the server's response.
6. We can remove an entry by sending a DELETE request to the entry's URI.
The current Visual Studio does not support adding a Web Reference to REST
based service as we do for SOAP based Web services. In order to consume a
REST based Web Service, we could implement the client on top of the WCF
HTTP transport stack, or use HttpWebRequest
(
http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.aspx)
if WCF was not available on the client, or even the XmlHttpRequest support
offered by most of modern Web browsers.
If your .NET solution supports WCF, please refer to the section
Implementing a POX client in MSDN article
http://msdn2.microsoft.com/en-us/library/aa395208.aspx. The page has a demo
project for your reference.
If you choose to use HttpWebRequest or XmlHttpRequest, we need to
GET/POST/PUT/DELETE a web request to the service and parse the response
with XmlReader or XmlDocument, etc. For instance,
http://www.thomas-bayer.com/restgate/index.do?URL=http://
www.thomas-bayer.co m/sqlrest/CUSTOMER/1/&httpMethod=GET
Below, I list a few more materials about REST:
An Online slideshow of REST:
http://www.xfront.com/REST.html Building Web Services the REST Way:
http://www.xfront.com/REST-Web-Services.html Online REST Web service demo:
http://www.thomas-bayer.com/rest-demo.htm Please let me know if you have any other concerns, or need anything else.
Sincerely,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document:
http://blogs.msdn.com/msdnts/pages/postingAlias.aspx Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.