0

I have created an ASP.NET Web Application (.NET Framework) in my Visual Studio 2019.

Now I want to call this web service using a client application. I click on 'References' --> 'Add reference to service' and I have to input an address of my web service. Where can I find it? Is there a .config file or something?

wazz
  • 4,953
  • 5
  • 20
  • 34
  • Are you creating a `Web Api`? I.e. do you have a project using `Controllers` etc.? When `debugging` locally (pressing *play* in VS) you can find its address in the properties of the web project in the `Debug` tab. If this is what you're referring to you *cannot* add a `service reference` to it, you make calls to your found address over `HTTP` with `JSON` or `XML` by default. You could test it via a browser if you have an `HTTP GET` method. – Aage Oct 26 '19 at 12:40
  • Yes, I am creating a Web Api using Controllers etc. Ok, so I cannot add a service reference then, I would like to make calls over XML. As I understand my client application has to send XML messages. Do you have any examples, tutorials how to do it? Currently I am testing my services using swagger. – Evelek Eve Oct 26 '19 at 13:27
  • You can also use `JSON`. Check out this example, you can run your web project from one project and maybe this example from another (whilst the Api is running):https://stackoverflow.com/questions/9620278/how-do-i-make-calls-to-a-rest-api-using-c – Aage Oct 26 '19 at 17:00

0 Answers0