Thanks for replying. That is exactly what I get with the XSD tool. My issue
is with using the following web service with a windows forms application:
“[WebMethod]
public bool test(Folder test)
{
return true;
}”
By creating a new windows forms project and adding a web reference to this
service, I am unable to pass in a folder that contains multiple sub folders:
“WebReference.Service wr = new WebReference.Service();
WebReference.Folder Folder1 = new WebReference.Folder();”
How would I create sub folders / documents?
Thanks
From the generated class defintion of Folder, it has a Folder1 property of
type Folder[], and a Document property of type Document[].
Say you want to pass the contents of C.
WebReference.Folder myCDrive = new WebReference.Folder();
myCDrive.Folder1 = GetSubDirs("c");
myCDrive.Documents = GetFiles("c");
Where GetSubDirs() is a helper method, using System.IO.Directory class to
get directories, and transform the lot to WebReference.Folder[], and same
for GetFiles().
So now the myCDrive object, which is a top level view of the C directory,
has all subdirs and documents in that folder.
Use recursive directory listing code to populate all the subdirs down to a
specified nesting level if necessary.
Ron
> Thanks for replying. That is exactly what I get with the XSD tool. My
> issue
[quoted text clipped - 101 lines]
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
Steven Cheng[MSFT] - 30 Jan 2007 10:34 GMT
Thanks for Ron's input.
Hi Nick,
As Ron mentioned, you can provide multiple subfoldes to the "Folder1"
property, and multiple documents to the "Document" property. e.g
==================
static void SimpleTest()
{
TestService.Service ts = new Service();
Folder folder = new Folder();
folder.name = "root_folder1";
Folder[] subfolders = new Folder[3];
subfolders[0] = new Folder();
subfolders[1] = new Folder();
subfolders[2] = new Folder();
folder.Folder1 = subfolders;
Document[] documents = new Document[3];
documents[0] = new Document();
documents[1] = new Document();
documents[2] = new Document();
folder.Document = documents;
string ret = ts.SendFolder(folder);
.........
}
=====================
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.