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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Webservice HelpWebservice Help
Previous
 
Next
New Post
9/4/2009 4:59 PM
 

I am trying to build a module that accesses a webservice to do some work.. when I add the web reference to my project all seems fine... I build it and copy the dll to the bin folder on the test server and at runtime I get an error that the type defined in teh webservice is not defined??? What is needed to consume a webservice in DNN 5 using VS2008?

 

Thank you

 
New Post
9/5/2009 3:31 PM
 

Note, This only applies to making a module call OUT to a external web service:

With DotNetNuke your webservice needs a "proxy" and that proxy needs to be an assembly (a .dll) that is placed in the "/bin" directory of your DotNetNuke website.

To create this proxy, you open your DotNetNuke website in Visual Studio and you select Add then New Project. You then create a "ASP.NET Web Application".

In the is "ASP.NET Web Application", you create a normal "proxy" to your web service (using "Add Web Reference...").

You then compile the project and it will create an assembly in the "/bin" directory of your DotNetNuke website.

Note that you have not written any code, you just created a .dll that is nothing but a "shell".

You can now use that "web proxy shell" to connect to an external webservice using code such as:

// Reference to the web service           
VacationRequestWorkflow_WebService wsVacationRequest = new VacationRequestWorkflow_WebService();
// Enable cookies           
wsVacationRequest.CookieContainer = new System.Net.CookieContainer();
// Set the address to the web service          
wsVacationRequest.Url = GetWebServiceURL();
// Call the method to start the workflow           
Guid WorkflowInstanceID = wsVacationRequest.StartWorkflow(VacationRequest.RequestID,
    VacationRequest.CheckDigit, GetLocalWebserviceURL(), PortalSettings.Email, UserInfo.Email);

in the code above, I created a "ASP.NET Web Application" called "VacationRequestWorkflow_WebService". I instantiate the class in my DotNetNuke module code and then I set the address of the web service with this line:

wsVacationRequest.Url = GetWebServiceURL();

I call the method on the web service with this line:

wsVacationRequest.StartWorkflow(VacationRequest.RequestID,
    VacationRequest.CheckDigit, GetLocalWebserviceURL(), PortalSettings.Email, UserInfo.Email);

See this for a working example:

http://www.adefwebserver.com/DotNetNukeHELP/Workflow/VacationRequest2.htm



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
9/8/2009 5:33 PM
 

Thank you very much for the reply!

Not sure I understand why you need to do this though... I am developing a control in its own project.. I just reference the dnn dlls in the project. I dont open up the entire DNN project to build my apps... are you saying it is not possible/advisable to do it this way when I need to add a web reference?


Thank you in advance..


Also - I NEVER get email posts - even when I ask for them from the forum.. any ideas why this is? I am on gmail.com.

Thanks

 
New Post
9/8/2009 9:32 PM
 

tknman0700 wrote
 

Not sure I understand why you need to do this though... I am developing a control in its own project.. I just reference the dnn dlls in the project. I dont open up the entire DNN project to build my apps... are you saying it is not possible/advisable to do it this way when I need to add a web reference?

It should also work the way you create your projects.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
6/26/2010 8:32 AM
 
Hi Michael, Thanks for valuable suggestion on SSO proxy.i followed the same and its working fine in my Development machine(because i had added that sso_proxy.dll by add reference in dotNetNuke website project).But Actually i have to deploy it on my client's server so i can't add dll as an add reference. I had tried to paste sso_proxy.dll in DotNetNuke Bin folder of my client server machine. and i got an error.. The type or namespace name 'SSO_WebService' does not exist in the namespace 'SSO_Proxy' (are you missing an assembly reference?) ---> System.Web.HttpCompileException: m:\TestSiteFilesBackup\DesktopModules\ABCModule\ABCModule\ViewABCModule.ascx(12): error CS0234: The type or namespace name 'SSO_WebService' does not exist in the namespace 'SSO_Proxy' (are you missing an assembly reference?) at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace --- So My question is... Q1. How can i add or Load My dll(SSO_Proxy.dll) into DotNetNuke Website Site while i am creating a new module from site ? Thanks Amrita Vishnoi
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Webservice HelpWebservice Help


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