私はDelphi 2010で1つのWebサービスを使用しようとしています。 このWebサービスは、認証でポート8000にあります。認証でWebサービスを消費しています。認証が必要です。
私は
function TForm4.EncodeLoginPW(const ALogin, APW: string): string;
begin
Result := EncdDecd.EncodeString(ALogin + ':' + APW); // EncdDecd is not documented in
end;
procedure TForm4.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp;
Data: Pointer);
var
s: string;
begin
s := 'Authorization: Basic ' + EncodeLoginPW(UserName, Password);
if not HttpAddRequestHeaders(Data, PChar(s), Length(s), HTTP_ADDREQ_FLAG_ADD) then
ShowMessage('HttpAddRequestHeaders' + SysErrorMessage(GetLastError()));
end;
を実装するが、私はまだメッセージ "認証に必要な" を持っています。
何か問題がありますか?
どの認証タイプですか? URLとポートを指定してウェブブラウザからリクエストを正常に実行できますか? – mjn
反認証タイプは基本的です。 –
ウェブブラウザからサービスURLに「手動」リクエストを実行できますか? (ブラウザは通常、認証を求めます) – mjn