I need to deploy a webservice as part of a DotNetNuke 4.x module that I'm creating - but am not sure how I can do that and know that it'll always stay in the same place. How can I add an asmx file to my module project, and when I create my .DNN file specify where the webservice will end up? I want to reference the webservice from inside the ascx file in the module using the "~/webservices/webservice.asmx" format.
Does DotNetNuke have a way to specify in the .DNN file where the webservices will end up on the site? And if so, will I still be able to reference them with root anchored tags like ~/myservice.asmx?
You can include the ASMX file by including a element in the <files>
section:
<files>
<file>
<name>YourWebService.asmx</name>
<path></path>
</file>
</files>
Generally, you don't need to specify a path.
Alternatively, you can include a Resources.zip file with your package which will include any files other than those that DNN needs to process during installation (e.g. Assemblies and SqlDataProvider files).
The benefit of this is maintainability. Using Resources.zip will keep you from having to edit the manifest file over and over...
The contents of the zip file will simply be unpacked into the root module directory (e.g. /DesktopModules/YourModule/*). If there is a file structure within your zip file it will be maintained.
You'll want to add TheNameOfYourFile.zip To your manifest file under the element.
[snip]
<folder>
<name>Your Module</name>
<friendlyname>Your Module</friendlyname>
<foldername>YourModule</foldername>
<modulename>YourModule</modulename>
<description>A module for DotNetNuke websites.</description>
<version>01.00.00</version>
<resourcefile>Resources.zip</resourcefile>
<businesscontrollerclass></businesscontrollerclass>
<modules>
<module>
[/snip]
As for referencing it in your module - I suggest using:
<%=ResolveUrl("~/DesktopModules/YourModule/Services.asmx")%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With