Consuming and creating a webservice refernce WITHOUT using the VS Studio option “Add Reference”?

Posted on 2014-04-24
Medium Priority
Last Modified: 2014-04-24
I'm trying to create class/object and have it consume a web service from within the class/object WITHOUT using the VS Studio option “Add Reference”?
I’m trying to create a dll that developers can add to their project without having to add a web reference. I want my object/class to do it without them having to deal with it.
VB.NET syntax, but I would take C# example as well.
Question by:sweoff
  • 2
  • 2
LVL 41

Accepted Solution

Kyle Abrahams earned 2000 total points
ID: 40020752
You can create a project who's output is a library.  

Add the reference in your own library, and then expose the function calls inside a class.

When you compile you'll have a DLL that you can publish, and then they can add a reference to the DLL.

I'm not sure that it's really worth it though . . . any developer should be able to figure out how to use the service reference, and keep in mind that every time you update the service you'll also have to update the DLL.

Author Closing Comment

ID: 40020840

Author Comment

ID: 40020852
Can I make a parameter within the class to pass the URL for the web Reference?
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 40021089
I would make it part of your constructor.

so Class MyWebServiceClass
  private string _URL;
  public string URL {get return _URL; }
  public MyWebService ws;

   ws = new MyWebService();
   _URL =  "defaulturl";
   ws.Url =  _URL

  MyWebService (string theUrl)
   _URL = theUrl;
    ws = new MyWebService();
   ws.URL = _URL;

something like that . ..  all pseduo code.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

624 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