Accessing Sharepoint Data through Web Services in Asp.net application - asp.net

We have 2 different sites, one is Asp.net and another MS Sharepoint and we need to take some data from Sharepoint to the Asp.net site
The Asp.net application is one server and the Sharepoint Site is on a different server.
How can we do move that from one site to another through Web-services?
We are looking for suggestions.

You can use standard Sharepoint soap web services or Managed client object model. Please find links below:
Windows SharePoint Services Web Services -
http://msdn.microsoft.com/en-us/library/aa979690(v=office.12).aspx
Call it from js - http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx
SharePoint Foundation 2010 Managed Client Object Model -
http://msdn.microsoft.com/en-us/library/ee857094.aspx
Setting a Sharepoint Site Theme through a Web Service?

Related

Visual studio vb asp.net webpage privacy/authentication settings

I am using Visual studio 2010 vb asp.net
I want to secure my webpages from direct accessed by unauthorized person or only user can access the page.
how to setup Visual studio vb asp.net webpage privacy.
or Is there any plugin available for visual studio for securing pages
Thank you
JS
In short, you need to have some authentication scheme to identify valid application users and then you need some kind of authorization mechanism (such as role based security) to control the access to different pages and/or application functions and/or application data.
See this comprehensive help: How ASP.NET Security Works on MSDN.
For a quick overview, have a look at this code project article: http://www.codeproject.com/KB/aspnet/ASPDOTNETauthentication.aspx

SharePoint Web part vs ASP.NET web part

Can some one give me the difference between a SharePoint web part and an ASP.NET web part. I found very little information describing the differences.
Thanks in advance.
MSDN - Choosing Between ASP.NET 2.0 Web Parts and Windows SharePoint Services 3.0 Web Parts
You should create ASP.NET 2.0 Web Parts whenever you can. However, there are a few exceptions where using SharePoint-based Web Parts might offer advantages.. The following table provides a decision matrix to help you choose the best option depending on your business needs.
Create a custom ASP.NET 2.0 Web Part
For most business needs.
To distribute your Web Part to sites
that run ASP.NET 2.0 or SharePoint
sites.
When you want to reuse one or more
Web Parts created for ASP.NET 2.0
sites on SharePoint sites.
To use data or functionality provided
by Windows SharePoint Services 3.0.
For example, you are creating a a Web
Part that works with site or list
data.
Create a SharePoint-based Web Part
When you want to migrate a set of Web
Parts using the SharePoint-based Web
Part infrastructure to Windows
SharePoint Services 3.0.
To create cross page connections.
To create connections between Web
Parts that are outside of a Web Part
zone.
To work with client-side connections
(Web Part Page Services Component).
To use a data-caching infrastructure
that allows caching to the content
database.
As far as i got, SharePoint WebPart overrides ASP.NET WebPart
to to persist its data inside the content database of SharePoint Foundation
you can design for and use an ASP.NET Web Part in SharePoint, but not vice versa.
SPF WebParts supports backward compatibility, cross-page connections, conns between WebParts that are outside of a zone, client-side connections (Web Part Pages Services Component), data caching (incl. to database)
they use differing WebPartManager (e.g. SPWebPartManager) and WebPartZone objects, so you can't easy copy WebParts Pages from ASP.NET to SharePoint, but rather export WebParts
Most of that you find on ...
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx
http://msdn.microsoft.com/en-us/library/ms415560.aspx

what is the difference between webservice and webapplication?

can you please tell me what is the difference between webservice and webapplication.
A web service:
Typically returns XML or JSON or something like that, something that is easily decoded by a program
The results you get from a web service is typically not just shown to a person in its raw form (ie. since it isn't HTML, the results have to be reformatted, like placed into a form)
The intended usage of a web service is that it is something an application can talk to
A web application
Typically returns HTML or image data or similar
The results you get from a web application is usually shown to a person, through a web browser
As for similarities:
Both typically use HTTP(S) as the transport
Both typically use HTTP authentication/authorization to secure data
Both are typically hosted by a web server
So the main difference is who usually talks to them. A web service usually by another application, a web application usually by a web browser. Other than that they're pretty similar.
Here is the Web Application and here is Web Service
Web application: any application which resides on a server, and mainly used by human using web browser. All user interactivity is done through web pages.
Web service: server-based application (as above) which may be accessed over the web via HTTP, but is meant primarily for interaction with other programs. Generally it is WEB API for other applications.
In a nutshell, a Webservice uses special HTTP transport protocols to communicate to other servers. Webservices are meant to be used by other applications.
In the ASP.Net world, a web application is a type of Visual Studio project that allows building ASP.Net websites in a particular configuration. E.g. A Webservice can be built using a Web Application type project. Or a Web Application can also refer to a website that is meant to be used directly by an end-user ( unlike web services ).
Here are a few links and related SO questions...
What is the difference between an asp.net web method and a wcf service?
ASP.NET Web Site or ASP.NET Web Application?
Introduction to Web Services and ASP.NET
check this
http://en.wikipedia.org/wiki/Web_service
http://www.w3schools.com/webservices/ws_intro.asp

Can i deploy MOSS based webparts on ASP.NET web form and how

i need to know, if we can deploy webparts that are created in MOSS for MOSS on a ASP.NET page and use them. Or is there any way of using the webparts with MOSS.
TIA,
Nimish
If the webparts created for SharePoint, are SharePoint specific, and rely on SharePoint Functionality, then they will only operate on a SharePoint server (or an ASP.NET server, with access to the SharePoint server, depending on the webpart).
However, Webparts created in ASP.NET, can (typically) be used within SharePoint.
Note: SharePoint, comprises both MOSS (Microsoft Office SharePoint Server) and WSS (Windows SharePoint Server).
When you create a webpart "for MOSS", you create a control which inherits System.Web.UI.WebControls.WebParts. So, actually, you write a webpart "for ASP.NET" and can also execute it inside WSS/MOSS.
Please, read this links as they provides more informations on subject:
ASP.NET Web Parts controls
Building an ASP.NET 2.0 Web Part for Deployment to WSS V3.0 and MOSS 2007
You can not use SharePoint web parts in a plain ASP.NET site. Most Sharepoint web parts heavily rely on the (extra) functionality that SharePoint server provides. Without SharePoint they will not work.

Integrating SharePoint document libraries into an ASP.NET page

Is there any way that I can use SharePoint document library and document sharing functionality from an ASP.NET page?
There's 3 ways you can have your standalone ASP.NET (standalone meaning not integrated into sharepoint) interact with sharepoint.
1 using the SharePoint object model (sharepoint APi dll's). This way allows you to control every part of how your ASP.NET site interacts with SharePoint (document security etc.) The major drawback is that you ASP.NET site needs to be running on the SAME SERVER as SharePoint (or if sharepoint is used in a farm any machine that is running sharepoint in that farm). Simply including the SharePoint DLL's will NOT work when run on any other machine (even when that machine also has sharepoint installed but is not part of the farm you want to communicate with!)
2 Web Services. These OOTB services can be used from anywhere but are not very extensive functionality wise. They allow you to perform a lot of actions and retrieve a lot of data, but when it comes to more finegrained control they just don't cut it. It might be enough for what you want to do though.
3 Use web services and create your own webservice that is deployed to sharepoint for any tasks not doable with the OOTB services. This requires access to the sharepoint machine in the form of deploying custom code / assemblies though.
I assume that your asp.net application is running on another server because if thats not the case the it would probably be easiest to just use the SharePoint functionality directly and maybe include your app into SharePoint
SharePoint exposes a lot of it's functionality through Web Services, so you can get, add, delete and update information through these.
You can include any SharePoint page into a page in another portal using an IFrame. The main issue there is the fact that you will get the MOSS navigation in that IFrame, which typically is not desired. To overcome that, you can create a special MOSS page that hides all those elements and show just the element you want to expose. To accomplish that, you can create a “minimal” master page and a simple layout with a single web part zone.

Resources