I try to create a request for a SharePoint web service.
I added a Web Reference based on the SharePoint Web service.
Request messages are based on a multi-part
Message Type and each part is a .Net primitive.
In order to create the message I use a Message Assignement.
Everything works well as long there is no parameters (An empty Construct Message shape does the work) or when parts are of type string:
MyMessage.myStringPart = “SomeString”;
Problems occurs when the primitive is XmlDocument.
– If no part definition => does not not compile, error “Message part has not been initialized”
– If MyMessage.myXmlDocumentPart = null; => Error: “The part … of message … contained a null value at the end of the construct block”
I also tried to define xmlDoc as a variable of type XmlDocument, use xmlDoc.LoadXML(something) and MyMessage.myXmlDocumentPart = xmlDoc:
If …
– xmlDoc.LoadXml(“”); => Error “the part contains zero bytes of data”
– xmlDoc.LoadXml(“<value/>”); => SharePoint SoapServerException
– xmlDoc.LoadXml(“<soap:query></soap:query>”); => Error about soap namespace (don’t remember the exact message)
– xmlDoc.LoadXml(“<ns0:query xmlns:ns0=’http://schemas.microsoft.com/sharepoint/soap/’><Value/></ns0:query>”); => SharePoint SoapServerException
So, what should I try ?