// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://webservice.jaron.cn/default.asmx?wsdl
// Encoding : utf-8
// Version  : 1.0
// (2007-12-29 19:37:56 - 1.33.2.5)
// ************************************************************************ //unit default2;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:dateTime        - "http://www.w3.org/2001/XMLSchema"  HistoryEventResult   = class;                 { "http://webservice.jaron.cn/" }  ArrayOfString = array of WideString;          { "http://webservice.jaron.cn/" }
  // ************************************************************************ //
  // Namespace : http://webservice.jaron.cn/
  // ************************************************************************ //
  HistoryEventResult = class(TRemotable)
  private
    Fschema: WideString;
  published
    property schema: WideString read Fschema write Fschema;
  end;
  // ************************************************************************ //
  // Namespace : http://webservice.jaron.cn/
  // soapAction: http://webservice.jaron.cn/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : JaronSoftWebServiceSoap
  // service   : JaronSoftWebService
  // port      : JaronSoftWebServiceSoap
  // URL       : http://webservice.jaron.cn/default.asmx
  // ************************************************************************ //
  JaronSoftWebServiceSoap = interface(IInvokable)
  ['{F418F789-8B98-8E13-5293-032853462BB9}']
    function  IP2Area(const IPAddress: WideString; const LicenceKey: WideString): ArrayOfString; stdcall;
    function  IdentityCard(const IdentityCardID: WideString; const LicenceKey: WideString): WideString; stdcall;
    function  HistoryEvent(const SetDateTime: TXSDateTime; const LicenceKey: WideString): HistoryEventResult; stdcall;
    function  MobileNumberConvert(const MobileNumber: WideString; const LicenceKey: WideString): ArrayOfString; stdcall;
  end;function GetJaronSoftWebServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): JaronSoftWebServiceSoap;
implementationfunction GetJaronSoftWebServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): JaronSoftWebServiceSoap;
const
  defWSDL = 'http://webservice.jaron.cn/default.asmx?wsdl';
  defURL  = 'http://webservice.jaron.cn/default.asmx';
  defSvc  = 'JaronSoftWebService';
  defPrt  = 'JaronSoftWebServiceSoap';
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
    Result := (RIO as JaronSoftWebServiceSoap);
    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;
initialization
  InvRegistry.RegisterInterface(TypeInfo(JaronSoftWebServiceSoap), 'http://webservice.jaron.cn/', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(JaronSoftWebServiceSoap), 'http://webservice.jaron.cn/%operationName%');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfString), 'http://webservice.jaron.cn/', 'ArrayOfString');
  RemClassRegistry.RegisterXSClass(HistoryEventResult, 'http://webservice.jaron.cn/', 'HistoryEventResult');end.

解决方案 »

  1.   

    function   GetJaronSoftWebServiceSoap(UseWSDL:   Boolean;   Addr:   string;   HTTPRIO:   THTTPRIO):   JaronSoftWebServiceSoap; 
    const 
        defWSDL   =   'http://webservice.jaron.cn/default.asmx?wsdl'; 
        defURL     =   'http://webservice.jaron.cn/default.asmx'; 
        defSvc     =   'JaronSoftWebService'; 
        defPrt     =   'JaronSoftWebServiceSoap'; 
    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 
            Result   :=   (RIO   as   JaronSoftWebServiceSoap); 
            if   UseWSDL   then 
            begin 
                RIO.WSDLLocation   :=   Addr; 
                RIO.Service   :=   defSvc; 
                RIO.Port   :=   defPrt; 
            end   else 
                RIO.URL   :=   Addr; 
            //在这里 RIO释放之前 
             RIO.MobileNumberConvert(参数);
        finally 
            if   (Result   =   nil)   and   (HTTPRIO   =   nil)   then 
                RIO.Free; 
        end; 
    end; //在这里 RIO释放之前 
      RIO.MobileNumberConvert(参数);
    这样调用就行了啊  你的function   GetJaronSoftWebServiceSoap(UseWSDL:   Boolean=System.False;   Addr:   string='';   HTTPRIO:   THTTPRIO   =   nil):   JaronSoftWebServiceSoap; 这个函数是后加的吧   WebService单元自动生成的时候没有  把这个函数写到你按钮同一个单元里 
      

  2.   

    刚才看错了 应该是定义个
    //按钮事件
    var
      MyRio:JaronSoftWebServiceSoap;
    begin
      MyRio:=default2.GetJaronSoftWebServiceSoap();
      MyRio.MobileNumberConvert();
      MyRio:=nil;
    end;
      

  3.   

    1、default2单元,是通过WDSL importer自动生成的接口申明单元,不用做任何修改,只需要在按钮所在单元中use default2即可。2、设计时,在按钮所在form中放入一个HTTPRIO控件(该控件在Web Services页面中),填写它的WDSLLocation属性和Name属性(如myRIO)。3、在按钮事件函数中:
    var
      rio: JaronSoftWebServiceSoap;
      myArrayStr: ArrayOfString;
    begin
      ...
      rio := myRIO as JaronSoftWebServiceSoap;
      myArrayStr := rio.MobileNumberConvert(MobileNumber, LicenceKey);
      ...
    end;