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.0DotNetNuke 4.0, Module development project and Web references...DotNetNuke 4.0, Module development project and Web references...
Previous
 
Next
New Post
6/7/2006 11:00 AM
 
did you add the following to the web.config

<compilation>
      <codeSubDirectories>
        <add directoryName="Widget"/>
      </codeSubDirectories>
</compilation>


 
New Post
6/12/2006 10:26 PM
 

Hi Mattes,

I am new to DNN and currently working on a project that involves consuming a webservice from a DNN 4 module.

I have added a web reference to the service but I dont know how to package it all together into a zip file that would then be added as a new module to my DNN site.

Please give me a few pointers if you can.

Thank you.

Ahmer

 
New Post
10/10/2006 12:53 PM
 
I came across this thread via Google search because I had almost the same situation as MatteS. I'm not new to the .NET framework, but I'm new to DotNetNuke module development. Well, after much research and several days of frustration, I finally figured out how to deploy a web reference in a module, so I thought I'd share.

Actually, junyen was on the right track, but most of us starting out with DNN or the .NET framework aren't going to know what he meant when he said to create a proxy class for your project. In case you don't know, a web reference proxy class is a code version of a web reference. The web references are usually located in your App_WebReferences folder, but if you make a code version of it, you can move the code wherever you need it. To create the proxy class, you need to use a tool called wsdl.exe, which comes with Visual Studio 2005. To use it, click Start => All Programs => Visual Studio 2005 => Visual Studio Tools => Visual Studio 2005 Command Prompt. Navigate to where you want the output code file to go and type:

wsdl http://www.[yourwebservicesite].com/[yourwebservice].asmx?wsdl /namespace:[YourWebServiceAlias] /out:MyWebService.vb /language:VB

Replace the text in brackets with your own information that pertains to your web service. You should use the same namespace as the alias you called your web reference when you linked to it. So, if you called your web reference MyWebService, the namespace you use in the wsdl command should be the same. Otherwise, you'll need to update your calling code to reference the new namespace.

Copy output file (MyWebService.vb) to your module's folder in the App_Code folder. Now you can remove the web reference from your App_WebReferences folder and test to make sure your module still works. Once you've verified this, you're ready to package and deploy your module. When you hit Build => Publish, the proxy class you created will be rolled into the dll that gets created for your App_Code folder.

Here's more info on the WSDL.exe tool:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfwebservicesdescriptionlanguagetoolwsdlexe.asp
 
New Post
3/6/2007 8:30 AM
 
As I was working on the next version of the module described in my earlier post, I again found myself with a problem related to this original topic. This time my workaround to the original issue was the thing that causing my next problem, adding a second web reference to my module.

Funnily enough, as I was googling to find a solution to the problem, I found myself reading the post from zangad, and that solved my original problem, aswell as the new one!

Just wated to post and say thanks zangad for the perfect solution, thats exactly what I was looking for!

 
New Post
6/20/2007 4:26 AM
 

Hi There,

I seem to have a problem using MS MapPoint Webservice in my DNN module. I was wondering if any of you chaps might be able to help....

The module i am writing is based around code supplied in the MS MapPoint SDK and works perfectly in a standalone project.

I then downloaded the VS2005 DNN 4.5.3 Starter Kit and installed that - all worked perfectly.

I then used the Starter Kit to add a DNN module template to my project - again, all worked perfectly.

I then added the MapPoint Web Reference to the project at DNN level  just to try and get it working

I then migrated all the code from the standalone project into the DNN module and it compiles with no errors.

But, when i run the project and try and create a map it pukes with the error :

System.MissingMemberException was unhandled by user code
  Message="Public member 'FindServiceClass' on type 'global_asax' not found."
  Source="Microsoft.VisualBasic"
  StackTrace:
       at Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetMembers(String& MemberName, Boolean ReportErrors)
       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
       at ParcelRoute.ViewParcelRoute.buttonGetRoute_Click(Object sender, EventArgs e) in C:\DotNetNuke97\DesktopModules\ParcelRoute\ViewParcelRoute.ascx.vb:line 127
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

when running the following code:

Try
myFindResultsPointA = ParcelRoute.FindServiceClass.FindAddress(findAddressSpecA)
Catch myException As SoapException
'Your exception handling goes here
End Try

I have been talking in depth with Mike Lancaster, who writes the DNN Module Development guide and he thinks it's something to do with DNN. He commented:

"I think it is failing because DotNetNuke is running under partial trust and it need full trust. But I'm way out of my comfort zone at this point. Hopefully someone has an answer."

Previous Thread is at: http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/145061/threadpage/1/scope/posts/Default.aspx

From what I can see the functions are in a global.asax.vb in my \app_code\ParcelRoute directory. Which is where Mike said it should be...

Have you got any thoughts on what might be going wrong please?

(Also, I tried doing what was mentioned in the posting above but it says that the asmx file is not found... weird.... never mind. I think it should work as it is using the Web Reference at DNN level although I will have to fix this problem before i can make it into a PA) 

Below is a copy of the code in my global.asax.vb

'---------------------------------------------------------------------
'  This file is part of the Microsoft MapPoint SDK Code Samples.
'
'  Copyright (C) Microsoft Corporation.  All rights reserved.
'
'This source code is intended only as a supplement to Microsoft
'Development Tools and/or on-line documentation.  See these other
'materials for detailed information regarding Microsoft code samples.
'
'THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
'KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
'IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'PARTICULAR PURPOSE.
'---------------------------------------------------------------------

Imports System.Web
Imports System.Web.SessionState
Imports System.Net  ' for network logon
Imports System.Diagnostics  ' for debug asserts


Namespace ParcelRoute


    ' SUMMARY
    ' An instance of this class is created by ASP .NET for every worker thread.
    ' Each web request is associated with an instance of this class, so it makes
    ' a handly place to put objects that are needed for each request, but are
    ' expensive to initialize.
    ' From the code behind of an individual page, the instance of this class
    ' associate with the request can be obtained from Context.ApplicationInstance

    Public Class [Global]
        Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

        '   SUMMARY
        '   Constructor, use to populate per-instance data.
        ' In our application, each instance will create objects for accessing
        ' the MapPoint .NET service.
        Public Sub New()
            MyBase.New()

            'This call is required by the Component Designer.
            InitializeComponent()

            'Initializes the MapPoint .NET connection objects
            InitializeMPNetConnection()

        End Sub

        'Required by the Component Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Component Designer
        'It can be modified using the Component Designer.
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            components = New System.ComponentModel.Container()
        End Sub

#End Region

       

        ' This section handles the initialization and management of the classes for the
        ' MapPoint .NET Service

        ' SUMMARY
        ' These are the actual instances of the objects that call the MapPoint .NET
        ' service
        Private renderService As MapPointService.RenderServiceSoap
        Private findService As MapPointService.FindServiceSoap
        Private routeService As MapPointService.RouteServiceSoap
        Private commonService As MapPointService.CommonServiceSoap

        ' Performs the work needed to initialize the connection to the
        ' MapPoint .NET service
        Private Sub InitializeMPNetConnection()

            Try
                ' First, create the render service
                renderService = New MapPointService.RenderServiceSoap()

                ' Create and set the logon information (note comment in
                ' web.config -- here would be the place to
                ' decrypt/unhash the user/password from the config file).
                Dim ourCredentials As New NetworkCredential(System.Configuration.ConfigurationManager.AppSettings("MPUser"), System.Configuration.ConfigurationManager.AppSettings("MPPass"))
                renderService.Credentials = ourCredentials
                renderService.PreAuthenticate = True

                ' Next, create the find service
                findService = New MapPointService.FindServiceSoap()
                ' Set the logon information
                findService.Credentials = ourCredentials
                findService.PreAuthenticate = True

                ' Next, create the route service
                routeService = New MapPointService.RouteServiceSoap()
                ' Set the logon information
                routeService.Credentials = ourCredentials
                routeService.PreAuthenticate = True

                ' Last, create the common service
                commonService = New MapPointService.CommonServiceSoap()
                ' Set the logon information
                commonService.Credentials = ourCredentials
                commonService.PreAuthenticate = True

            Catch ex As Exception

                'Your exception handling goes here

            End Try
        End Sub

        ' An instance of the find service class
        Public ReadOnly Property FindServiceClass() As MapPointService.FindServiceSoap
            Get
                FindServiceClass = findService
            End Get
        End Property

        'An instance of the render service class
        Public ReadOnly Property RenderServiceClass() As MapPointService.RenderServiceSoap
            Get
                RenderServiceClass = renderService
            End Get
        End Property

        'An instance of the route service class
        Public ReadOnly Property RouteServiceClass() As MapPointService.RouteServiceSoap
            Get
                RouteServiceClass = routeService
            End Get
        End Property

        'An instance of the common service class
        Public ReadOnly Property CommonServiceClass() As MapPointService.CommonServiceSoap
            Get
                CommonServiceClass = commonService
            End Get
        End Property

    End Class

End Namespace


www.taxiroute.co.uk - Get a Fare Price!
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DotNetNuke 4.0, Module development project and Web references...DotNetNuke 4.0, Module development project and Web references...


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