By default IIS does not have the extension. asmx in the list of standard documents of the website, in your case, because there is no default as the last alternative it will try to display the list of documents of the directory. As this feature by default is not enabled you get the error message presented in your question.
To access your service you must use the full path of your asmx.
Another alternative, very unusual, but in case this address is exclusive to provide this web service or that is its main function. Add it to the list of standard documents by following the steps illustrated below.
However, it is always recommended to provide the complete file path as many programs need to access endpoint with the extension .asmx
plus the query ?wsdl
to be able to map endpoints and reflect the object structure of their contracts.
If you wanted to leave this WS as your site’s defult, Add it to the list of standard documents by following the steps illustrated below.
If you don’t have direct access to the IIS Manager, you can try to pass the instruction on your Web.config
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="nome_do_seuWS.asmx"/>
</files>
</defaultDocument>
</system.webServer>
Release CORS from your application and disable authentication. This problem can also be to access the folders on your server.
– Maycon F. Castro
Your webservice is an asmx. wcf or a Rest api?
– Leandro Angelo
@Leandroangelo this is an asmx.
– Victor Augusto
Access it with the full path to . asmx and add a ? wsdl at the end
– Leandro Angelo
I just tested and needed access to the full path thanks for helping anyway
– Victor Augusto
Is this address only for this webservice or do you have an asmx? you can add this file as default on IIS.
– Leandro Angelo
Yes this address is unique to this Webservice, if I add as default it redirects you ?
– Victor Augusto
@Victoraugusto See the answer below.
– Leandro Angelo