powered by simpleCommunicator - 2.0.40     © 2025 Programmizd 02
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / The server did not return a response for this request.
1 сообщений из 1, страница 1 из 1
The server did not return a response for this request.
    #38992812
Pavluha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Есть служба с анонимной авторизацией.
Если отправлять запрос с корректным логином и паролем, то все работает отлично.
Если нет, то я получаю такую ошибку 504 - The server did not return a response for this request.


Если пользователь не авторизован, то я формирую ответ так:
Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
 private void CreateErrorReply(ref RequestContext requestContext)
        {
            using (var sr = new StringReader("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + ErrorHtml))
            {
                XElement response = XElement.Load(sr);
                using (Message reply = Message.CreateMessage(MessageVersion.None, null, response))
                {
                    var responseProp = new HttpResponseMessageProperty
                    {
                        StatusCode = HttpStatusCode.Forbidden,
                        StatusDescription = String.Format("Forbidden")
                    };
                    responseProp.Headers.Add("WWW-Authenticate", String.Format("Basic realm=\"{0}\"", Realm));
                    responseProp.Headers[HttpResponseHeader.ContentType] = "text/html";
                    reply.Properties[HttpResponseMessageProperty.Name] = responseProp;
                    requestContext.Reply(reply);

                    requestContext = null;
                }
            }
        }



но ответ нет и мое сообщение не приходит
Что не так?
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / The server did not return a response for this request.
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]