Lee Harrison
Lee Harrison

Reputation: 2453

Accessing SharePoint2007 Web Services

I am trying to access a share point site so users can be added at the same time they are added to our Active Directory. The Active Directory portion was a piece of cake, and I assumed the SP portion would be as well. I've added my web references to my project, and I can access them, but I cannot create any new instances to be able to reach the members.

My Service_Reference is called sp_UserGroup.

sp_UserGroup UserGroup = new SP_UserGroup;

Error: "sp_UserGroup is a namespace but is used like a type"

I understand why I am getting the error, but I haven't seen any documentation that even brings this fact up.

All of the examples I have seen follow this pattern, but I cannot figure out why this will not work for me. I can reach the methods within sp_UserGroup, but they are useless if I cannot set the members.

I was referring to this document in regards to creating new users.
http://msdn.microsoft.com/en-us/library/ms412944%28v=office.12%29.aspx

I know this is a very simple problem, but I'm a hapless n00b!

Upvotes: 0

Views: 262

Answers (1)

TroyBramley
TroyBramley

Reputation: 604

The declaration should be like this (in C#):

sp_UserGroup.UserGroup UserGroup = new SP_UserGroup.UserGroup();

where sp_UserGroup is the name of your web service.

Upvotes: 1

Related Questions