I'm trying to create a web service to pull down user info from the DNN site. I've created the asmx and deployed it and it's dll to the test site. When I call the method that includes UserController.GetUsers(0) I get the following:
System.ServiceModel.FaultException occurred
HResult=-2146233087
Message=System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.Entities.Users.UserController.GetUsers(Int32 portalId, Int32 pageIndex, Int32 pageSize, Int32& totalRecords, Boolean includeDeleted, Boolean superUsersOnly)
at DotNetNuke.Entities.Users.UserController.GetUsers(Boolean includeDeleted, Boolean superUsersOnly, Int32 portalId)
at WindoTrader.Web.Services.BlueWebAPI.GetAllUsers() in c:\Blue\trunk\WebApplication1\BlueWebAPI.asmx.cs:line 48
--- End of inner exception stack trace ---
Source=mscorlib
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at DnnToIsSync.com.windotrader.services.BlueWebAPISoap.GetAllUsers(GetAllUsersRequest request)
at DnnToIsSync.com.windotrader.services.BlueWebAPISoapClient.DnnToIsSync.com.windotrader.services.BlueWebAPISoap.GetAllUsers(GetAllUsersRequest request) in c:\Blue\trunk\DnnToIsSync\Service References\com.windotrader.services\Reference.cs:line 385
at DnnToIsSync.com.windotrader.services.BlueWebAPISoapClient.GetAllUsers() in c:\Blue\trunk\DnnToIsSync\Service References\com.windotrader.services\Reference.cs:line 391
at DnnToIsSync.Program.Main(String[] args) in c:\Blue\trunk\DnnToIsSync\Program.cs:line 21
InnerException:
The code in question at line 48 is simply:
var users = UserController.GetUsers(false, false, 0);
The same result is from:
var users = UserController.GetUsers(0);
Am I misusing the UserController?
Any help is appreciated