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...Service References - Under the hood of VS 2008Service References - Under the hood of VS 2008
Previous
 
Next
New Post
11/4/2008 12:45 PM
 

Can anyone please give a definitive answer on what all needs to be moved after a service reference has been added by visual studio, in order to get the service reference working correctly on another server running it's own dnn site?  (publishing or opening up the website on the server in vs and using it to add the service reference would probably work, but it is not an option available to me; I need to be able to do it without relying on vs to do it for me)

Currently, I am developing modules against an instance of dnn on my local machine.  I have written a module that successfully consumes a wcf web service (.svc, not .asmx) that resides on a seperate server.  I added the service reference using vs 2008.  At the very least, I know vs 2008 creates an App_Webreferences folder and adds a section called <system.serviceModel> to the web.config. 

So, I packaged the module into a zip, and installed it on a developement server.  In order to try and get the development server's dnn to be able to consume the web service, I copied the App_Webreferences folder and added the <system.serviceModel> section that vs added to my local dnn's web.config, to the development server's dnn web.config file, but that didn't work.  The module displayed the following error.

Error: FileStatus is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: c:\Inetpub\wwwroot\DotNetNuke\DesktopModules\FileStatus\ViewFileStatus.ascx.cs(15): error CS0246: The type or namespace name 'WSFileStatus' could not be found (are you missing a using directive or an assembly reference?)...etc...

Where WSFileStatus is the namespace of the web service that I defined when adding the service reference.

This indicates to me that the copy of dnn that is running on our development server is either not communicating properly with the webservice, or does not know where to look for the webservice.

I typed the url of the web service in a browser from the development server, and it does have access to it.  I used Windiff to compare both the module's App_Code and DesktopModules directories to verify all of the module's code is the same.

So, it appears that there is something (probably simple, but not obvious) that vs adds to dnn's web site project when adding a service reference, that needs to be copied from my local to the development machine, but I am unsure of what it is.  What all needs to be copied and/or modified once a service reference has been added, in order for a dnn instance on another server to successfully consume a web service?

Note: Copying my entire dnn site from my local onto the development server works.  That is, the module consumed the web service as expected, so I don't think the problem is with the module, but with the service reference.  There just seems to be something that vs 2008 does in addition to creating the App_Webreference folders/files and adding that <system.serviceModel> section to the web.config that I am missing.

 
New Post
11/21/2008 3:42 PM
 

So, as it turns out, when you add a service reference in VS, it apparently creates a file called References.cs, but only for web application projects, not web site projects.  For web site projects, when you go to the definition of a method of an object defined in a web service, it takes you to metadata, which is some temp file somewhere, instead of a proxy class.  In a web app, it takes you to the Reference.cs file as opposed to metadata.

That seems somewhat backwards to me, as web applications seem to compile the proxy classes into the assembly it builds (at least that's what i got from opening a compiled assembly that consumes a web service in ildasm).  With web site projects, the code is not necessarily compiled into assemblies (if you just move the files over instead of publishing), so it would need a file somewhere with the proxy classes.  Why doesn't VS create a Reference.cs file for web sites, when they seem to need it more than web application projects?  Or does VS create a file like Reference.cs, that has the web service's proxy classes for web site projects, and I just haven't found it yet?

Right now I'm using svcutil for creating the proxy classes for my modules to be able to consume web services on a different server than I'm developing on, and then moving that with my modules.  However, there must be a file I'm missing somewhere, as you don't have to use svcutil to consume a web service for a web site that you have added the Service Reference to via VS.  This is affecting how we are developing and deploying our modules, and it would be nice to know what the "right" way to do it is, so if anyone has any thoughts, it would be greatly appreciated.

Thanks in advance.

 
New Post
11/21/2008 6:56 PM
 

See:

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

Creating a proxy in DNN to call an external web service

To allow a DNN module to call an external web service and change the address dynamically, a VacationWebService project is created that contains a normal .asmx web proxy that connects to the workflow web service in the IWebWF site.

The project is compiled and the VacationWebService.dll file that is created, is placed in the "Bin" directory of the DNN site. This allows you to instantiate the class with code such as this:
 

VacationRequestWorkflow_WebService wsVacationRequest = new VacationRequestWorkflow_WebService();

and alter the web service address dynamically with code like this:
 

// Set the address to the web service      
wsVacationRequest.Url = GetWebServiceURL();

 



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Service References - Under the hood of VS 2008Service References - Under the hood of VS 2008


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