Error Trying To Access Webservice

Asked

Viewed 812 times

0

I have the following problem,I have an asmx Webservice, posted on an IIS,with the authentication setting set as Anonymous,but when I try to access it appears the following error:

inserir a descrição da imagem aqui

You need to be able to access this Webservice to perform some tests.

Thank you since.

  • Release CORS from your application and disable authentication. This problem can also be to access the folders on your server.

  • Your webservice is an asmx. wcf or a Rest api?

  • @Leandroangelo this is an asmx.

  • Access it with the full path to . asmx and add a ? wsdl at the end

  • I just tested and needed access to the full path thanks for helping anyway

  • Is this address only for this webservice or do you have an asmx? you can add this file as default on IIS.

  • Yes this address is unique to this Webservice, if I add as default it redirects you ?

  • @Victoraugusto See the answer below.

Show 3 more comments

1 answer

0


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.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

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>
  • Now it was clear the occurrence of Leandro error, I will set WS as the default of this site for testing. Thanks for the clarification ,Abs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.