I want to add a web service to my ASP.NET MVC 5
project.
I do that by right click on the project in solution explorer > add
> service reference
.
Then I add a web service url like this and it creates a new file in Service References
folder called ServiceReference1
Then I'm able to call web service methods in C# by using ServiceReference1
namespace and VS intellisense works.
The problem is that when I add this web service url, it adds a new namespace (ServiceReference2
) to that folder, but I can't call the new namespace and it says ServiceReference2 namespace could not be found
.
Is it me doing something wrong or the web service has a problem?
After you open your service window, click on the advanced button like below.
In general, I agree it's best not to use the older versions of web-services like I'm showing here, but in real life people have deadlines and such.
Saying that though, there is no huge drawback to using this tech, as long as performance isn't an issue.
Then, click 'add Web Reference' like the picture below.
Then enter URL and click on the little arrow button. Name your reference and click 'Add Reference'. see pic below
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With