0

I've recently set up a basic web service project in Visual Studio, and published to Azure.

I'm trying to view the result of the default HelloWorld method in browser, but receive the following error:

Server Error in '/' Application.

The URL i'm trying to reach to view the content is (mywebsite is not the real domain, but path is the same):

http://services.mywebsite.co.uk/portal/Default.asmx/HelloWorld

The project is set up like this: enter image description here

If I navigate to just Default.asmx (without the HelloWorld), it does work, but only is the service description:

enter image description here

All I am trying to do with this little toy project is to query a database, put some raw data on the browser page for an Android app to read (But, that's beyond the scope of this question).

W.H
  • 187
  • 2
  • 4
  • 15
  • You are trying to `GET` but by default an .asmx only allows `POST`. Click on the *HelloWorld* operation link and you will see supported methods. – Filburt Feb 07 '17 at 10:15
  • Thanks @Filburt , what type of page will allow GET operations - and how would I make one? – W.H Feb 07 '17 at 10:36
  • [Enable ASP.NET ASMX web service for HTTP POST / GET requests](http://stackoverflow.com/a/5377227/205233) has the answer. – Filburt Feb 07 '17 at 11:14
  • Adding UseHttpGet = true as per the post does not work for me, same error. – W.H Feb 07 '17 at 11:24
  • I tried adding the `protocol` (under `location` ...) to my web.config and it worked. It may as well be that hosting an .asmx on azure has limitations - MS trying to steer away from this rather outdated technology. – Filburt Feb 07 '17 at 11:34
  • Any alternatives to the outdated technology, for what I'm trying to do? (Just display some raw XML or JSON on a web-page) – W.H Feb 07 '17 at 11:37
  • 1
    Possible duplicate of [Enable ASP.NET ASMX web service for HTTP POST / GET requests](http://stackoverflow.com/questions/618900/enable-asp-net-asmx-web-service-for-http-post-get-requests) – Anders Marzi Tornblad Feb 07 '17 at 11:51
  • @AndersTornblad It's not a duplicate, see comments above - solution is not the same – W.H Feb 07 '17 at 14:20
  • According to MS it's [ASP.NET Web API](https://blogs.msdn.microsoft.com/martinkearn/2015/01/05/introduction-to-rest-and-net-web-api/) you should use/create nowadays. – Filburt Feb 08 '17 at 11:36

0 Answers0