Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0WebServiceWebService
Previous
 
Next
New Post
4/19/2007 9:38 AM
 
i am trying to build a webservice without the iweb component that creates users.

i have successfully created a user through the UserController and registered him to a role thought the RoleController, but when i am trying to send mail i can't access the PortalController.GetCurrentPortalSettings. it tells me that the object is not set or something like that and from some tests i have made it return "Nothing".

any ideas.

i am using VS2005
DNN v4.4.1

Thanks in advance
 
New Post
4/19/2007 12:14 PM
 

I believe you'll have to get PortalSettings with another method, as the web.service most likely isn't inheriting from PortalModuleBase where you can get the portal settings without much hassle.

You might try getting them with the code below, though this might not work for you either

PortalSettings ps = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

 


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
4/20/2007 2:51 AM
 
As you correctly guessed it didn't work. It also gives the same error. Any other ideas? Or will i have to revert to IWeb?

Thanks in advance
BL

PS: I am using VB, but it's almost the same as VC
 
New Post
4/20/2007 3:12 AM
 
Actually what i want to do is get the PortalSettings for the SendMail function so that i can do the following:
  Dim oUI As UserInfo
  oUI = New UserInfo
  Mail.SendMail(oUI, MessageType.UserRegistrationPublic, PortalController.GetCurrentPortalSettings)

BTW the following code works:
  Dim oOUI As New OnlineUserInfo
  Dim oPC As New PortalController
  Dim iCS As UserCreateStatus
  oUI = UserController.ValidateUser(oOUI.PortalID, sAdmUn, sAdmPwd, "", oPC.GetPortal(oOUI.PortalID).PortalName, strIP, loginStatus)
  Dim sPwd As String = UserController.GeneratePassword.ToUpper
  iCS = UserController.CreateUser(oUI)
  Mail.SendMail("bl@test.com", "bl@test.com", "", "1", "1", "", "", "localhost", "", "", "")

Just an idea? Is there a way to get the PortalSettings of a given portal by PortalID?

Thankx in advance
BL
 
New Post
4/20/2007 4:20 AM
 
I found something.

When i had the WebService.asmx located in /webservices/webservices.asmx it didn't work.
When i copied the WebService.asmx to /DesktopModules/WebServices/WebServices.asmx it worked like a charm.
It worked too when i copied the WebService.asmx to /DesktopModules/WebServices.asmx.
Is there a way i could override this without changing the DNN core code?

Thanks in advance
BL

PS: If there is no way i will stick with /DesktopModules/WebServices/WebServices.asmx
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0WebServiceWebService


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out