Solved

Distribute Web Service as a DLL - VB.NET

Posted on 2012-03-20
10
458 Views
Last Modified: 2012-06-22
Hi,

I have a Web Service developed in VB.NET. I did create the PROXY by using the WSDL utility. The file name is called "Proxy.vb". Now instead of sharing the "Proxy.vb" file, i want to share it as a DLL so that others can include it as a reference in their projects.

Can you please provide me the complete command for creating the DLL for the above "Proxy.vb" file ? The DLL file name will be "Proxy.DLL".

Basic concept is "Distributing the Web Service as a DLL" and not by using "Web Service Reference" dialog box.

Thanks
0
Comment
Question by:milani_lucie
  • 5
  • 3
  • 2
10 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37742891
If you create a library project, you can do your "Add Service (or Web) Reference" work there. You will need to distribute the stuff which gets put into web.config with respect to endpoints and bindings (if this is a WCF service). You could set these values up in the code directly, however. You may have to track down which config setting corresponds to which code entity, though.
0
 

Author Comment

by:milani_lucie
ID: 37742922
Here is the post i have got:

http://www.dreamincode.net/forums/topic/117482-make-webservice-a-dll/

vbc /t:library /out:bin\Proxy.dll <path_of_proxy_class> /reference:System.dll,System.Data.dll,System.Web.dll,System.Web.Services.dll,System.XML.dll,System.Runtime.Remoting.dll <and all the other references reqd>  /optimize

What does this means - <and all the other references reqd> ?

Thanks
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37742935
The author was abbreviating. If your class library depends on other libraries which you created (or maybe 3rd-party libraries), then you would need to list those as references as well; otherwise, your library may fail to compile or it may fail at runtime due to missing references.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:milani_lucie
ID: 37743039
I have created the DLL and add it as a reference (Not Web Service Reference) in Client project. Here is the error i am getting:

The type 'System.Web.Services.Protocols.SoapHttpClientProtocol' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Here are the commands i have executed:

wsdl.exe /l:cs /out:Proxy.cs http://localhost:64710/Service1.asmx?WSDL

csc /t:library /out:Proxy.dll c:\Proxy.cs /reference:System.dll,System.Data.dll,System.Web.dll,System.Web.Services.dll,System.XML.dll,System.Runtime.Remoting.dll /optimize

I do NOT want to reference any DLL's in the Client project EXCEPT my Proxy.DLL.

Thanks
0
 

Author Comment

by:milani_lucie
ID: 37743199
Is there any way that i can specify version of the DLLs in CSC command ? Something like this:

csc /t:library /out:Proxy.dll c:\Proxy.cs /reference:System.dll 2.0.0.0,System.Data.dll 2.0.0.0,System.Web.dll 2.0.0.0,System.Web.Services.dll 2.0.0.0,System.XML.dll 2.0.0.0,System.Runtime.Remoting.dll 2.0.0.0 /optimize

Thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37743711
Do you not have Visual Studio? Put your class in a Class Library project, add references visually and just build it.
0
 

Author Comment

by:milani_lucie
ID: 37743988
All the code is hosted as Web Service. So we need not write the same code as "Class Library". And we want to distribute the same to all other projects who needs it. We want to create a PROXY for the Web Service and create a DLL from it so that we can distribute it to other projects easily.

Thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37774289
What I am saying is what you do in http:#a37743199 can be done in visual studio in a more intuitive way.
0
 

Author Comment

by:milani_lucie
ID: 37774494
Can you please let me know how ?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37776374
Use this tutorial

http://www.c-sharpcorner.com/UploadFile/mahesh/dll12222005064058AM/dll.aspx

Remove the empty class file and add your class using Add Existing Item.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question