Deploying a custom ASMX service to a SharePoint 2007 Farm - c#

I have an asmx web service that I need to install on a five server SharePoint 2007 farm with three front end web servers. I was able to develop and successfully deploy the web-service on a single SharePoint 2007 test server in the /_vti_bin along with the other SharePoint services.It works great, however it will not work on the Farm servers.
I have looked and I can not find any information about deploying custom web-services to SharePoint server farms. I have copied the same files into all three of the front end web servers and tried to change a bunch of things with no results. I have had fiddler open while I made the request to the service on the farm and I am getting a 401 error. I am not even sure why it is getting the error as the site is setup to allow anonymous access.

Related

How to find Dynamics 365 online svc end point to use Connected Service in Visual Studio.Net?

I am trying to use a connected service in visual Studio.net for Microsoft Dynamics 365 online. How to find the svc end-point url since I am running the trial version?
I am trying to do POC via console app right now to fetch / create / update data.
I have the rest of the information like
Page ODataV4 URL ,
Query URL,
Tenant key
I have done a POC for PAGE Url with HttpWebRequest but in this case I have to create my own DTOs and then serialize JSON Results to DTO objects. So I want to use "Connected Service" but I can't find the svc endpoint.
Historically there were endpoints like OrganizationMetadata.svc retired. Soon Organization.svc will retire (deprecated now). So only endpoint for future is going to be RESTful web api.
Navigate to Settings -> Customizations -> Developer Resources, you will find the necessary urls.
Read more

WCF service hosted on windows service not working on server

I have a windows service working perfect. But when I deploy it on Windows server 2012, I am not able to browse it.
This page can’t be displayed
Make sure the web address https://localhost is correct.
Look for the page with your search engine.
Refresh the page in a few minutes.
p.s I don't have IIS installed on the server. Do we need that as I am hosting it in a Windows service.

SharePoint Hosted App 2013 - ASPX with c# code behind

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.

SharePoint Server Object Model and WCF

I was trying to access an API which contains SharePoint Server Object Model codes from a project inside WCF server. My intention is to download a document which is on SharePoint server.
My codes are inside WCF server. SharePoint server is another server.
Whenever I try to access the server using
SPSite.Exists(new Uri(spServerURL))
It does not know the server. So when I change the WCF application pool to run under the Farm admin account, it works well.
Is it OK to do like that or it will be a security breach?
How should I try to access the document ?
I think it will be better if you'll deploy your service to existing SharePoint web applications. So your service will work under SharePoint app pool account, so, you will not have problems with permissions of your service for SharePoint. Also it will be available for your SharePoint solutions from mapped path like this http:////_vti_bin/. This is useful, when you need to acces it from web contecxt you can use just relative path /_vti_bin/.
Check this link for more information about service development for SharePoint 2010.

Windows Service to upload files on SharePoint server. Some questions

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

Categories

Resources