Domanda

Sono un po 'perplesso su come prendere un tipo di errore specifico di Microsoft.SharePoint.SoapServer.SoapServerException, ti spiego perché, e ho incluso un esempio di codice di seguito per voi ragazzi a vedere.

Come sapete ci sono 2 modi per interagire con MOSS.

  1. Il modello a oggetti (funziona solo su MOSS Server)
  2. Web Services (può essere eseguito su un computer remoto interrogare il server MOSS)

Quindi, come per esempio di codice che sto usando i servizi web di ricerca MOSS, a causa di questo non ho SharePoint installato sul server remoto che esegue questi servizi web e senza MOSS installato la sua impossibilità di fare riferimento alla DLL SharePoint per ottenere il specifico tipo di errore: Microsoft.SharePoint.SoapServer.SoapServerException.

Se non riesco a fare riferimento la DLL allora come diavolo dovrei prendere questo tipo di errore specifico?

System.Xml.XmlNode ndListView = wsLists.GetListAndView(ListName, "");
            string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value;
            string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value;

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            System.Xml.XmlElement batchElement = doc.CreateElement("Batch");
            batchElement.SetAttribute("OnError", "Continue");
            batchElement.SetAttribute("ListVersion", "1");
            batchElement.SetAttribute("ViewName", strViewID);

            batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" +
            "<Field Name='DeliveryStatus'>" + newStatus.ToString() + "</Field>" +
            "<Where><Eq><FieldRef Name='ID' /><Value Type='Text'>" + id + "</Value></Eq></Where></Method>";

            try
            {
                wsLists.UpdateListItems(strListID, batchElement);
                return true;
            }
            catch (Microsoft.SharePoint.SoapServer.SoapServerException ex)
            {

            }
È stato utile?

Soluzione

La sua realtà uno System.Web.Services.Protocols.SoapException

scroll top