Проблема использования asmx webservice от классического ASP - PullRequest
0 голосов
/ 23 февраля 2019

При попытке использовать веб-сервис asmx (с веб-сайта asp.net) из классического asp я получаю приведенную ниже ошибку.Ошибка сервера в приложении '/'.

Ресурс не найден.

    [![IIS Server Error][1]][1]

Ниже приведен мой код страницы ServiceRequest.asp, который находится на моем классическом веб-сайте asp

<script type="text/javascript">
  function callService() {
            url = GetUrl("/WebService1.asmx/CallService")
            var xhr1 = new XMLHttpRequest();
            xhr1.open("POST", url);
            xhr1.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
            xhr1.onreadystatechange = function () {
                if (xhr1.readyState == XMLHttpRequest.DONE && xhr1.status === 200) {
                    //var outputData = JSON.parse(JSON.parse(xhr1.responseText).d);
                    var outputData = JSON.parse(xhr1.responseText).d;

                    alert(outputData);
                    //Here the response object needs to be read
                } else if (xhr1.readyState == XMLHttpRequest.DONE && xhr1.status != 200) {

                    //In case of SAP call failure, alert the user
                    alert("Vendor creation failed");
                }
            };

            xhr1.send(JSON.stringify({
                sVndNum: "",
                sVndName: "",
                sCoCode: "",
                sVndCity: "",
                sVndPstlCd: "",
                sVndState: "",
                sVndCntry: ""
            }));
        }

        function GetUrl(url) {
            return window.location.origin + url;
        }
    </script>


Both the classic asp application and Asp.net website which has my webservice are hosted in IIS. When I tried to access service method from classic page i am getting the below error response at service side.

Ошибка сервера в «/» приложении.

   [ParseError][2]    


      [1]: https://i.stack.imgur.com/XIKR4.png
      [2]: https://i.stack.imgur.com/4YQtj.png
...