I need to build an external upload utility to send files up to SharePoint 2010. However, I can't reference SharePoint to call all of the code needed to work with a document library.
Is there any way to make this happen inside Silverlight?
All answers are true and valid, however there IS a Client Object Model for SharePoint that you can use with Silverlight aswell. Here is a great tutorial to get you started.
This is rather not possible. Silverlight executes under a sandboxed environment with no direct access to server-side APIs.
Instead, create a WCF service at the server side, reference the Sharepoint DLL from within the service and call the service from Silverlight.
Silverlight runs on the client, not on the server, so you can't reference the SharePoint dlls. You would need to build a server-side service that uses the sharepoint dlls and then call that service from Silverlight.
There are built-in sharepoint developer entry points which I reference in my blog post here. You could probably use these instead of using the sharepoint dll.
Related
I have a small question which ends in a big topic.
Is it possible - and yes how - to use C# code in a SharePoint 2013 Hosted App?
I tried to have a .asmx file within my project.
Then I get this error.
#"Error 1
CorrelationId: 9c1ea930-a131-4f5b-bff5-8a1a61fe34d9
ErrorDetail: There was a problem with activating the app web definition.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964
And then I tried a few tutorials like...
http://chuvash.eu/2012/02/13/custom-httphandler-in-sharepoint-for-getting-dynamic-javascript-code/
http://blogs.msdn.com/b/kaevans/archive/2010/08/04/deploying-an-asp-net-httphandler-to-sharepoint-2010.aspx
http://social.technet.microsoft.com/wiki/contents/articles/24194.sharepoint-2013-create-a-custom-wcf-rest-service-hosted-in-sharepoint-and-deployed-in-a-wsp.aspx
But sometimes I didn't understand correctly or sometime I have other problems during compile everything.
I had a problem with getting assembly id/name, too. Because there was no compiled DDL File for the project.
What I want in general?
A .app file with a SP Hosted App (for SP 2013) which includes a web service for SP Client Object Model.
So I thinking about using the "default.aspx" with CodeBehind. So I could execute scripts "behind" the aspx. But then it couldn't find the assembly... Or there was something else.
Could anyone help me? If you have some ideas you could !please! provide them to me. Thank's!
SharePoint hosted Apps doesn't allow server side code to be excuted on the server, this is the whole idea of SharePoint Apps, nothing should be executed in the SharePoint Front End Servers. Unlike Farm solutions, SharePoint Hosted Apps runs on the client and can only access SharePoint resources through a predefined set of services that can be called either using REST or JSOM.
If you need a custom code, you can create a WCF service, deploy it under ISAPI and call it from your App, but this will not be doable in SharePoint online.
As for your question, you can use ASPX pages of course, but you will never put a code behind for it, as these pages are stored in a Pages Library and by design, it is stored in the content DB, so any code execution is denied.
Only aspx pages that are stored on hard disk like the _layouts pages can have a code behind.
SharePoint App runs in client context. You can create SharePoint App just using JS, HTML, CSS, JSOM. You cannot use C# for App (excluding CSOM, you can use it for creation remote event receiver for example)
If you need to implement some functionality to on-premise version of SharePoint, use traditional server-side solutions, not App.
It's important to understand the difference between SharePoint-hosted Apps and Provider-hosted Apps:
SharePoint-hosted Apps
SharePoint-hosted apps, or apps where all components are hosted on either an on-premises or Office 365 SharePoint farm. SharePoint-hosted apps are installed on a SharePoint 2013 website, called the host web. They have their resources hosted on an isolated subsite of a host web, called the app web. The App is created using HTML/JavaScript with CSOM or REST calls
Provider hosted apps
Provider-hosted apps for SharePoint include components that are deployed and hosted outside the SharePoint farm. They are installed to the host web, but their remote components are hosted on another server. The App run in a server that is external to SharePoint's. It has its own infrastructure and the Provider is responsible for keeping it running. They allow you to use Server Side code and uses the .NET CSOM.
This image will give you an overview of different Hosting solutions:
Visit the following link for more information:
https://msdn.microsoft.com/en-us/library/office/fp179887(v=office.15).aspx
The SharePoint Add-in model uses ASPX pages, which can also include ASPX controls. However any methods called are restricted to client-side scripting - i.e. JavaScript and SharePoint's JSOM (JavaScript Object Model), which is a subset of the Client Side Object Model.
I have developed a C# Windows Service application with certain methods that I would like to call from an ASP.NET web application (it is important that there are these methods returning the result). My initial guess was that I could import the dll of the Windows Service into the web application, but I can find only the executable of the windows service, there's no dll at all.
Is it possible to compile the Windows Service into a dll? And if not, is there some other way I can reference my Web Service into the Web application?
Extract the common functionality into a class library project and reference it from both projects.
Is your windows service hosting a web service or does it just contain code that needs to be accessible in you windows service and web site?
If the former, then you can connect to it via the normal mechanims for connecting to a web service (e.g. adding a service reference in Visual Studio). If the later, then create a class library that both your windows service project and web project can reference (via Add Reference in Visual Studio).
You have two options. If you just need the code to be invoked, then you can call the windows service functionality via a custom action on the service, invoked from your code.
However, I gather that what you require is more complex, requiring a response as well. In this case, as per sga101, encapsulate the appropriate functionality into a separate class, and use this in both places. This means that the code projects should both be included in the same solution ( it is not strictly necessary, but it makes it easiest to keep the code matching ).
I am trying to interact with Sharepoint lists via Unity 3D and C#. Most tutorials I have found are for Visual Studio, so it doesn't help me.
I need to be able to read and write to my Sharepoint list.
Anyone have any suggestions? As far as I can tell, this hasn't been done yet.
Use the Camelot SharePoint Integration Toolkit that extends the Camelot ADO.NET Connector for SharePoint. As long as you can connect to a WCF service you'll be fine.
You can have a look at the PHP Toolkit that matches the Integration Toolkit, here is a video http://www.youtube.com/watch?feature=player_embedded&v=mDtvcTnTbeM
Resources
http://camelottoolkit.codeplex.com/
http://www.bendsoft.com/net-sharepoint-connector/
Yes, you should be able to read and write to SharePoint lists.
You could use the SharePoint Server 2010 Class Libraries and Web Service References or maybe you could use the SharePoint 2010 Managed Client Object Model.
The most tutorials for accessing the SharePoint Webservices are for Visual Studio, but accessing the SharePoint Webservices has been done with Javascript and seemlingy Mono, too (see MonoTouch, Sharepoint web services and xs:any).
I want to get some useful data from *.csv file through the retrieve query, then put these data in the reference column of the sharepoint list using the admin account.
Which sharepoint project in VS2010 should I choose? And what should I do in next?
Thanks
如果我是要从 *.csv 文件中取一些数据 ,然后放到sharepoint上, 应该选择哪种工程呢?然后接下来应该怎么做呢?
谢谢
If you only need to run this job once you could create a console application and let it run on the server. Include a reference to the Microsoft.SharePoint.dll to be able to use the Object Model of SharePoint. See http://msdn.microsoft.com/en-us/library/ms473633.aspx for an overview of the different objects you can use. (SharePoint 2010)
If you have no access to the server you could try the same using the webservices that sharepoint exposes. See http://msdn.microsoft.com/en-us/library/ms479390(v=office.12).aspx for a list of the webservices in WSS3.0
But if you need it be done regularly your better of creating a webpart or a custom service to include into SharePoint. See http://msdn.microsoft.com/en-US/sharepoint/ee513148.aspx for an intro on building a WebPart for SP2010.
Google around, there is a lot to find about interaction with sharepoint through its object model.
I would like to upload some files on a server Share Point.
My questions are:
1) I started developing my project as a Windows Service but I read several parts of this WebService. It's mandatory that it's be a WebService?
2) I added the references to. Dll take it from my SharePoint Server (as seen in most discussions) but a little read more shares can not be tested if not solely on where you installed SharePoint Server. Right or there are alternative methods to do this? And also, when we deliver the service, can I install the latter on a machine where SharePoint is not installed (it seems a trivial question, but it seems strange not being able to test
but you install it).
You can only reference SharePoint 2007 assemblies from code that is running on the machine where SharePoint is installed (if you were using SharePoint 2010, you could take advantage of the Client Object Model).
Only the part of your solution that is directly interacting with SharePoint has to be created as a web service. You should create a web service with basic methods like UploadFileToLibrary, deploy it to SharePoint machine and then call these methods from the client (it can be an ASP.NET page or desktop application).
As Kit Menke pointed out in a comment below, it is possible that built-in SharePoint web services will be sufficient for you needs and you won't have to create a custom one:
Upload a file to SharePoint through the built-in web services
Copy.CopyIntoItems method