PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Deploy a custom Webservice into the SP ISAPI (_vti_bin) filder

Posted by PANVEGA on November 19, 2008

In this article I’ll cover how make a Content Deployment of a custum WebService (.asmx/.disco/.wsdl) to the ISAPI Folder. The dll is going to be deplyed into the WSS bin folder. For some procedures like, for example, adding the web service as a reference in a visual studio project, the discovery (.disco) and wsdl files are required.

read more about deploying inti the bin folder rather GAC in one of my posts

What we will do is to publish the service in the mapped _vti_bin (ISAPI) sharepoint folder of our site.

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI

We only need the .ddf file in order to create our .wsp file. In addition we need the manifest.xml file to show where to deploy the files and dll.

here is a code snippe from the .ddf file

Manifest.xml
ViewAllSites.dll

.Set DestinationDir=ISAPI
..\ISAPI\AllSitesService.asmx
..\ISAPI\AllSitesServicedisco.aspx
..\ISAPI\AllSitesServicewsdl.aspx

You do not need a solution.xml file, because you do not have a feature deployment in this special case.

the manifest.xml

<Solution SolutionId=”xxxxxxxxxxxxxxxxxxxxxx” xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;
<Assemblies>
<Assembly Location=”ViewAllSites.dll” DeploymentTarget=”WebApplication” >
<SafeControls>
<SafeControl Assembly=”ViewAllSites, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=e97e170704fd1059″ Namespace=”ViewAllSites” TypeName=”*” Safe=”True” />
</SafeControls>
</Assembly>
</Assemblies>
<RootFiles>
<RootFile Location=”ISAPI\AllSitesService.asmx”/>
<RootFile Location=”ISAPI\AllSitesServicedisco.aspx”/>
<RootFile Location=”ISAPI\AllSitesServicewsdl.aspx”/>
</RootFiles>
</Solution>

change the DeploymentTarget to WebApplication (bin folder)

Usually you have the <TemplateFiles> Tag. This starts C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE here. When applying the RootFiles you start from

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12 folder.

Finnaly make your trust level changes in the web.config if you wanna deploy to the bin folder.

<trust level=”Full” originUrl=”” />

You can insert the modification into your deployment as well. Use a web.config merge. See my post:

https://panvega.wordpress.com/2007/04/16/sharepoint-solution-deployment-merging-webconfig-content/

Now, after deploying the solution we can access the webservice adding _vti_bin/AllSitesService.asmx at our site url (for those sites we have deployed the solution to !). However, If we have deployed the solution in the GAC, the service should be able to all the sites in the server.

You can acces the Webservice for e.g. htt://moss.licwarein.com/_vti_bin/AllSitesService.asmx

In one of my next posts I am going to describe how to develope a custom SharePoint Webservice with a .disco and .wsdl file. You need this two files in order to access the SP object model library.

Good luck!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: