How to create web service (server & Client) in Visual Studio 2012? like being done before 2012 as http://www.tutorialspoint.com/asp.net/asp.net_web_services.htm
-
I'm voting to close this question as off-topic because I had asked the question when I had recently started my career and was using M.S. Visual Studio 2012; now latest version 2019 is available hence wanted to close this thread. – Sachin Warke Jun 20 '19 at 07:47
-
I also apologize for delayed reply to accept the answer; actually I had got the solution with my friends at that time but it was my bad that I didn't updated this thread, I was fresher and didn't know how to use these kind of forums. After that I had changed my role in my career and was not using development forums. I publicly apologize here and will take care of it in future. – Sachin Warke Jun 20 '19 at 07:51
4 Answers
When creating a New Project, under the language of your choice, select Web and then change to .NET Framework 3.5 and you will get the option of creating an ASP.NET WEB Service Application.
-
7Why hasn't the guy who asked question accepted this as the right Answer. Anyway thanks – Dawood Awan Aug 24 '13 at 08:24
-
-
3This is technically correct, but NOT a perfect answer. Switching to .Net 3.5 is not the right solution. The answer by Vincenzo Costa better suits the question. – Piyush Soni Feb 18 '15 at 18:48
-
Can a asp.net web application be created embedding C++ code(using C++ code) in it. – Jul 16 '16 at 05:28
- Create a new empty Asp.NET Web Application.
- Solution Explorer right click on the project root.
- Choose the menu item Add-> Web Service

- 5,294
- 1
- 25
- 29

- 930
- 11
- 17
-
This is the current method if not switching back to an older .NET framework. You can add a web service .asmx file to any ASP.NET project as a `New Item`. – atconway Nov 07 '13 at 18:46
-
1tried, has not worked ( i have no web service in Add - neither in project nor solution) – Offler Jan 27 '14 at 13:17
-
3
-
-
See https://msdn.microsoft.com/en-us/library/14hykb68(v=vs.80).aspx and http://stackoverflow.com/questions/6542676/web-services-in-c-and-c – Vincenzo Costa Jul 18 '16 at 16:34
WCF is a newer technology that is a viable alternative in many instances. ASP is great and works well, but I personally prefer WCF. And you can do it in .Net 4.5.
Create a new project.
Right-Click on the project in solution explorer, select "Add Service Reference"
Create a textbox and button in the new application. Below is my click event for the button:
private void btnGo_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client testClient = new ServiceReference1.Service1Client();
//Add error handling, null checks, etc...
int iValue = int.Parse(txtInput.Text);
string sResult = testClient.GetData(iValue).ToString();
MessageBox.Show(sResult);
}
And you're done.

- 1,313
- 16
- 26
-
-
What you write is correct, but is out of the scope of the question. I had the same problem: need to rewrite a Web service that is consumed as an classic Web service, and cannot be updated to WCF as we do not control client side. – Robert Mar 04 '16 at 07:29
-
@Robert I don't see "Classic" or "ASP" in the title or question. I see "How to create web service (server & Client) in Visual Studio 2012?" I believe I also stated "viable alternative in many cases." Not *all* cases. It obviously didn't meet your needs, but you are not on an ASP tagged post. You are on a web services tagged post. This is a web service. Your point is noted, but I must disagree. – Aaron Apr 27 '16 at 13:50
--- create a ws server vs2012 upd 3
new project
choose .net framework 3.5
asp.net web service application
right click on the project root
choose add service reference
choose wsdl
--- how can I create a ws client from a wsdl file?
I´ve a ws server Axis2 under tomcat 7 and I want to test the compatibility

- 8,010
- 6
- 31
- 40

- 790
- 5
- 14
-
5Is this an answer to the question or a new question? If it's a question you should ask a new question. – Robert Longson Jul 16 '13 at 07:47