0

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 http://img134.imageshack.us/img134/5286/vs20081bq7.png

And after, the CreateFolder method is not there

After http://img134.imageshack.us/img134/3530/vs20082be5.png

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

1 Answer 1

1

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";
3
  • 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
    Nov 4, 2008 at 20:30
  • 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
    Nov 4, 2008 at 20:40
  • 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
    Nov 4, 2008 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.