.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Host custom webservice in sharepont

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
How to host a custom webservice in sharepoint?Manvir

View Complete Post

More Related Resource Links

The Perfect Host: Create And Host Custom Designers With The .NET Framework 2.0


The .NET Framework 2.0 introduces a set of classes that can be used to host designers right out of the box. With the understanding of designers you'll glean from this article, you'll be ready to host them in your own apps.

Dinesh Chandnani

MSDN Magazine March 2006

Office 2003: Host an Interactive Visio Drawing Surface in .NET Custom Clients


Microsoft Office Visio 2003 introduces a new drawing component that allows you to embed an interactive drawing surface into your application's user interface. You can drive the Visio drawing component from events in your host application or with data from a Web Service and an ADO.NET data adapter. The Visio drawing component supports the rich Visio application programming model, giving you control over how graphics are used and displayed on the drawing surface. This article explains how to embed the Visio drawing component into a C#-based Windows Forms client app that retrieves data from the Fabrikam 2.0 Web Service.

Mai-lan Tomsen Bukovec and Blair Shaw

MSDN Magazine December 2003

Microsoft .NET: Implement a Custom Common Language Runtime Host for Your Managed App


While most application developers may not need to write a custom host, understanding what is involved provides a great deal of insight into the architecture of the CLR. After covering how the CLR is started and loaded into a process, how to set the available configuration options, and how a host defines application domains, this article explains how to design a custom host. Important concepts include making the right decisions about the application domain boundaries for the host, configuring them correctly, loading and executing user code, and resolving references to assemblies. Setting security policy and unloading application domains as the application shuts down are also explained.

Steven Pratschner

MSDN Magazine March 2001

Problem passing custom object returned by the same webservice among two separate projects

I am running into casting issue with this scenario: 1. I made a custom object lets call it EmployeeObject.  2. The Employee object is wrapped in the EmployeeWebservice.  3. I have a client application project lets call it EmployeeClientApplication and a class library called DoSomeWorkClassLibrary.  Both EmployeeClientApplication and DoSomeWorkClassLibrary reference the EmployeeWebService and need to be able to pass the EmployeeObject back and forth.  4. The EmployeeClientApplication also references the DoSomeWorkClassLibrary. 5. The employeeObject in the EmployeeClientApplication becomes EmployeeClientApplication.EmployeeWebService.EmployeeObject. 6. The employeeObject in the DoSomeWorkClassLibrary becomes DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject. 7. The DoSomeWorkClassLibrary has a method called DoSomeWork that takes an EmployeeObject. When I try to pass employeeObject from EmployeeClientApplication to DoSomeWorkClassLibrary by doing something like this: DoSomeWorkClassLibrary.DoSomeWork(EmployeeClientApplication.EmployeeWebService.EmployeeObject), I am getting Unable to convert EmployeeClientApplication.EmployeeWebService.EmployeeObject to DoSomeWorkClassLibrary.EmployeeWebService.EmployeeObject.  I have searched high and low to fix this issue, I have tried changing the namespace of the reference.cs file of the webservice in

Remoting from WebService throws: An existing connection was forcibly closed by the remote host

Hello everyone, I have a problem with using .NET remoting from webservice. When using remoting from console application, there is no problem. I suppose problem is somewhere in IIS. My system is Windows Vista. Thank you for any help. Best regards, Jozef

Getting Exception: Testing Custom Webservice deployed on SharePoint 2010 using VS 2010 Pro


Hi there, I am a newbie in Webservice programming.
The exception:
The Address property on ChannelFactory.Endpoint was null.  The ChannelFactory's Endpoint must have a valid Address specified.
I have read many sites in internet (found unfortunately only for VS2008 and SP2007) and tried many things, but always failed. I really need your help to solve this problem. Thank you in advance.

I am trying to test a custom webservice deployed on Sharepoint 2010:

The webservice can be called: http://localhost/_vti_bin/StructureSearch/StructureSearchService.svc
And I got instructions like below: 

svcutil.exe http://localhost/_vti_bin/StructureSearch/StructureSearchService.svc?wsdl

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:

C# .. and so on

So I created a simple c# console app like following:

creating a custom namespce for a webservice



I am working on a web service right now and I am using the default namespace which is below one;

[WebService(Namespace = "http://tempuri.org/")]

How can I create a custom user interface?

Like this page;


Host a Webservice in IIS without using website


Can we have a solution which has a webservice project alone and host it in IIS.

Or do we always need a website attached to webservice, and the website is to added into IIS

Webservice versions.asmx: Getversions-method returns error on an item of a custom list.


I using GetVersions from the webservice http://server/_vti_bin/versions.asmx. This method works Okay in SharePoint 2007, and in SharePoint 2010 it also works Okay on documents from a document library. But when I used on an item from a custom list, it returns an error stating: "Value cannot be null.\r\nParameter name: key". In SharePoint 2007 I could retrieve the histroy on an item with the call GetVersions("Lists/MyCustomList/5_.000"), in SharePoint 2010 this fails.

Do I need to change the parameter, or use another filename for an item instead of "5_.000"? Does any one have the same experience?

Thank you

Advice on whether to host custom .Net web apps on SP Farm


I have a couple of questions about hosting custom .NET web applications on a SP farm.  On our old IIS web server we hosted a mix of web sites and web applications.  We have moved the web site content into SharePoint but now need to decide where to move these web applications.  We currently run 2007.  Our SP environment includes two WFE servers using Network Load Balancing (software).

1. Would it be wise to move these applications to the farm on a separate IIS website/application pool or is it better to isolate them on a separate web server?
2. Are there any issues with running multiple versions of the Framework (specifically 3.5sp1 and 4.0) on the farm as long as the SP web applications run in their own app pool associated with the 3.5 version?  I've read it can be done but want to know if there are any issues or things to be aware when configuring.

Any advice is appreciated.

Thank you,
J. Aqui

What is the correct way to create custom host?



I'm going to use aspx pages as templates for code-generator. I found two ways how to achieve it, but with both have troubles.

Test project consists of two files code.cs and test.aspx with only "Hello!" text.

namespace TestHost
    public class CodeGenHost : MarshalByRefObject, IRegisteredObject
        public void Generate()
            using (StreamWriter sw = new StreamWriter("out.txt", false, Encoding.Default)) {
                HttpRuntime.ProcessRequest(new SimpleWorkerRequest("test.aspx", null, sw));

        void IRegisteredObject.Stop(bool immediate)

    class Program
        private static AppDomain GetDomainForGenerator()
            AppDomainSetup setup = new AppDomainSetup();
            setup.ApplicationName = "MyDomain[ASP.NET Generator]";
            AppDomain dom = AppDomain.CreateDomain("generator domain", null, setup);

            dom.SetData(".appPath", Directory.GetCurrentDirectory() +
            dom.SetData(".appDomain", "*");
            dom.SetData(".appVPath", "/");
            dom.SetData(".domainId", dom.FriendlyName);
            dom.SetData(".hostingVirtualPath", "/");

Sharepoint2010 Custom Webservice SPContext


I wrote a custom webservice called Service.asmx in which I deployed its WSDL/DISCO aspx files and the webservice asmx into sharepoint's ISAPI folder and the webservice's strongly named dll into the GAC.  These work as they should.

If I create a webservice consumer that invokes a test method on my custom webservice, my webservice is able to obtain the SPContext of the sharepoint site pointed to by the URL.

If I open internet explorer on my webservice and manually invoke the same test method from the WSDL menu, my webservice reports the SPContext of the same sharepoint site is null.

In both cases the URL (for the reference to my webservice in the consumer, and what I keyed into internet explorer) is the same:


Why does the webservice sometimes lose its SPContext?  How do I get the SPContext when I call the webservice from internet explorer?  Shouldn't the two invocations of the webservice not behave the same?  What am I missing here?


sharepoint 2010 custom webservice, visual studio 2010, unable to get reference - content type is tex


I followed the MSDN example in how to create a custom webservice that integrates with sharepoint at http://msdn.microsoft.com/en-us/library/ms464040.aspx

I'm able to successfully call the custom webservice it walks you through from internet explorer out of a sharepoint 2010 site using a URL such as http://vm-spproduction/sites/resource/_vti_bin/service.asmx

And, I'm able to successfully call the same custom webservice from internet explorer out of the same sharepoint 2010 server with the URL http://vm-spproduction/_vti_bin/service.asmx

In Visual Studio 2010 (running on the same hardware server as sharepoint 2010), I am able to bring up the same custom webservice in the add web reference using the advanced buttons of the add service reference dialog.  But, when the custom webservice is found, visual studio reports the following error:

The document at the url http://vm-spproduction/sites/resource/_vti_bin/service.asmx was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from '

Sharepoint2010 custom webservice and GAC


Is it absolutely neccessary to deploy custom created webservice dlls that run out of sharepoint 2010 in the GAC?  Is there any way to create a custom webservice that runs out of sharepoint without having to strong name the assemblies?

I need to develop a webservice that accesses sharepoint 2010 APIs to support a seperate CRM 3.0 application that needs to create folders in sharepoint 2010 and upload documents.  Because CRM 3.0 can only run in the .net 1.1 framework, I have to create a webservice in sharepoint for CRM to call that acts as a proxy and executes CRM requests against sharepoint 2010 on its behalf.


Deploy custom webservice to web application



I'm writing custom webservices for SharePoint 2010. Now generally it involves deploying .svc files to the ISAPI directory, which makes them available in http://server/_layouts/_vti_bin.

Works great, but this deploys the webservice to all web applications at once. In a shared environment this isn't preferable. So how can I deploy the webservice to a single webapp? I guess that means the .svc should be somewhere in the database instead of the filesystem. Is this doable and a good solution? Or are there other ways to acheive the same.

I'd like to have a solution which deploys to the web application scope. Updon deployment, I can select the web application(s) to deploy it to which makes the webservice avaiable in those and only those web apps.

MCTS Web Application Development, SharePoint enthousiast.

Manually configure (custom) binding for Java-based webservice



this is a follow up to my question Error "An unsupported security policy assertion was detected" when processing a WSDL with Svcutil.exe.

It seems that I'll get no further feedback on this, so I'll go with the assumption that it's not possible to use Svcutil.exe to generate functional client code from the WSDLs of the there mentioned services.

The main problem seems to be the security policies which are completely ignored, so no meanigful binding gets generated.

Therefore I guess I've to manually set up a (custom) binding to produce requests the conform to what the services expecting.
Here's an example for a service requests, it uses an SCT (issued by the corresponding STS) for authentication:

<?xml version="1.0" encoding="UTF-8"

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend