DmSer,
Использую следующий код:
procedure TForm1.ButtonLastUpdateClick(Sender: TObject);
var
ResponseOut: TStringStream;
httpRequest: TStrings;
begin
ResponseOut := TStringStream.Create;
httpRequest := TStringList.Create;
httpRequest.Text :=
'<?xml version="1.0" encoding="utf-8"?> ' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> ' +
' <soap:Body> ' +
' <LastUpdate xmlns="http://web.cbr.ru/" /> ' +
' </soap:Body> '+
'</soap:Envelope>';
with IdHTTPLastUpdate do
begin
Request.ContentEncoding := 'utf-8';
Request.ContentType := 'application/xml';
Request.Accept := 'text/xml';
Request.ContentLength := length(httpRequest.Text);
Request.ContentType := 'application/soap/xml; charset=utf-8';
Post('http://www.cbr.ru/CreditInfoWebServ/CreditOrgInfo.asmx', httpRequest,
ResponseOut);
end;
EditResult.Text := ResponseOut.DataString;
end;
Выдаёт ошибку:
HTTP/1.1 500 Internal Server ErrorС помощью SoapUI получаю верные данные:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LastUpdateResponse xmlns="http://web.cbr.ru/">
<LastUpdateResult>2019-12-16T23:27:10.043</LastUpdateResult>
</LastUpdateResponse>
</soap:Body>
</soap:Envelope>
Что в исходном коде неверно?