Register | Login
Sunday, July 20, 2008

Sections
  
About Us
  
Hosting Provided by Server Intellect
Partners
Downloads
  
 WWWCoder.com Resource Directory

 

ORDER TODAY!
Professional DotNetNuke ASP.NET Portals
Amazon.com now has the only DotNetNuke book you'll ever need. Written by the guys who brought you DotNetNuke, Shaun Walker, Patrick Santry, Joe Brinkman, Dan Caron, Scott McCulloch, Scott Willhite, and Bruce Hopkins. Order it now! .

DotNetNuke: Providing Web Services
9/10/2003 8:54:44 AM

Tom Lucas of LucasLabs.Net lays out how to expose functionality from DNN as a Web service.

Are you one of those "forward" thinkers? If so, you may have already asked "Why can't I use web services in DotNetNuke?" Well, I have been asking the same question for months and come up with one way of addressing this with Core DNN until such time that the core supports this.


One of the problems with DNN and including .asmx web service files is that the URL rewriter does not take web services into consideration. This rewriter has been a blessing to many but a bane to web services. One way of address this is to look at a comparison between current Desktop Modules and Webservice modules.


If we consider the fact that the desktop modules for DotNetNuke are nothing more than controls and files in a subdirectory of /desktopmodules that inherit from a DNN class. Now why should web services not be a similar animal? They should. So the solution that follows builds upon this conept with a simple core change.


Under the root of your DotNetNuke installation, create a new directory called /WebServices. This will be analagous to the /DesktopModules directory. All web services you wish to use will be in an aptly named sub directory of the /WebServices directory. So for our example web service called "HelloWorld" we create a directory called "HelloWorld" under the /WebServices directory.


Now that the new home for the web service has been created, we need to add the associated files to actually perofrm the web service functions. Copy your .asmx file to the /WebServices/HelloWorld directory. You also have a compiled .dll file from your web service project. This goes into the /bin directory just like any other private assembly .dll file.


Finally we have all the files and directories in place. Now we must deal with the URL rewriter. A simple method of doing this is to make the following modification to the globals.vb file. This modification is in the spirit of the original framework. What we are doing here is explicitly telling the DNN core to treat the /webservices directory just like the desktopmodules directory. This way, the web service files can be called just like .aspx files in the desktopmodules directory.


Modification to Line 62 of Globals.vb

Case "admin", "controls", "desktopmodules", "mobilemodules", _
"premiummodules", "webservices"


That is all there is to it. Just recompile your DNN Core project and you are ready. This change essentially allows Private Assemblies in theory could add dll's to /bin, .ascx and aspx pages to /desktopmodules/mymodulename/ and .asmx to /webservices/mymodulename. This
opens the doors for DNN to now provide services to other platforms or site using web services.


By: Tom Lucas - Principle of LucasLabs.Net and PortalPro.Net. Tom has over 10 years of experience in web appliction design, achitecture and development. In addition, Tom has won several awards for his law enforcement and municipal government applications and has been an invited speaker at a number of local and international law enforcement conferences. You can view his personal website at http://www.lucaslabs.net/.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 7/2/2007 10:25:02 PM by Anonymous
Comments:
Left on 4/20/2007 10:10:34 AM by Anonymous
Comments: Does the core need to be recompiled every time we modify/add a webservice or just the first time?
No ratings available.
Left on 2/25/2006 1:38:11 AM by Anonymous
Comments: Really found the article helpful but am desparately looking for a way to do this without requiring a core modification.
No ratings available.
Left on 12/1/2004 4:30:37 AM by Anonymous
Comments: Spot on.  A clear and concise answer to what must be a common problem.
Left on 9/17/2003 2:31:38 AM by Anonymous
Comments: Concise without the typical blathering.  Thanks Tom.
Left on 9/16/2003 3:33:52 PM by Anonymous
Comments: Great article and concept
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970