views:

1116

answers:

1

Whenever I add a web reference for any Sharepoint web service in VS 2008, the preview window while adding the web reference shows the proper method names:
Note CreateFolder:

Before: alt text

And after, the CreateFolder method is not there

After

I looked over the documentation at MSDN but it appears I am using it properly.
Can anybody point out my mistake?  Thanks

+1  A: 

You need to create a reference to the Dws object in your code. Otherwise you can only see the static methods/types.

Try

DocumentWorkspace dw = new DocumentWorkspace();
dw.CreateFolder();

Not that normally I need to get a reference to a specific sites dws services, so adding the following code helps

dw.Credentials = [get the appropriate credentials, most often System.Net.CredentialCache.DefaultCredentials];
dw.Url = [basesiteurl] + "/_vti_bin/dw.asmx";
Nat
It worked with this modification: DocumentWorkspace.Dws dw = new DocumentWorkspace.Dws(); Thank you!Also, I'm not sure what you mean by adding the credentials and url to the Document Workspace object. What does that afford me?
Dave
Edit, I see I needed the credentials (which is odd, because none are needed to upload, but the URL was already added when I added the web reference, so I don't think I need to add it again.
Dave
If you are using the lists.asmx, you will want to point to the asmx of the site you want the lists from for example.
Nat