总结:sharepoint webservice开发常见错误

 

How to create custom sharepoint web service, you can see:

http://www.walisystems.com/articles/SPS/uplservice/v1/creating%20a%20custom%20web%20service.htm

 

1Disco.exe:

         When using the commond:  

disco http://localhost/_layouts/*.asmx

         There is an error as follow:

 

 

总结:sharepoint webservice开发常见错误_第1张图片

Reason:

In the *.asmx file,

<%@ WebService Language="C#" Class="CustomWebServiceLib.CustomWebService_GetLists" %>

 

Solution:

Change to:

<%@ WebService Language="C#" Class="CustomWebServiceLib.CustomWebService_GetLists, CustomWebServiceLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fbe2e565a3b3e37d" %>

 

2Add Web Reference:

Error message:

The document at the url

http://localhost/_vti_bin/CustomWebServices/CustomWebService_GetLists.asmx

was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'XML Schema' is 'The document format is not recognized (the content type

Screenshot:

 

 

总结:sharepoint webservice开发常见错误_第2张图片

Click “Service Description”:

 

 

总结:sharepoint webservice开发常见错误_第3张图片

Reason:

When converting *.disco to *disco.aspx and *.wsdl to *wsdl.aspx, there are some errors.

 

Solution:

You can copy the files of the system services, then rename the files;

Update the service name in the binding tags to your service name.

 

Notice:

There are two object models that can use:

 

<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)),Response.Output); %>

 

<% SPEncode.WriteHtmlEncodeWithQuote(Response, SPWeb.OriginalBaseUrl(Request), '"'); %>

 

 

你可能感兴趣的:(webservice)