Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 20 Sep 2007 13:21:34 -0400,    group: microsoft.public.dotnet.distributed_apps        back       


Consume REST Web Service?   
I added a remote web service reference to my .NET 2.0 projects, but it
appears to be REST and not SOAP. How can I work with REST?

Thanks.
date: Thu, 20 Sep 2007 13:21:34 -0400   author:   lucius am

RE: Consume REST Web Service?   
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.
date: Fri, 21 Sep 2007 06:30:29 GMT   author:   (Jialiang Ge [MSFT])

RE: Consume REST Web Service?   
Hi ,

If you need further assistance, feel free to let me know. I will be more 
than happy to be of assistance. 

Have a great day!

Sincerely, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue. 
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Tue, 25 Sep 2007 06:51:12 GMT   author:   (Jialiang Ge [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us