Q&A

  • idhttp 를 이용해서 로그인하는 법점...
idhttp 를 이용해서 로그인 을 하려고 합니다..

POST /test.asmx HTTP/1.1
Host: www.test.co.kr
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.test.co.kr/test_LoginLink2'"

<?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>
    <TaxInvoice_LoginLink2 xmlns="http://www.test.co.kr/">
      <sLoginCD>string</sLoginCD>
      <sLoginPA>string</sLoginPA>
      <sBusinessID>string</sBusinessID>
      <sTargetKey>string</sTargetKey>
      <sERPCom>string</sERPCom>
    </TaxInvoice_LoginLink2>
  </soap:Body>
</soap:Envelope>

-----------------------------------------------------------------------------------------------------
procedure TForm1.Button4Click(Sender: TObject);
var
  data: TIdMultiPartFormDataStream;
  IdHTTP1 : TIdHttp;
begin
    IdHTTP1 := TIdHttp.Create(self);
    IdHTTP1.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; '+
              'SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; '+
              '.NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)';
    data := TIdMultiPartFormDataStream.Create;
    try

    data.AddFormField('sLoginCD', test);
    data.AddFormField('sLoginPA', 'test');
    data.AddFormField('sBusinessID', 'test');
    data.AddFormField('sTargetKey', '1');
    data.AddFormField('sERPCom', '1');
    Memo1.Lines.Text := IdHTTP1.Post('http://test.aaa.co.kr/test.asmx/test_LoginLink2', data);
    finally
    data.Free;
    end;
end;

실행하면 http/1.1 500 이란 에러가 납니다...
에러 점 잡아 주세요..
0  COMMENTS