web-services Questions - SharePoint Overflow most recent 30 from http://www.sharepointoverflow.com 2010-09-08T21:30:24Z http://www.sharepointoverflow.com/feeds/tag/web-services http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://www.sharepointoverflow.com/questions/4734/sharepoint-search-web-service-error-ntlm-when-called-from-httphandler SharePoint search web service error (NTLM) when called from HttpHandler TehOne 2010-08-13T00:28:23Z 2010-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-powershell Getting a web service with Powershell ngm 2010-08-17T10:41:08Z 2010-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-of How to generate the timeZoneInformation parameter to a CreateWorkspace method of the Meetings.asmx web service ... in javascript devincase 2010-03-05T08:16:38Z 2010-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> &lt;timeZoneInformation&gt; &lt;bias&gt;int&lt;/bias&gt; &lt;standardDate&gt; &lt;year&gt;unsignedShort&lt;/year&gt; &lt;month&gt;unsignedShort&lt;/month&gt; &lt;dayOfWeek&gt;unsignedShort&lt;/dayOfWeek&gt; &lt;day&gt;unsignedShort&lt;/day&gt; &lt;hour&gt;unsignedShort&lt;/hour&gt; &lt;minute&gt;unsignedShort&lt;/minute&gt; &lt;second&gt;unsignedShort&lt;/second&gt; &lt;milliseconds&gt;unsignedShort&lt;/milliseconds&gt; &lt;/standardDate&gt; &lt;standardBias&gt;int&lt;/standardBias&gt; &lt;daylightDate&gt; &lt;year&gt;unsignedShort&lt;/year&gt; &lt;month&gt;unsignedShort&lt;/month&gt; &lt;dayOfWeek&gt;unsignedShort&lt;/dayOfWeek&gt; &lt;day&gt;unsignedShort&lt;/day&gt; &lt;hour&gt;unsignedShort&lt;/hour&gt; &lt;minute&gt;unsignedShort&lt;/minute&gt; &lt;second&gt;unsignedShort&lt;/second&gt; &lt;milliseconds&gt;unsignedShort&lt;/milliseconds&gt; &lt;/daylightDate&gt; &lt;daylightBias&gt;int&lt;/daylightBias&gt; &lt;/timeZoneInformation&gt; </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-denied SiteData service: some methods give Access Denied Mel Gerats 2010-07-02T11:50:49Z 2010-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. ---&gt; 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[]&amp; 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-asmx 401 authentication error when calling OpenWorkbook method of ExcelService.asmx Andy Milsark 2010-04-13T19:56:06Z 2010-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-services How to add items to a wiki page library in Sharepoint via Web Services? Omer 2010-08-18T14:20:45Z 2010-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-powershell Deploying a sharepoint web service with Powershell orl78 2010-08-31T13:56:26Z 2010-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-tools End User Migration Tools Christophe 2010-08-27T09:20:07Z 2010-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-display DataView consuming webservice that uses ISO-8859-1 encoding is unable to display Norwegian characters ElinK 2010-08-10T09:33:41Z 2010-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-server How to Trace JAR file execution is hosted on IIS6.0 Server. Karthikeyan 2010-08-09T08:15:49Z 2010-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-types Web service authentication with multiple authentication types Eric Maurer 2010-08-04T20:10:39Z 2010-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-bcs Manage User Profile Custom Properties using BCS Karthikeyan 2010-07-27T08:08:20Z 2010-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 &lt;MissedUserProfileProperties&gt;</li> <li>Return the List&lt;MissedUserProfileProperties&gt;</li> <li>Configure the UserProfile in such a way that it will combine both AD &amp; 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-sharepoint Server-Related problem when using WCF to communicate with sharepoint diadem 2010-07-07T17:42:19Z 2010-07-27T07:22:30Z <p>I have a simple get list method for sharepoint</p> <pre><code> /// &lt;summary&gt; /// Returns a list of sharepoint lists /// &lt;/summary&gt; /// &lt;returns&gt;A list of sharepoint lists&lt;/returns&gt; 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&lt;XmlNode&gt;() 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-together Run Windows 7 and Windows Server Together Richard70 2010-07-13T18:39:45Z 2010-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-want Sharepoint generating hundred of webservice calls before "'Are you sure you want to navigate away from this page" dialog shows kimsagro 2010-06-22T07:07:14Z 2010-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-2007 GetListItemsAsync to retrieve files from SharePoint 2007 Zee99 2010-06-15T08:00:17Z 2010-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(@"&lt;QueryOptions&gt;&lt;Folder&gt;MyFolder&lt;/Folder&gt;&lt;/QueryOptions&gt;"), 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-empty UpdateListItems won't let you reset field value to empty? AKrasheninnikov 2010-05-20T16:14:30Z 2010-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-unauthorized Calling a web service under the WSS virtual directory gets 401 unauthorized Mike Polen 2010-06-09T17:39:24Z 2010-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-clause How to update a list item from web service using a where clause? JL 2010-06-03T16:00:24Z 2010-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 = "&lt;Method ID='1' Cmd='Update'&gt;" + "&lt;Field Name='ID'&gt;" + id + "&lt;/Field&gt;" + "&lt;Field Name='DeliveryStatus'&gt;" + newStatus.ToString() + "&lt;/Field&gt;&lt;/Method&gt;"; </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-services Good book about sharepoint web services? JL 2010-06-03T16:06:14Z 2010-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-fie How come GetListItems filtering on a field's equality to a value fetches this field's value as undefined/null AKrasheninnikov 2010-05-26T14:34:30Z 2010-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>&lt;Eq&gt;&lt;FieldRef Name='Some/Field'&gt;&lt;Value Type='Lookup'&gt;Value&lt;/Value&gt;&lt;/Eq&gt; </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-services Can you detect permissions on a list via Ajax or SharePoint web services? AKrasheninnikov 2010-05-06T08:56:24Z 2010-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-files Listing all checked out files Kasper Bo Larsen 2010-05-14T10:19:05Z 2010-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-lis How to identify the question fields when fetching survey information from the Lists web service? paul 2010-03-08T16:36:45Z 2010-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") &amp;&amp; (n.Attribute("Type") != null &amp;&amp; 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 results AKrasheninnikov 2010-03-24T12:51:03Z 2010-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-sharepoint Best practice for developing a WebService in SharePoint? Stef 2010-02-25T15:36:39Z 2010-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-setrequestheader Is there any rule that says when SOAPAction is REQUIRED in the setRequestHeader? Marc D Anderson 2010-03-17T16:27:23Z 2010-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-error Calling a custom SharePoint web service from ASP.Net AJAX gives a 403 error? Greg Hurlman 2010-03-16T15:11:46Z 2010-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-post AddList method in Http Post pclem 2010-03-04T18:46:23Z 2010-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 = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" + "&lt;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/\"&gt;"+ "&lt;soap:Body&gt;" + "&lt;AddList xmlns=\"http://schemas.microsoft.com/sharepoint/soap\"&gt;"+ "&lt;listName&gt;" + listName + "&lt;/listName&gt;" + "&lt;description&gt;" + "A Test list" + "&lt;/description&gt;" + "&lt;templateID&gt;100&lt;/templateID&gt;" + "&lt;/AddList&gt;" + "&lt;/soap:Body&gt;" + "&lt;/soap:Envelope&gt;"; 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-found Problems with web service GetList. List not found! paul 2010-03-10T08:57:42Z 2010-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>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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"&gt; &lt;soap:Body&gt; &lt;soap:Fault&gt; &lt;faultcode&gt;soap:Server&lt;/faultcode&gt; &lt;faultstring&gt;Eine Ausnahme vom Typ Microsoft.SharePoint.SoapServer.SoapServerException wurde ausgelöst.&lt;/faultstring&gt; &lt;detail&gt; &lt;errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt; 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. &lt;/errorstring&gt; &lt;errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;0x82000006&lt;/errorcode&gt; &lt;/detail&gt; &lt;/soap:Fault&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </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>