Custom Web Servic In MOSS 2007
Tools: Visual Studio 2008,Visual Studio 2008 Command Prompt, Sharepoint Server 2007
- Generate .disco and .wsdl files through Visual Studio 2008 Command Prompt in Visual Studio Tools
Run command:
Disco http://sp2007:14908/_vti_bin/PSWebService.asmx
<%@ WebService Language="C#" Class="NameSpace.PSWebService, NameSpace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c8763d1ab14ce97" %>
Error occurred as below.
Solution: Please move PSWebService.asmx into layouts folder and try it again. It works fine. Correct screen is as below.
Two files(pswebservice.disco and pswebservice.wsdl) are stored in the path ‘C:\Temp\aa’
Note: You have to rename these two files(pswebservicedisco.aspx and pswebservicewsdl.aspx). You have to move these three files into ISAPI folder. The structure is below.
- These two files are not able to use and you have to change parts of content.
For pswebservicedisco.aspx, substitute below original for current code
Original Code 1:
<?xml version="1.0" encoding="utf-8"?> |
Current Code 1:
<%@ Page Language="C#" Inherits="System.Web.UI.Page" %> <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint.Utilities" %> <%@ Import Namespace="Microsoft.SharePoint" %> <% Response.ContentType = "text/xml"; %> |
Original Code 2:
<contractRef ref="http://sp2007:14908/_layouts/pswebservice.asmx?wsdl" docRef="http://sp2007:14908/_layouts/pswebservice.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" /> <soap address="http://sp2007:14908/_layouts/pswebservice.asmx" xmlns:q1="http://tempuri.org/" binding="q1:PSWebServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> <soap address="http://sp2007:14908/_layouts/pswebservice.asmx" xmlns:q2="http://tempuri.org/" binding="q2:PSWebServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> |
Current Code 2:
<contractRef ref=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request) + "?wsdl"),Response.Output); %> docRef=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %> xmlns="http://schemas.xmlsoap.org/disco/scl/" /> <soap address=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %> xmlns:q1="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" binding="q1: PSWebServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> <soap address=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %> xmlns:q2="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" binding="q2:PSWebServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> |
Note: You are able to copy current code from alertsdisco file below.
For pswebservicewsdl.aspx, substitute below original for current code
Original Code 1:
<?xml version="1.0" encoding="utf-8"?> |
Current Code 1:
<%@ Page Language="C#" Inherits="System.Web.UI.Page" %> <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint.Utilities" %> <%@ Import Namespace="Microsoft.SharePoint" %> <% Response.ContentType = "text/xml"; %> |
Original Code 2:
<soap:address location="http://sp2007:14908/_layouts/pswebservice.asmx" /> |
Current Code 2:
<soap:address location=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %> /> |
Original Code 3:
<soap12:address location="http://sp2007:14908/_layouts/pswebservice.asmx" /> |
Current Code 3:
<soap12:address location=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %> /> |
Note: You are able to copy current code from alertswsdl file below.
Then you are able to deploy pswebservice web service, once done. You have to modify spdisco.aspx file that is located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\ISAPI and add the following code, specifying the .asmx file for your Web service.
<contractRef ref=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/AWebService/PSWebService.asmx?wsdl"), Response.Output); %> docRef=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/AWebService/PSWebService.asmx"), Response.Output); %> xmlns=" http://schemas.xmlsoap.org/disco/scl/ " /> <discoveryRef ref=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/AWebService/PSWebService.asmx?disco"),Response.Output); %> xmlns="http://schemas.xmlsoap.org/disco/" /> |
Your web service is able to be used till now.
Custom Web Servic In MOSS 2007的更多相关文章
- Create and Install Timer Job in MOSS 2007
Excute Timerjob public class TriggerLoadCacheTimerJob : SPJobDefinition { string ExceptionFlag = str ...
- sharepoint custom web service
创建自定义 ASP.NET Web 服务 http://msdn.microsoft.com/zh-cn/library/ms464040.aspx
- Web Servic和Web API的区别
Web Service:1.它是基于SOAP协议的,数据格式是XML2.只支持HTTP协议3.它不是开源的,但可以被任意一个了解XML的人使用4.它只能部署在IIS上Web API:1.这是一个简单的 ...
- How to upgrade workflow assembly in MOSS 2007
This problem generally start when you are having an existing custom workflow and there are instances ...
- MOSS 2007 错误0x80040E14解决
今天公司内网莫名的出现错误,只能新建列表条目,不能创建网站,到后来列表条目也不能创建了,一直报0x80040E14错误.于是Google一把,搜索这个错误号,然后在apearce 的Blog找到了原因 ...
- SharePoint 2007 页面定制(一)
转:http://www.nanmu.net/SharePoint-MOSS-WSS-Silverlight/Lists/Posts/Post.aspx?ID=74 本文主要包括以下几方面内容: 1. ...
- Add custom and listview web part to a page in wiki page using powershell
As we know, Adding list view web part is different from custom web part using powershell, what's mor ...
- Developing a Custom Membership Provider from the scratch, and using it in the FBA (Form Based Authentication) in SharePoint 2010
//http://blog.sharedove.com/adisjugo/index.php/2011/01/05/writing-a-custom-membership-provider-and-u ...
- SharePoint每日小贴士Web部件
SharePoint每日小贴士Web部件 项目描写叙述 此Web部件从指定SP自己定义列表或一个选定的 RSS源选择一个随机项目.并显示一张图片.标题和一个Tip. 适 ...
随机推荐
- [课程设计]Scrum 3.8 多鱼点餐系统开发进度(留言反馈系统设计)
Scrum 3.8 多鱼点餐系统开发进度(留言反馈系统设计) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统 ...
- sql的各种join连接
SELECT * FROM TableA INNER JOIN TableB ON TableA.name = TableB.name id name id name -- ---- -- ---- ...
- [JAVA] java class 基本定义 Note
java class 基本定义 Note 1 package abeen.note; 2 import java.util.*; 3 4 5 /* 6 java calss 基本 7 */ 8 pub ...
- JAVA中用堆和栈的概念来理解equals() "=="和hashcode()
在学习java基本数据类型和复杂数据类型的时候,特别是equals()"=="和hashcode()部分时,不是很懂,也停留了很长时间,最后终于有点眉目了. 要理解equals() ...
- Excel通过身份证获取出生年月,性别,年龄,生肖,星座,省份等信息总结归纳
Excel通过身份证获取出生年月,性别,年龄,生肖,星座,省份等信息总结归纳 早期的身份证号码为15位数字,现在使用的身份证号码为18位数字,它们的含义如下:(1)15位:1-6位为地区代码,7-8位 ...
- .net面试题集锦
1. 简述 private. protected. public. internal 修饰符的访问权限. 答 . private : 私有成员, 在类的内部才可以访问. protected : 保护成 ...
- 关于freemaker的一点使用技巧
在做国泰君安2016年中秋送电影票活动中,需要做这样一个手机页面,展示所有中奖用户的中奖信息.如下图: 要求对用户的后记号码中间5位做隐藏处理.最开始的处理方法是在对用户实体的get()方法做处理 / ...
- 1. ReactNative 基础
/** 1. reactNative 反应式语言 2. 既拥有原生的用户体验,又保留React的开发效率 3. FaceBook研究 H5,Android,iOS 4. BAT的插件化,热修改 2 ...
- Qt设计师学习笔记--Sharping-Changing Dialogs
1.pushbutton->default属性为true,按回车相当于点击该按钮. 2.选中checkable后,Button变成切换按钮(toggle button),可以有两种状态:按下/弹 ...
- 测试oracle数据库的脱机备份和恢复
环境:windows7.Oracle11g 一.脱机备份 脱机备份是指在数据库关闭情况下的数据备份,也称为冷备份. 在书上学到的备份步骤: 1.记录所要备份数据库文件所在的操作系统路径: 2.关闭数据 ...