开发者

Create a VirtualPath in IIS for hosting a Web Service in SharePoint

开发者 https://www.devze.com 2023-02-07 19:27 出处:网络
I am trying to host a custom web service in SharePoint 2007 (WSS 3.0) and so far I have followed the instructions here to create a simple \'Hello World\' web service: Create WSS Web Service

I am trying to host a custom web service in SharePoint 2007 (WSS 3.0) and so far I have followed the instructions here to create a simple 'Hello World' web service: Create WSS Web Service

However, when i get to the virtual path bit in step 4 I am struggling to see in visual studio how I create this and then deploy to make a virtual pa开发者_JAVA百科th to make my web service accessible.

Can anyone help me sort out creating a virtual path for WSS or point me in the direction of another guide to create and host a web service in SharePoint?

Thanks in advance...


You need to register the module in the web.config under configuration/system.web/httpModules.

      <add name="ArbitraryName" type="Namespace.ClassName, AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXX" />

Then you can put it in any directory you'd like. If you're using WSS 3.0 check to see if the previous virtual path provider has a name of "SPVirtualPathProvider". If you're using MOSS 2007 check to see if it has a name of "CmsVirtualPathProvider".

Daniel Larson does a decent job of walking you through it in Chapter 11 in his book Developing Service-Oriented AJAX Applications on the Microsoft Platform.

The best way to do this is normally a FeatureEventReceiver using the SPConfigModification class. This way it pushes out to all the servers in your farm.


You can host a web service in a _layouts folder for example. Just create some folder there (like "MyService"), put your .asmx, then put your web service .dll in GAC (don't use code behind). Restart IIS and you service would be available at http:///_layouts/MyService/.asmx.

0

精彩评论

暂无评论...
验证码 换一张
取 消