web-services Questions - SharePoint Overflowmost recent 30 from http://www.sharepointoverflow.com2010-09-08T21:30:24Zhttp://www.sharepointoverflow.com/feeds/tag/web-serviceshttp://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://www.sharepointoverflow.com/questions/4734/sharepoint-search-web-service-error-ntlm-when-called-from-httphandlerSharePoint search web service error (NTLM) when called from HttpHandlerTehOne2010-08-13T00:28:23Z2010-09-08T06:44:48Z
<p>Here is my scenario: I have a SharePoint site I am working on, and it is on one server farm. In this site, I have created an HttpHandler that uses a SharePoint search webservice that is located on a different server. So that looks something like this:</p>
<ol>
<li>SharePoint Server A, where my site lives
<ul>
<li>Has a service reference to SharePoint search web service on Server B</li>
<li>Has an http handler that uses the service reference to call the search service</li>
</ul></li>
<li>SharePoint Server B, where the search service lives</li>
</ol>
<p>My code looks like this:</p>
<pre><code>BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
QueryServiceSoapClient _queryService = new QueryServiceSoapClient(binding, new EndpointAddress("http://easearch.ea.com/_vti_bin/search.asmx"));
_queryService.ClientCredentials.Windows.AllowNtlm = true;
_queryService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
_queryService.ClientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
//_queryService.ClientCredentials.Windows.ClientCredential = new NetworkCredential("MyUsername", "MyPassword", "MyDomain"); //This is the only way it seems to work
//NetworkCredential userCredential = CredentialCache.DefaultCredentials.GetCredential(_queryService.Endpoint.ListenUri, "NTLM");
//_queryService.ClientCredentials.Windows.ClientCredential = userCredential;
string status = _queryService.Status();
</code></pre>
<p>If I use this code from a console application on my dev box, it works as expected. But when I try to use the same code from my http handler, it gives the error </p>
<blockquote>
<p>The HTTP request is unauthorized with
client authentication scheme 'Ntlm'.
The authentication header received
from the server was 'NTLM'.</p>
</blockquote>
<p>I've tried a number of different combinations of the code above and the only one that works from my HttpHandler is when I directly provide my credentials. Anyone have any ideas?</p>
<p>Thanks.</p>
http://www.sharepointoverflow.com/questions/4802/getting-a-web-service-with-powershellGetting a web service with Powershellngm2010-08-17T10:41:08Z2010-09-06T13:22:30Z
<p>I wanted to update a web application web.config via Powershell, and found <a href="http://rnowik.com/SharePoint-Powershell-SPWebConfigModification.aspx" rel="nofollow">this post</a> really helpful.</p>
<p>I'm intrigued as to how to this bit of code works, particularly the $closedMethod / MakeGenericMethod stuff.</p>
<pre><code>$method = [Microsoft.Sharepoint.Administration.SPServiceCollection].GetMethod("GetValue", [Type]::EmptyTypes)
$closedMethod = $method.MakeGenericMethod([Microsoft.SharePoint.Administration.SPWebService])
$webService = $closedMethod.Invoke($webApp.Farm.Services, [Type]::EmptyTypes)
</code></pre>
<p>Any tips?</p>
http://www.sharepointoverflow.com/questions/1715/how-to-generate-the-timezoneinformation-parameter-to-a-createworkspace-method-ofHow to generate the timeZoneInformation parameter to a CreateWorkspace method of the Meetings.asmx web service ... in javascriptdevincase2010-03-05T08:16:38Z2010-09-05T08:22:30Z
<p>I want to call the CreateWorkspace method of the Meetings web service to create a subsite but I find no simple information on how to create the timeZoneInformation parameter in javascript which according to the WSDL is not optional.</p>
<p>there are examples showing how to do it in Visual Basic:</p>
<pre><code>Dim tz As New mywss001.TimeZoneInf()
..
CreateWorkspaceResponse =
ws.CreateWorkspace(MeetingSubjectTextBox.Text, "MPS#0",
System.UInt32.Parse("1033"), tz)
</code></pre>
<p>but no examples of how to generate it in javascript.</p>
<p>According to microsoft the relevant SOAP request XML is:</p>
<pre><code> <timeZoneInformation>
<bias>int</bias>
<standardDate>
<year>unsignedShort</year>
<month>unsignedShort</month>
<dayOfWeek>unsignedShort</dayOfWeek>
<day>unsignedShort</day>
<hour>unsignedShort</hour>
<minute>unsignedShort</minute>
<second>unsignedShort</second>
<milliseconds>unsignedShort</milliseconds>
</standardDate>
<standardBias>int</standardBias>
<daylightDate>
<year>unsignedShort</year>
<month>unsignedShort</month>
<dayOfWeek>unsignedShort</dayOfWeek>
<day>unsignedShort</day>
<hour>unsignedShort</hour>
<minute>unsignedShort</minute>
<second>unsignedShort</second>
<milliseconds>unsignedShort</milliseconds>
</daylightDate>
<daylightBias>int</daylightBias>
</timeZoneInformation>
</code></pre>
<p>Does anyone know how to do this in javascript or have an example of a real SOAP request which I could work back from?</p>
http://www.sharepointoverflow.com/questions/3826/sitedata-service-some-methods-give-access-deniedSiteData service: some methods give Access DeniedMel Gerats2010-07-02T11:50:49Z2010-09-03T08:22:36Z
<p>We recently migrated some applications from SharePoint 2007 to SharePoint 2010.
The application uses the SiteData.asmx web service.</p>
<p>After the migration there are Access Denied errors, withtout any additional information.</p>
<p>The following sample code reproduces the problem:</p>
<pre><code>var service = new SiteData();
service.Url = url + "_vti_bin/sitedata.asmx";
string web;string site;string bucket;string list;string item;
service.GetURLSegments(url + "Docs/SomeDocumentLibrary/Test/testafterupdate/2007-00152-01-E.doc", out web, out bucket, out list, out item);
</code></pre>
<p>The point is to get the listId from the url. </p>
<p>The error I get is: Server was unable to process request. ---> Access is denied.</p>
<pre><code>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ConsoleApplication1.test.SiteData.GetListCollection(_sList[]& vLists) at ConsoleApplication1.Program.Main(String[] args)
</code></pre>
<p>The exact same error comes back on some of the other web methods (getlistitems, getlist, getlistcollection)</p>
<p>Other web metods do work fine (GetSiteUrl, GetSiteAndWeb)</p>
<p>The error happens when running as a farm administrator. The same error happens running on a local development machine, which makes me think it has nothing to do with user permissions.</p>
<p>Has anyone seen this error before, or managed to solve it?</p>
<p><strong>Edit:</strong></p>
<p>The error goes away when only Windows Authentication is configured. Is there a way to fully enable the old web services with claims based authentication?</p>
<p><strong>Update</strong></p>
<p>The real issue is Multiple Membership Providers not really working in a lot of situations.
We have to following issues:</p>
<ul>
<li>legacy web services do not fully work.</li>
<li>odata does not work. (http://localhost/_vti_bin/listdata.svc/List hangs indefinitly)</li>
<li>Livewriter can not connect to blog site</li>
<li>opening office documents in edit mode gives access denied, but they can actually be opened.</li>
</ul>
<p>For applications using SharePoint web services we will extend the web application and have an internal url with only Windows authentication enabled.</p>
http://www.sharepointoverflow.com/questions/2327/401-authentication-error-when-calling-openworkbook-method-of-excelservice-asmx401 authentication error when calling OpenWorkbook method of ExcelService.asmx Andy Milsark2010-04-13T19:56:06Z2010-09-01T21:22:30Z
<p>We are trying to call the Excel Services web service using SOAP with a Sharepoint/domain admin account. </p>
<p>I see 401.2 errors in the IIS logs. There is no user name specified there. We are using NTLM authentication. </p>
<p>Has anyone been able to connect to the web service and open a workbook successfully? Any ideas on my authentication woes? </p>
<p>Thank you in advance!</p>
http://www.sharepointoverflow.com/questions/4835/how-to-add-items-to-a-wiki-page-library-in-sharepoint-via-web-servicesHow to add items to a wiki page library in Sharepoint via Web Services?Omer2010-08-18T14:20:45Z2010-09-01T18:22:36Z
<p>Well, the title says it all, There is not information around about this, the only link I found related to this problem, is:</p>
<p><a href="http://sites.google.com/site/sharepointwikiuploader/" rel="nofollow">http://sites.google.com/site/sharepointwikiuploader/</a></p>
<p>and it doesn't really helps. Any clue?</p>
<p>Thanks in advance.</p>
http://www.sharepointoverflow.com/questions/5163/deploying-a-sharepoint-web-service-with-powershellDeploying a sharepoint web service with Powershellorl782010-08-31T13:56:26Z2010-08-31T15:43:18Z
<p>Is it possible to install a web service to sharepoint 2010 using powershell rather than using a solution package? I'm currently doing this via a mapped folder/ISAPI approach inside a feature but would like to script this with powershell.</p>
<p>kind regards</p>
http://www.sharepointoverflow.com/questions/5073/end-user-migration-toolsEnd User Migration ToolsChristophe2010-08-27T09:20:07Z2010-08-27T09:20:07Z
<p>Hello,</p>
<p>I am looking for a tool that would allow end users to migrate SharePoint content.</p>
<p>Mandatory:</p>
<ul>
<li>Works across ALL SharePoint platforms (2003, 2007, 2010)</li>
<li>works for document libraries and lists</li>
</ul>
<p>Nice to have:</p>
<ul>
<li>migrates history/versions</li>
<li>keeps columns/metadata values, in particular the Modified and Modified By fields.</li>
</ul>
<p>I am looking for a solution beyond copy/paste or drag'n drop.</p>
<p>Thanks for your suggestions!</p>
http://www.sharepointoverflow.com/questions/4645/dataview-consuming-webservice-that-uses-iso-8859-1-encoding-is-unable-to-displayDataView consuming webservice that uses ISO-8859-1 encoding is unable to display Norwegian charactersElinK2010-08-10T09:33:41Z2010-08-10T09:33:41Z
<p>One of our customers have made several webservices returning data from their backend systems. We need to display this data inside Sharepoint, and we would prefer to use the Dataview WebPart for this. </p>
<p>We can easilly connect to the webservice and get the data returned, but none of the Norwegian characters are displayed correctly. The webservice developers say that it should work if we use ISO-8859-1 encoding, but we haven't been able to find a place where we can tell Sharepoint or the webpart to use this encoding instead of utf8.</p>
<p>Is this possible?</p>
http://www.sharepointoverflow.com/questions/4616/how-to-trace-jar-file-execution-is-hosted-on-iis6-0-serverHow to Trace JAR file execution is hosted on IIS6.0 Server.Karthikeyan2010-08-09T08:15:49Z2010-08-09T08:32:48Z
<p>We are using few JAR files in our web-application hosted on IIS6.0 Server and those files are used in somepages, we want to trace the execution of those files (both in client and server side) however tools like httpwatch...are not helping us in this. Do we have any specific tool to trace the execution of the JAR files in IIS Environment</p>
<p>This post may not be related to this community, thanks for your patience.</p>
http://www.sharepointoverflow.com/questions/4523/web-service-authentication-with-multiple-authentication-typesWeb service authentication with multiple authentication typesEric Maurer2010-08-04T20:10:39Z2010-08-04T21:05:28Z
<p>I am trying to pull data from the list.asmx web service from a console application. I am using clams based authentication, and whenever only integrated Windows Authentiation is checked everything works fine. Whenever I also check Enable Forms Based Authentication I start getting an Acccess is denied error when I try to connect to the service. I can login successfully using FBA so I don't think the problem is caused by the FBA configuration. Does anyone have any ideas to what might be causing this?</p>
http://www.sharepointoverflow.com/questions/4305/manage-user-profile-custom-properties-using-bcsManage User Profile Custom Properties using BCSKarthikeyan2010-07-27T08:08:20Z2010-08-03T10:19:15Z
<p>We want to write a Custom Webservice to pull the User Profile Properties from SharePoint 2007 and should be able to consume the same Webservice in BCS (SharePoint 2010).</p>
<p>AIM:<br>
1. Read a User Profile Properties from a Custom Webservice <br>
2. Consume the same Webservice in BCS <br>
3. BCS properties have to be merged with AD properties for the User Profile Properties in SharePoint 2010.<br></p>
<p>Can anybody let me know how it can be done?</p>
<p><b>Update:</b><br>
I would like to follow the steps given below</p>
<ol>
<li>Create a user defined class "MissedUserProfileProperties" with various attributes</li>
<li>Override the GetList Method in BCS</li>
<li>Make an instance for UserProfileService.asmx</li>
<li>Iterate through the UserProfiles and store the required information in the List <MissedUserProfileProperties></li>
<li>Return the List<MissedUserProfileProperties></li>
<li>Configure the UserProfile in such a way that it will combine both AD & BCS</li>
</ol>
<p>Please let me know if it can be done?</p>
<p><b>Update - 2</b><br>
I have configured and populated the required information and would like to remove the BCS connection however it is throwing an exception saysing that "Operation is failed" </p>
<p><br>What would be the right way of doing this....?
<br><b>Note :</b></p>
<p>Still the properties are mapped and it is not allowing us to unmap the BCS integration, also we stopped the Full import in the middle.</p>
http://www.sharepointoverflow.com/questions/3897/server-related-problem-when-using-wcf-to-communicate-with-sharepointServer-Related problem when using WCF to communicate with sharepointdiadem2010-07-07T17:42:19Z2010-07-27T07:22:30Z
<p>I have a simple get list method for sharepoint</p>
<pre><code> /// <summary>
/// Returns a list of sharepoint lists
/// </summary>
/// <returns>A list of sharepoint lists</returns>
private string GetSharePointLists()
{
StringBuilder stringBuilder = new StringBuilder();
try
{
SharePointList.ListsSoapClient proxy = new SharePointList.ListsSoapClient();
proxy.ClientCredentials.Windows.ClientCredential = new NetworkCredential();
XmlElement lists = proxy.GetListCollection();
var q = from c in lists.ChildNodes.Cast<XmlNode>()
select new
{
DefaultViewUrl = c.Attributes["DefaultViewUrl"].Value,
Title = c.Attributes["Title"].Value
};
foreach (var x in q)
{
stringBuilder.AppendLine(string.Format("{0} http://REMOVED/{1}", x.Title, x.DefaultViewUrl.Replace(" ", "%20")));
}
}
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
return stringBuilder.ToString();
}
</code></pre>
<p>It works fine on my dev box. It used to work fine on my test machine as well. Once the test machine was rebuilt I always get this error on proxy.GetListCollection()-</p>
<p><strong>The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.</strong></p>
<p>Anyone know what's going on here and how to fix it?</p>
http://www.sharepointoverflow.com/questions/4004/run-windows-7-and-windows-server-togetherRun Windows 7 and Windows Server TogetherRichard702010-07-13T18:39:45Z2010-07-13T18:55:28Z
<p>Hi. I am running SharePoint Foundation on Windows 7 as a development platform. I have had some problems with web services not working as a data source. I was instructed to work with a server platform instead. How is this done? Can I install Windows Server on the same machine running Windows 7? Will I need to transfer VS 2010 and SharePoint designer to this server environment as well? I don’t have any back up installation media, so if I lose Windows 7, it’s gone. Can I create a virtual drive and install Windows server on it? Thank you for any help with this.</p>
<p>Richard</p>
http://www.sharepointoverflow.com/questions/3614/sharepoint-generating-hundred-of-webservice-calls-before-are-you-sure-you-wantSharepoint generating hundred of webservice calls before "'Are you sure you want to navigate away from this page" dialog showskimsagro2010-06-22T07:07:14Z2010-06-22T20:59:05Z
<p>When a user does an operation on a publishing page that would take them away
from the current page, we get the warning dialog about moving away. The thing
is that it takes for ever to show up, 20-30 seconds.</p>
<p>Using fiddler I found out that the page is making several hundred requests
against the PublishingService.asmx. Each time calling the Wait method with a
value of 100 milliseconds. </p>
<p>Is this normal ?</p>
http://www.sharepointoverflow.com/questions/3482/getlistitemsasync-to-retrieve-files-from-sharepoint-2007GetListItemsAsync to retrieve files from SharePoint 2007Zee992010-06-15T08:00:17Z2010-06-16T08:29:04Z
<p>I want to retrieve only the documents that are present inside a specific folder of a document library using GetListItemsAsync method.</p>
<p>Here is how i call it:</p>
<pre><code>sc.GetListItemsAsync("MyDocLib", null, null, null, null,
XElement.Parse(@"<QueryOptions><Folder>MyFolder</Folder></QueryOptions>"),
null);
</code></pre>
<p>The call is returning all the documents inside "MyDocLib" and not only those that are in "MyFolder".</p>
<p>How can I do that?</p>
http://www.sharepointoverflow.com/questions/3009/updatelistitems-wont-let-you-reset-field-value-to-emptyUpdateListItems won't let you reset field value to empty?AKrasheninnikov2010-05-20T16:14:30Z2010-06-16T07:09:55Z
<p>I've recently discovered that the Lists.asmx ignores your attempts to reset a field's value to empty string or null with Lists.UpdateListItems. Not a very well documented limitation discovered by trial and error. </p>
<p>Can someone advise on the possibility to reset field values using FP RPC / OWSAPI from AJAXy pages? Or am I missing something in the OOTB web service functionality / CAML syntax? I mean without deploying a custom Web Service just for that little generic task?</p>
http://www.sharepointoverflow.com/questions/3382/calling-a-web-service-under-the-wss-virtual-directory-gets-401-unauthorizedCalling a web service under the WSS virtual directory gets 401 unauthorizedMike Polen2010-06-09T17:39:24Z2010-06-09T21:18:28Z
<p>I have a simple web service that is in a virtual directory under a WSS 3.0 web app virtual directory. If I log on to the box and use IE to execute the web service it works. If I write a web part it fails with:</p>
<pre><code>The request failed with HTTP status 401: Unauthorized
</code></pre>
<p>The really strange thing is that it works in production, but not the new test server! I have looked at both web.configs and IIS settings and see no differences. Both boxes are running Server08, IIS7 and WSS 3.0 (12.0.0.6421).</p>
<p>Any ideas?</p>
http://www.sharepointoverflow.com/questions/3276/how-to-update-a-list-item-from-web-service-using-a-where-clauseHow to update a list item from web service using a where clause?JL2010-06-03T16:00:24Z2010-06-07T09:09:45Z
<p>I have a scenario where I need to update a list item, but I don't know the internal ID of the list item - hence the following won't work for me:</p>
<pre><code>batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" +
"<Field Name='ID'>" + id + "</Field>" +
"<Field Name='DeliveryStatus'>" + newStatus.ToString() + "</Field></Method>";
</code></pre>
<p>Instead I have another field in the list called ProcessID:</p>
<p>So I would like to update the delivery status where ProcessID = X</p>
<p>Is this possible using SharePoint web services. </p>
<p>One solution I was thinking of is to first do a select for the ID based on the ProcessID - then update based on this ID, but this seems like a crazy solution, surely the inventors of MOSS CAML would have provided a way to update a list item by some means of a where clause, or using another field for filtration rather than just plain old ID?</p>
<p>Thanks</p>
http://www.sharepointoverflow.com/questions/3277/good-book-about-sharepoint-web-servicesGood book about sharepoint web services?JL2010-06-03T16:06:14Z2010-06-03T18:54:05Z
<p>I'll be frank the MS documentation for MS web services is terrible / non existent. Do any books exist or web sites that provide full detailed documentation of the usage of SharePoint exposed web services?</p>
http://www.sharepointoverflow.com/questions/3131/how-come-getlistitems-filtering-on-a-fields-equality-to-a-value-fetches-this-fieHow come GetListItems filtering on a field's equality to a value fetches this field's value as undefined/nullAKrasheninnikov2010-05-26T14:34:30Z2010-06-02T15:40:27Z
<p>Hi guys. I think I found a bug. Please share if you know more about it.</p>
<p>I use GetListItems operation to fetch items to display on an ajaxified form. Just an hour ago everything was fine, but now when I query the list with </p>
<pre><code><Eq><FieldRef Name='Some/Field'><Value Type='Lookup'>Value</Value></Eq>
</code></pre>
<p>The relevant items show up in the result set. But the values for 'Some/Field' (yes there is a slash in the displayname) are displayed as null. The field was never renamed.</p>
<p>What is it? How can I fix?</p>
http://www.sharepointoverflow.com/questions/2684/can-you-detect-permissions-on-a-list-via-ajax-or-sharepoint-web-servicesCan you detect permissions on a list via Ajax or SharePoint web services?AKrasheninnikov2010-05-06T08:56:24Z2010-05-22T11:08:34Z
<p>The context for this is the SPServices or Imtech (SP)LookupAddNew function that let you add new items to lookups without navigating to the target list. </p>
<p>Can we avoid adding the link for users without the permission to add items to the target list?</p>
http://www.sharepointoverflow.com/questions/2868/listing-all-checked-out-filesListing all checked out files Kasper Bo Larsen2010-05-14T10:19:05Z2010-05-14T19:00:00Z
<p>As a site administrator tool I have to list all checked out files in the site collection. Looking at the DB is looks like the tp_CheckoutUserId field in AllUserData might be a key to this query.</p>
<p>Is it possible to get this information through the web services or will I have to use the object model?</p>
<p>Update: It seems like the customer would like to be able to list just those files that have been checked out (not necessary modified) by a specific user. Onless the query takes several minutes it should be a realtime query, but the site collection consist of +10 000 web with 3 document libraries on each web so performance might be an issue. </p>
http://www.sharepointoverflow.com/questions/1752/how-to-identify-the-question-fields-when-fetching-survey-information-from-the-lisHow to identify the question fields when fetching survey information from the Lists web service?paul2010-03-08T16:36:45Z2010-05-04T12:22:34Z
<p>I am wanting to access survey information via the Lists web service and display the questions contained in the survey.</p>
<p>The result contains a large number of <strong>Field</strong> nodes some of which are the questions in the survey. The other fields contain other information such as author, last changed etc.</p>
<p>How can I pick out the questions? I had thought that all non-questions would be hidden but this is not the case.</p>
<p>Here is my code as it is at the moment. It returns about 16 items. The survey has 6 questions...</p>
<pre><code>// read question definitions
string[] HandleTypes = new string[] { "Number", "DateTime", "Text", "Choice", "GridChoice", "Boolean" };
var query = from n in node.Descendants(ns+"Field")
where (n.Attribute("Hidden") == null || n.Attribute("Hidden").Value.ToLower() == "true")
&& (n.Attribute("Type") != null && HandleTypes.Contains(n.Attribute("Type").Value))
select new Question(n.Attribute("ID").Value)
{
Text = n.Attribute("DisplayName").Value,
QuestionType = n.Attribute("Type").Value,
Element = n
};
</code></pre>
<p>Ideas anyone?</p>
http://www.sharepointoverflow.com/questions/2019/search-query-unable-to-contact-the-search-web-service-in-standard-sharepoint"Search query unable to contact the Search web service" - in standard SharePoint search resultsAKrasheninnikov2010-03-24T12:51:03Z2010-04-08T06:34:24Z
<p>What could that message stem from? Any quick tips to diagnose?</p>
<p>Single server farm, remote SQL. IT guys in another location, I have no VPN for access to SCAW (Central Administration Web) .</p>
http://www.sharepointoverflow.com/questions/1634/best-practice-for-developing-a-webservice-in-sharepointBest practice for developing a WebService in SharePoint?Stef2010-02-25T15:36:39Z2010-03-29T12:11:58Z
<p>Hi all, <br>I've followed the following steps to build a WebService in SharePoint:</p>
<ol>
<li>Created a new project using WSPBuilder.</li>
<li>Added a 'WebService' (Add a new web service to the layouts folder)</li>
<li>Do a WSBBuilder "Deploy"</li>
<li>The WebService is accessible via <a href="http://server/_layouts/MyWebService.asmx" rel="nofollow">http://server/_layouts/MyWebService.asmx</a></li>
</ol>
<p>Is this correct ? Or should I follow the steps described at <a href="http://msdn.microsoft.com/en-us/library/ms464040.aspx" rel="nofollow">MSDN</a> to create my own <strong>.wsdl</strong> / <strong>.disco</strong> files and deploy them to <strong>/_vti_bin</strong> to make my WebService accessible via <a href="http://server/_vti_bin/MyWebService.asmx" rel="nofollow">http://server/_vti_bin/MyWebService.asmx</a> ? <br>(Note : the manual steps from MSDN can be automated using <a href="http://www.crsw.com/spdev/Wiki%20Pages/GenWS.aspx" rel="nofollow">SPDev</a>.</p>
<p><br/>I also found this blog :
<a href="http://jamestsai.net/Blog/post/Where-do-you-deploy-custom-SharePoint-web-service-files-to-%28asmx-discoaspx-and-wsdlaspx%29.aspx" rel="nofollow">http://jamestsai.net/Blog/post/Where-do-you-deploy-custom-SharePoint-web-service-files-to-%28asmx-discoaspx-and-wsdlaspx%29.aspx</a> which describes the difference between _layouts and _vti_bin.</p>
<p><br>
<strong>Question</strong><br/>
What's the best way to follow ?<br>And how can this be automated via the build in VS2008 or during deployment from the WSP ?</p>
http://www.sharepointoverflow.com/questions/1940/is-there-any-rule-that-says-when-soapaction-is-required-in-the-setrequestheaderIs there any rule that says when SOAPAction is REQUIRED in the setRequestHeader?Marc D Anderson2010-03-17T16:27:23Z2010-03-19T03:33:17Z
<p>Is there any rule that says when SOAPAction is REQUIRED in the setRequestHeader?</p>
<p>In my jQuery library (<a href="http://spservices.codeplex.com/" rel="nofollow">SPServices</a>), I've been including the SOAPAction for every Web Service call. It turns out that is what is preventing anonymous access to the Web Services to work. When I remove SOAPAction entirely and I AM logged in, some calls fail with the following error:</p>
<pre><code>errorstring: The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
errorcode: 0x8102006d
</code></pre>
<p>I suppose that it could be as simple as operations which read vs. operations which write, but I figured I'd toss it out there for ideas.</p>
<p>M.</p>
<p>UPDATE: <a href="http://twitter.com/cwheeler76" rel="nofollow">@cwheeler76</a> pointed out this article from Jan Tielens:
<a href="http://weblogs.asp.net/jan/archive/2009/05/25/quot-the-security-validation-for-this-page-is-invalid-quot-when-calling-the-sharepoint-web-services.aspx" rel="nofollow">The security validation for this page is invalid" when calling the SharePoint Web Services</a>. It also describes the problem and the solution using SOAPAction. I'm looking for more the 'when' as opposed to the 'how'.</p>
http://www.sharepointoverflow.com/questions/1917/calling-a-custom-sharepoint-web-service-from-asp-net-ajax-gives-a-403-errorCalling a custom SharePoint web service from ASP.Net AJAX gives a 403 error?Greg Hurlman2010-03-16T15:11:46Z2010-03-17T22:34:05Z
<p>I have developed a custom SharePoint web service, and deployed it to /_vti_bin/myservice.asmx. As a "regular" user, browsing to that ASMX URL works fine. When I try to browse to "/_vti_bin/myservice.asmx/js" as required to call this service from ASP.Net AJAX, I get a 403. If I browse to it as no less than a farm admin (site collection admin doesn't work), I get a 403. It is entirely possible that the farm admin's role as a local server admin is also allowing it to work.</p>
<p>This is my web service class:</p>
<pre><code>[WebService(Namespace = "http://sharepointservices.genericnamespace.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class ApprovalSvc : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
public XmlDocument GetInboxItems(string inboxName, string s_Id)
{
// code removed
}
}
</code></pre>
<p>This is the art of my web part code where I am hooking up the ASP.Net AJAX stuff:</p>
<pre><code>ScriptManager scriptMgr = new ScriptManager();
string webUrl = SPContext.Current.Web.Url;
ServiceReference srvRef = new ServiceReference(webUrl + "/_vti_bin/ApprovalSvc.asmx");
scriptMgr.Services.Add(srvRef);
this.Controls.Add(scriptMgr);
</code></pre>
<p>If I'm logged in as a farm/server admin, it works. Otherwise, no. The web service assembly is listed in SafeControls. Any ideas?</p>
http://www.sharepointoverflow.com/questions/1708/addlist-method-in-http-postAddList method in Http Postpclem2010-03-04T18:46:23Z2010-03-11T13:44:01Z
<p>In a remote client, I'm trying to create a new list in a sharepoint site. Right now, I'm building a CAML string and sending it via http post to my sharepoint site. I've used this method to update list items and create dws folders, but I can't seem to get AddList to work. I get an error "Remove server returned error:NotFound."</p>
<p>Any ideas? I'm pretty certain it's not an authentication issue since I've used the exact same method in this same program to do the previously mentioned functions. The sharepoint site I'm adding the list to is a test site in which I have full read/write capabilities.</p>
<p>here is my CAML:</p>
<pre><code> string soapEnv =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance"+
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"+
"<soap:Body>" +
"<AddList xmlns=\"http://schemas.microsoft.com/sharepoint/soap\">"+
"<listName>" + listName + "</listName>" +
"<description>" + "A Test list" + "</description>" +
"<templateID>100</templateID>" +
"</AddList>" +
"</soap:Body>" +
"</soap:Envelope>";
return soapEnv;
</code></pre>
<p>I send this in an http Post with these settings:</p>
<pre><code> uri = "[my sharepoint site]/_vti_bin/lists.asmx";
WebClient client = new WebClient();
client.Headers["SOAPAction"] = "http://schemas.microsoft.com/sharepoint/soap/";
client.Headers["content-type"] = "text/xml; charset=utf-8";
client.Encoding = Encoding.UTF8;
client.UploadStringCompleted += UploadStringCompleted;
try
{
client.UploadStringAsync(new Uri(uri, UriKind.Absolute), "POST", CAML);
}
catch (Exception ex)
{
MessageBox.Show("Error in upload string async: " + ex.Message);
}
</code></pre>
http://www.sharepointoverflow.com/questions/1797/problems-with-web-service-getlist-list-not-foundProblems with web service GetList. List not found!paul2010-03-10T08:57:42Z2010-03-10T09:04:48Z
<p>I'm have some trouble using the GetList web service. It does work sometimes but not at the start of the day!?!</p>
<p>Here is my code:</p>
<pre><code> public static void ListSurveys(string serverName)
{
EndpointAddress endpoint = new EndpointAddress(serverName + SERVICE_SITEDATA_URL);
SiteDataSoapClient client = new SiteDataSoapClient("SiteDataSoap", endpoint);
_sList[] lists;
uint count = client.GetListCollection(out lists);
foreach (_sList list in lists)
{
if (list.BaseType == "Survey")
{
System.Console.WriteLine(list.Title + ", " + list.InternalName);
_sListMetadata meta;
_sProperty[] props;
uint glc = client.GetList(list.InternalName, out meta, out props);
System.Console.WriteLine(meta.Title);
}
}
}
</code></pre>
<p>As you can see, I fetch all the lists using <strong>GetListCollection</strong> and then, if it is a survey, I try to get the List information using GetList. I use the List GUID as the list name. An exception is thrown. The SOAP body is shown below.</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Eine Ausnahme vom Typ Microsoft.SharePoint.SoapServer.SoapServerException wurde ausgelöst.</faultstring>
<detail>
<errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
Die Liste ist nicht vorhanden.
Die ausgewählte Seite enthält eine Liste, die nicht vorhanden ist. Die Liste könnte von einem anderen Benutzer gelöscht worden sein.
</errorstring>
<errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
</code></pre>
<p>The error message says that the list was not found and might have been deleted by someone else. This is strange because my code had fetched the GUID of the list just milliseconds earlier!</p>
<p>Can anyone explain what is going on here? I had the same problem yesterday and at some point it just went away. Unfortunately it came back this morning.</p>
<p><strong>UPDATE</strong>
As I was writing the question I had an idea. I visited the survey overview page and tried the webservice again. It worked!! Going to the list of surveys page was not enough - I had to go to the overview page itself. Seems the lists need to be 'woken up' each morning. Is this a bug?</p>