First let me tell you that in order to use the list's web service in a subsite you have to add ?WSDL to the URI of the web service. Example: http://server/subsite/_vti_bin/Lists.asmx?WSDL. If you do not append ?WSDL you will not receive any error, but will operate with the web service of the top level site instead of the subsite and you will not find your list in the subsite. We will use a Contacts List template to save our contacts. It let us to synchronize with MS Outlook 2007 in order to view these contacts in out Address Book. You can see a method to accomplish it: { PCM.Lists list = new PCM.Lists(); list.Credentials = new System.Net.NetworkCredential("user", "P@$$w0rd"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); elBatch.SetAttribute("OnError", "Continue"); elBatch.SetAttribute("ListVersion", "1"); el1.SetAttribute("ID", "1"); el1.SetAttribute("Cmd", "New"); field1.SetAttribute("Name", "Company"); field1.InnerText = company; field2.SetAttribute("Name", "WorkAddress"); field2.InnerText = address; field3.SetAttribute("Name", "FirstName"); field3.InnerText = name; field4.SetAttribute("Name", "Title"); field4.InnerText = surname; field5.SetAttribute("Name", "Email"); field5.InnerText = email; field6.SetAttribute("Name", "WorkPhone"); field6.InnerText = phone; field7.SetAttribute("Name", "WorkCountry"); field7.InnerText = language; elBatch.AppendChild(el1); el1.AppendChild(field1); el1.AppendChild(field2); el1.AppendChild(field3); el1.AppendChild(field4); el1.AppendChild(field5); el1.AppendChild(field6); el1.AppendChild(field7); } Note: PCM is a Web Reference to our Lists.asmx web services. Now you may synchronize the list with Outlook. Related Links:
static
bool insertContact(string company, string address, string name, string surname, string email, string phone, string language)
XmlElement elBatch = doc.CreateElement("Batch");
XmlElement el1 = doc.CreateElement("Method");
XmlElement field1 = doc.CreateElement("Field");
XmlElement field2 = doc.CreateElement("Field");
XmlElement field3 = doc.CreateElement("Field");
XmlElement field4 = doc.CreateElement("Field");
XmlElement field5 = doc.CreateElement("Field");
XmlElement field6 = doc.CreateElement("Field");
XmlElement field7 = doc.CreateElement("Field");
XmlNode rNode = list.UpdateListItems("Contacts", elBatch);
return
true;
http://shlakapau.spaces.live.com/blog/cns!72ADBFE6717AFAF!107.entry
Saturday, March 31, 2007
Inserting a contact item in a Contacts Lists in a subsite through the UpdateListItems web service
Publicado por Àlex en 8:34 PM 0 comentarios
Thursday, March 29, 2007
KB932091 crashed my MOSS 2007
After an automatic update of WSS 3.0 my MOSS 2007 server crashed. I see these messages in my event viewer: The message about the result of the installation was: Product: Microsoft Windows SharePoint Services 3.0 - Update 'Update for Microsoft WSS 3.0 (KB932091)' installed successfully. The update cannot be started because the content sources cannot be accessed. Fix the errors and try the update again. I solve it resetting the IIS.
Publicado por Àlex en 7:25 AM 1 comentarios
Wednesday, March 21, 2007
SharePoint designer opens my site as a Web Site
It happens when you disable the Client Integation (Central Administration > Application Management > Authentication Providers > Edit Authentication). Then the site is opened as a normal web site and you cannot work with the SharePoint site properly.
Publicado por Àlex en 7:00 AM 0 comentarios
Tuesday, March 20, 2007
Forms Server and the anonymous users
What would you do to enable forms server to unauthenticated users? When I have finished my form and tested it as anonymous user (as an authenticated user all works fine) I get an error when I submitted the form. My first idea was to follow the steps to enable the anonymous access to a list and submit my forms to this Document Library. But in SharePoint 2007 I could not grant access to lists to anonymous users. The only exception is the Surveys Lists (see the post in this blog). The solution that I adopted was to change the submit option of my form. I published a web service that process the form and insert the form in a XML field on my database. If you want to save the form to a Document Library and avoid the database you can use the this web service or if you prefer you can store each field in a column of a Custom List extracting the fields of the form and insert in the list through the UpdateList web service published out-of-the-box by WSS 3.0 I also tried the solution exposed in post but it didn't work for me. Related Links:
http://www.developer.com/services/article.php/3492456 (Web Service to process an InfoPath form)
http://support.microsoft.com/kb/927082/en-us (Enable anonymous access to a list)
http://www.sharepointblogs.com/ssa/archive/2006/11/30/16508.aspx (Upload files through web service)
http://jopx.blogspot.com/2006/08/using-webservices-in-browser-enabled.html (Forms Server)
http://weblog.vb-tech.com/nick/archive/2006/02/24/1453.aspx (WSS web services)
http://benreichelt.net/blog/2006/3/25/Insert-a-Sharepoint-list-item-from-web-services/ (Insert an item)
Publicado por Àlex en 2:04 PM 0 comentarios
Thursday, March 8, 2007
Anonymous sites in MOSS 2007
One of the first problems I encountered when I began with SharePoint 2007 was the impossibility to show a list (doc lib, survey, pic lib, ...) to anonymous users. After configure the anonymous access for the site collection, site and list I only could show list to my authenticated users.
After googling I found the reason and the most important, the solution. By default the publish site collections ans all subsites has the LockDown mode on that makes that unauthenticated users cannot view lists.
The solution is simple, disable the LockMode. This action only will affect to the new sites that we create and the old sites still will continue with the LockMode on. To disable the LockMode you have to type:
stsadm -o deactivatefeature -url http://mysitecollection
After that all sites created under the
Links:
http://technet2.microsoft.com/Office/en-us/library/f507f5d6-4c9d-4f98-909f-069c53b9a3f61033.mspx?mfr=true
http://www.sharepointplatform.com/teamblog/Lists/Posts/Post.aspx?List=427bfca2-b731-4c19-87c6-83c90460e02c&ID=29 (read until the end)
Publicado por Àlex en 3:44 AM 12 comentarios