milani_lucie
asked on
Distribute Web Service as a DLL - VB.NET
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
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
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.
ASKER
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,Syst em.Data.dl l,System.W eb.dll,Sys tem.Web.Se rvices.dll ,System.XM L.dll,Syst em.Runtime .Remoting. dll <and all the other references reqd> /optimize
What does this means - <and all the other references reqd> ?
Thanks
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,Syst
What does this means - <and all the other references reqd> ?
Thanks
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.
ASKER
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.Proto cols.SoapH ttpClientP rotocol' 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=b03f5f7f11d 50a3a'.
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,Syst em.Data.dl l,System.W eb.dll,Sys tem.Web.Se rvices.dll ,System.XM L.dll,Syst em.Runtime .Remoting. dll /optimize
I do NOT want to reference any DLL's in the Client project EXCEPT my Proxy.DLL.
Thanks
The type 'System.Web.Services.Proto
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,Syst
I do NOT want to reference any DLL's in the Client project EXCEPT my Proxy.DLL.
Thanks
ASKER
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.Service s.dll 2.0.0.0,System.XML.dll 2.0.0.0,System.Runtime.Rem oting.dll 2.0.0.0 /optimize
Thanks
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.Service
Thanks
Do you not have Visual Studio? Put your class in a Class Library project, add references visually and just build it.
ASKER
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
Thanks
What I am saying is what you do in http:#a37743199 can be done in visual studio in a more intuitive way.
ASKER
Can you please let me know how ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.