Je reçois l'erreur Appel de la fonction GetListItems mais est bizarre car elle fonctionne dans Visual Studio 2008 Express mais non dans Visual Basic 2010 Express:Impossible de convertir System.Xml.XmlNode en System.Xml.Linq.XElement
Dim ndQuery As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "")
Dim ndViewFields As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "")
Dim ndQueryOptions As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "QueryOptions", "")
ndQueryOptions.InnerXml = "<IncludeMandatoryColumns>False</IncludeMandatoryColumns>" & _
"<DateInUtc>True</DateInUtc>"
ndViewFields.InnerXml = "<FieldRef Name=""LinkFilename"" />" & _
"<FieldRef Name=""Empresa"" />" & _
"<FieldRef Name=""Puesto"" />" & _
"<FieldRef Name=""Fecha_x0020_Vigente"" />" & _
"<FieldRef Name=""Oferta_x0020_vigente"" />"
ndQuery.InnerXml = ""
Try
Dim ndListItems As XmlNode = IntranetLists.GetListItems(ListUUID, Nothing, _
ndQuery, ndViewFields, Nothing, ndQueryOptions, Nothing)
et c'est la fonction appelante je suis:
Public Function GetListItems(ByVal listName As String, ByVal viewName As String, ByVal query As System.Xml.Linq.XElement, ByVal viewFields As System.Xml.Linq.XElement, ByVal rowLimit As String, ByVal queryOptions As System.Xml.Linq.XElement, ByVal webID As String) As System.Xml.Linq.XElement
Dim inValue As ListasIntranetGureak.GetListItemsRequest = New ListasIntranetGureak.GetListItemsRequest()
inValue.Body = New ListasIntranetGureak.GetListItemsRequestBody()
inValue.Body.listName = listName
inValue.Body.viewName = viewName
inValue.Body.query = query
inValue.Body.viewFields = viewFields
inValue.Body.rowLimit = rowLimit
inValue.Body.queryOptions = queryOptions
inValue.Body.webID = webID
Dim retVal As ListasIntranetGureak.GetListItemsResponse = CType(Me,ListasIntranetGureak.ListsSoap).GetListItems(inValue)
Return retVal.Body.GetListItemsResult
End Function
Si cela ne fonctionne pas, s'il vous plaît dire nous le * way * dans lequel ça ne marche pas. Voir http://tinyurl.com/so-hints –
Quelle est la première section de code que vous avez publiée? C'est évidemment incomplet. Je ne peux pas reproduire le problème pour voir quelle erreur vous obtenez. –
Dans l'exemple, vous convertissez XElement en XmlNode; mais la question demande XmlNode à XElement ... –