Yesup
 
 

Yamabay Knowledge Base

 

Create Web Reference DLL by using .NET Framework and Command Line

Previous Article Back to TOC Next Article

It is easy to create web reference by using VS.NET, just browse the Web Service URL and give it a namespace. But if you do not VS.NET, you will have to do that manually.First of all, you will need to run wsdl.exe to generate the proxy code in the language you want.


So if you do:wsdl http://www.mysite.com/Web%20Service%20Agent.nsf/DominoDotNetWSDL /l:vb /n /out:DomService.vb /namespace:com.mysite.www

You are generating the proxy code in vb, the file name is DOMService.vb, and the namespace is com.mysite.www.Please note that if you write this in a batch file, you will need to double ’%’ when you need to write a single ’%’, that is because batch file always thinks a number after a single ’%’ is a parameter name supplied by the command line. But if you double ’%’ to make it ’%%’, it will believe you really mean a single ’%’.For example, if you put the above command line in a batch file and run, it will fail because the batch file thinks the URL is actually http://www.mysite.com/Web0Service0Agent.nsf/DominoDotNetWSDL.


Please note that both instances of ’%2’ disappeared, as you did not supply parameter(s) in the batch file command line.So in order not to confuse batch file, we will need to make the command line like:wsdl http://www.mysite.com/Web%%20Service%%20Agent.nsf/DominoDotNetWSDL /l:vb /n /out:DomService.vb /namespace:com.mysite.www

After DOMService.vb is generated, you can either put that directly into your EXE build batch file to consume this Web Service, or ’wrap’ this Web Service into a DLL for other .NET EXE to consume.


Let’s say we want to do the 2nd approach:vbc /t:library /out:MyDOMService.dll Domservice.vb /r:System.dll,System.XML.dll,System.Web.Services.dllThis will build the DLL which provides Web Services.vbc /t:winexe Form1.vb /out:FormVB1.EXE /r:System.dll,System.XML.dll,System.Web.Services.dll,System.Drawing.dll,


System.Windows.Forms.dll,MyDomService.dll /main:Form1


This will build a application FormVB1.EXE using this Web Service DLL.

Yesup
Top Stories Travel Movies Gift Ideas Free Software Games