Showing posts with label REST Service. Show all posts
Showing posts with label REST Service. Show all posts

Create an external content type from an OData source in SharePoint 2013

Sunday, May 5, 2013

External content type are is core part of Business Connectivity Services. which allow you create content type for external data to collaborate  with SharePoint. its more meaningful way to  interact  external data. you use your LOB Application with SharePoint 2013 and Performed CURD Operations. 

More About BCS 



 Prerequisites

 Microsoft SharePoint 2013
VS2012 with SharePoint 2013 Tools Developer 
Published OData Service . Sample free OData Sources List


1 Open VS2012  and Create New Project. Visual Studio >New Project >Office/SharePoint>App>Apps for SharePoint 2013.

2 Enter Your Project and Click Ok.

3 Enter your App Name and insert SharePoint Site URL where you want to debug or use it.
4 Select "SharePoint-Hosted" in type of host you want to select for you app.
5 Right Click on Solution Explorer in Visual Studio> Add > Content Type for an External Data Source.
6 It will Open SharePoint Customization Wizard Add external  Data Source Name and URL for Odata Service. 

7. Select Entities that you want to Create ECT then Click on Finish 

8. Once you create ETC It will Create one Sub folder in Solution under ETC which have by default List for that ETC. 

9.  Right Click On AppManifest.xml from Solution in Visual Studio select View Code then change the Value of attribute called " " with this ~appWebUrl/Lists/Employee.
10. Click  F5 to test and Deploy. go to you site > Site Content and you will your new app is there click on it.



Click on any of these item then you can see all information is here you can edit these recorded it depend on you service as well. 
for that you have create you own WCF Data Service then you can modified Records 



.List will not Appear in Site this Site Content for that you have Understand SharePoint  App Security and Storage Module. here MVP CHRIS O'BRIEN explained it very beautifully.


If have any other Questions Regarding that kindly Email me @ usamawahabkhan@gmail.com.


By Usama Wahab Khan 

SharePoint Rest Endpoint and Improvement in SharePoint 2013

Sunday, February 17, 2013


                                  
SharePoint 2013 comes again as a great development platform for Enterprise needs and Collaboration with the power of Social Features .In SharePoint 2010 Microsoft introduces Representational State Transfer (REST) service which they have improved  in SharePoint 2013 now REST Services  is fully comparable to the Client object models. Microsoft SharePoint 2013 client object models will have A corresponding REST endpoint. That developers can fully interact remotely with SharePoint data by using any technology that supports REST web requests which Use O Data Standard. The developer can perform all basic CURD (create, update, read, Delete) Operations by O Data Model. 

OData
                              
The Open Data Protocol (OData) is a web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon web technologies such as HTTP, Atom Publishing Protocol (AtomPub), and JSON to provide access to information from a variety of applications, services, and stores. (Source: Open Data Protocol site)


Access SharePoint 2013 REST ENDPOINT
In Teams to SharePoint 2013 REST ENDPOINT we use URL   http://site url/_api/web.  Previously in sharepoint2010 developers use So many clients. Svc difficult URL for rest service endpoint is still there SharePoint 2013 as well for backwards compatibility.

Easier Endpoint REST Service URLs
http://site url/_vit_bin/Client. Svc/web    (SharePoint2010)
Removing Client.SVC and make it easy To use it with the new url.
http://site url/_api/ http://site url/_api/web    (SharePoint2013)



To Use REST Service in SharePoint 2013 have made the HTTP request and serves the appropriate response in either Atom or JavaScript Object Notation (JSON) format. The client application must then parse that response. To Use SharePoint Client Object Model by Rest Service we Need entry Points where we can Access the namespace. Use the names of the APIs from the client object model separated by a forward slash (/). 

Client object model
REST equivalent
ClientContext.Web.Lists
http://server/site/_api/web/lists
ClientContext.Web.Lists[guid]
http://server/site/_api/web/lists(‘guid’)
ClientContext.Web.Lists.GetByTitle("Title")
http://server/site/_api/web/lists/getbytitle(‘Title’)


REST Services Access Points for SharePoint 2013
Area
Access point
Site
Web
User Profile
http:// server/site/_api/SP.UserProfiles.PeopleManager
Search
http:// server/site/_api/search
Publishing
http:// server/site/_api/publishing










REST Service open new door and possibility for Developer to create and manage your app for SharePoint 2013 with new web standard like OAuth and OData. SharePoint 2013 Rest Service Also Support Cross Domain cross Domain Library  to Access SharePoint 2013 data from remote apps. By using Cross domain library now app can interact with multiple domains.
How to Read Data 


How to Add and Update SharePoint Entities by Using Rest Services
                                  









You can Perform create and update operation with SharePoint entities by constructing with RESTFULL HTTP REQUEST WITH ENDPOINTS.
 

How to Delete  SharePoint Entities
 
More Reference
http://msdn.microsoft.com/en-us/library/fp142385.aspx