这是我通过WSDL导入的代码:
....function GetDhsbServicePort(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): DhsbServicePort;
const
  defWSDL = 'http://192.100.99.108/webservice_dhsb/DhsbService?wsdl';
  defURL  = 'http://192.100.99.108:80/webservice_dhsb/DhsbService';
  defSvc  = 'DhsbService';
  defPrt  = 'DhsbServicePort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    //下面的两句是我手工加的
    RIO.HTTPWebNode.UserName := 'abcd';
    RIO.HTTPWebNode.Password := '11111111';    Result := (RIO as DhsbServicePort);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;
...我通过IE来访问是没有问题的,服务器端是WebLogic8 用Java写的我的程序总是报出"Unauthorized xxx(401)的错误,也就是说客服务端不能登录上去

解决方案 »

  1.   

    http://www-106.ibm.com/developerworks/db2/library/techarticle/0305swart/0305swart.html
      

  2.   

    to aiirii(ari-爱的眼睛) :
       您说的这篇文章,我看了一遍。thanks
       我的delphi6是打了sp2的补丁的,另外我用delphi7试过,也是同样的问题呀!
     其中的login只不过是数据库验证的一个例子,现在的问题是登录其Web Service需要进行身份验证,而且HTTRPIO有一个username与password的属性,但是就是通不过其身份验证呀!