Develop a WebService in Visual Studio C#, and calling it from a separate VS Solution

Related searches

I am developed an app in Visual Studio C#. The app is done. Now I want to convert the app to a web service to be called by other apps in our very large network installation. I am at the stage where I am learning to use web service. So far, I have a simple HelloWorldToken type web app in a web service Solution.

public WebService() { }

public string HelloWorld()
    return "Hello World - invoke me";

public string webServiceAdd(int a, int b)
    int c = a + b;
    return " " + a + " + " + b + " = " + c;

public string HelloWorldToken(string Token)
    return "Hello World authToken = " + Token ;

This works when I call it from the Visual Studio environment, and also works from an HTML web page. The "action" tag calls the web service, and there are hidden fields in the form that contain the values to be passed.

     <form target="_blank" 
        Invoke Web Service <br />(from form)
        <input type="hidden" value="5" name="a" />
        <input type="hidden" value="4" name="b" />
        <input type="hidden" value="myUserName" name="usr" />
        <input type="hidden" value="myPassword" name="psw" />
        <input type="hidden" value="theToken" name="Token" />
    <td align="left">
         <input type="submit" value="Invoke" class="button">

So far, so good. The web page successfully calls the web service and the web service returns the value generated successfully.

However, ultimately I will need to call the web service from a separate C# application. But to load the separate C# calling code, I must unload the web service code Solution. When I unload the web service, it stops operating. Any calls to it are not found.

I don't have access to an IIS on my computer due to installation rules (very tight). Running Visual Studio 2017 Professional.

My request is to have the web service running on the Visual Studio internal server, while also testing a different Visual Studio C# application (in a different Solution) to call the web service. Is this possible?

You can run 2 instances of Visual Studio and launch each of the apps (web and desktop) at the same time.

Write a web service by using Visual C#, This article helps you write a web service, called MathService, that exposes methods Microsoft Windows; Internet Information Server; Visual Studio . details called by public web service methods or for the case in which the WebService This page also enables you to test different web service methods. In the next article, we learned how to create a Web API using ASP.NET, C#, and Visual Studio. Brought to you by: Embed Analytics and Dashboards into your product with a JavaScript SDK.

If you don't have a local IIS, your only choice is:

1.- Mount your web service code in a new project 2.- Run that project and keep it running 3.- Copy the URL localhost:port... that is shown in browser 4.- Go to your second project and add new service reference and paste the url copy before 5.- You can now use your web service

HOW TO: Write a Simple Web Service by Using Visual C# .NET, Describes steps to write a simple Web service (MathService) that exposes Information Server 4.0 or Internet Information Server 5.0; Microsoft Visual Studio . NET details called by public Web service methods or for the case in which the This page also enables you to test different Web service methods. Step-by-step how to Develop a RESTful Web Service in ASP .NET Web API. Prerequisite for this project: Download the latest version of Microsoft Visual Studio. They have a free license version for

Someone in my shop here advised on a second answer. That is to put both the web service project and the calling project in THE SAME SOLUTION. There is a way of setting both projects to start when the Solution is opened. That way, both are running at the same time. Right click on the Solution properties, Startup Project, and you have a radio button for Multiple startup projects. You can order it the way you want.

Introduction to projects and solutions, A solution is a container that's used to organize one or more related code When you create a new project, Visual Studio automatically creates a Currently it contains a single file called App.config. Expand Visual C# Items, then choose Code. These tabs are different for different types of projects. Hello Guy, I just need your help with the idea with the implementation of web services. This is the first time i'm implementing web service. I have an exsiting web site that retreive from value from database, the web site is implemented using dotnet nuke, these values contains information about company such as name, address and the status of thier liencese, the status can be active, expired

How To Create A Web Service Project In .NET Using Visual Studio, NET Framework) and give it a name as I have given - WebServiceProject. Click on OK. Select the Empty template. It creates a solution having the� In this tutorial, you’ll learn how to structure a Visual Studio solution that uses React for the front-end and ASP.NET Web API for the back-end. Also, we will dive deep into how to use webpack and npm together with Visual Studi, and how to easily make your application realtime with Pusher. Before getting started it …

Web Services in C#, When HTML pages (or the HTML output generated by ASP.NET web Visual Studio will create a web service boilerplate (Service1.asmx and Right-click on Service1.asmx in Solution Explorer then select view mark up. ToolboxItem( false)]; // To allow this Web Service to be called from script, using ASP. Name the project WeatherApp, specify a target folder, and then click the OK button to create the project.. During the project creation process, Visual Studio creates a Solution for the project then uses the Cordova command line interface (CLI) and other tools to create the Cordova application project folder structure, add platforms to the project (Android, iOS, and Windows), and populates the

In Visual Studio, choose File > New > Project, expand the Visual C# > .NET Standard node, select the "Class Library (.NET Standard)" template, name the project AppLogger, and click OK. Tip Unless you have a reason to choose otherwise, .NET Standard is the preferred target for NuGet packages, as it provides compatibility with the widest range of

  • Not 100% sure if it will work, but can you run 2 instances of Visual Studio and launch each of the apps (web and desktop) at the same time? Ultimately, if you are expected to program a web app, and a desktop app, have them interact with each other, and debug the whole lot, your IT manager must allow you to run IIS Express / IIS. Otherwise they're not giving you the tools necessary to do your job.
  • Johnathan - surprisingly, such a simple solution works! You should add your solution as the Answer, and I will mark it as the answer. Took me a half hour to write the question, and the solution took a minute. Thanks!
  • Thanks - now I need to actually call the web service from the console app and console form app. But that is a separate question. Do you know of any existing StackOverflo questions on this? The questions that I have found are exceedingly complex. I like simple.
  • Carl0s - would you kindly expand on the "add new service reference" for me, or point me in the right direction?