TAILIEUCHUNG - Lập trình .net 4.0 và visual studio 2010 part 32

JSON là một định dạng thường được sử dụng bởi các ứng dụng web vì nó là ít hơn nhiều tiết hơn XML. JSON là cũng hiểu bởi nhiều khung và các thư viện JavaScript. Nếu bạn muốn có WCF dịch vụ dữ liệu định dạng kết quả của bạn như là JSON, chỉ cần thiết lập các tiêu đề Chấp nhận để ứng dụng / JSON khi thực hiện một yêu cầu. | CHAPTER 9 WCF DATA SERVICES Hello WDS OK we are now ready to work with our data service. 1. Right click on and select Set As Start Page. 2. Press F5 to run your application. If all is well then you will see a screen similar to Figure 9-7 showing an XML representation of our EF classes A http localhost Chapter9 Mo vie Service svc Favorites http A calhost Chapter9 Mo vie Service svc Il Qj S Q Page- Sirfety Tods xml version encoding utf-8 standalone yes - service xml base http localhost Chapter9 n xmlns atom http 2005 Atom xmlns app http 2007 app xmlns- http 2007 app - workspace atom title Default atom title - collection href Films atom title Films atom title collection - collection href FilmShowings atom title FilmShowings atom title collection - collection href Orders atom title Orders atom title collection - collection href OrderItems atom title OrderItems atom title collection workspace service _ si I Local intranet Protected Mode Off 100 Figure 9-7. Output from accessing our test service Querying WCF Data Services WCF Data Services uses the URL to pass query parameters. For example to retrieve the film entities add Films to the end of the existing URL for example http localhost Chapter9 Films . You should then be returned a list of all the films in AtomPub format Figure 9-8 213 CHAPTER 9 WCF DATA SERVICES . . i Ô 3 rttp localhost 53496 MovieService svc Rlms 11 - X Google P Favorites @http A calhost 53496 Films II Qt 3 Page- Safety Tods xml version encoding utf-8 standalone yes - feed xml base http localhost 53496 xmlns d http schemas. ado 2007 08 dataservices xmlns m http ado 2007 08 dataservices metadata xmlns http 2005 Atom ctitle type text Films title id http localhost 53496 Filmsc id cupdated 2009-12-10T08 19 19Zc updated dink rel self title

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.