DotNetNuke Module WebReferences

From http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/26422/scope/posts/threadpage/3/Default.aspx:

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

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>