客户这边提供给我的地址是 : http://ehr.xxx.com.cn/xxx/services/EmpService?wsdl
这个路径里的部分内容是:<wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://employee.api.webservices.talentbase.neusoft.com/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://employee.services.webservices.talentbase.neusoft.com/xsd" xmlns:axis2="http://employee.services.webservices.talentbase.neusoft.com" targetNamespace="http://employee.services.webservices.talentbase.neusoft.com">
  <wsdl:documentation>employee info</wsdl:documentation>  
- <wsdl:types>
- <xs:schema xmlns:ax21="http://employee.api.webservices.talentbase.neusoft.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://employee.api.webservices.talentbase.neusoft.com/xsd">
  <xs:element name="EmpInfo" type="ns0:EmpInfo" />  
- <xs:complexType name="EmpInfo">
- <xs:sequence>
  <xs:element name="age" nillable="true" type="xs:string" />  
  <xs:element name="beginWorkDate" nillable="true" type="xs:string" />  
  <xs:element name="birthPlace" nillable="true" type="xs:string" />  
  <xs:element name="birthday" nillable="true" type="xs:string" />  
  <xs:element name="cardType" nillable="true" type="xs:string" />  
  <xs:element name="code" nillable="true" type="xs:string" />  
  <xs:element name="contactPeople" nillable="true" type="xs:string" />  
  <xs:element name="contractBody" nillable="true" type="xs:string" />  
  <xs:element name="degree" nillable="true" type="xs:string" />  
  <xs:element name="dispatch" nillable="true" type="xs:string" />  
  <xs:element name="email" nillable="true" type="xs:string" />  
  <xs:element name="employeeStatus" nillable="true" type="xs:string" />  
  <xs:element name="employeeType" nillable="true" type="xs:string" />  
  <xs:element name="enddate" nillable="true" type="xs:string" />  
  <xs:element name="englishLevel" nillable="true" type="xs:string" />  
  <xs:element name="entryType" nillable="true" type="xs:string" />  
  <xs:element name="firstName" nillable="true" type="xs:string" />  
  <xs:element name="gender" nillable="true" type="xs:string" />  
  <xs:element name="hireDate" nillable="true" type="xs:string" />  
  <xs:element name="idCardAddress" nillable="true" type="xs:string" />  
  <xs:element name="idcard" nillable="true" type="xs:string" />  
  <xs:element name="ifSensitive" nillable="true" type="xs:string" />  
  <xs:element name="jobClass" type="xs:long" />  
  <xs:element name="jobCode" nillable="true" type="xs:string" />  
  <xs:element name="jobGradeType" nillable="true" type="xs:string" />  
  <xs:element name="jobID" type="xs:long" />  
  <xs:element name="jobIndex" nillable="true" type="xs:string" />  
  <xs:element name="jobLevel" nillable="true" type="xs:string" />  
  <xs:element name="jobName" nillable="true" type="xs:string" />  
  <xs:element name="jobSeniority" type="xs:long" />  
  <xs:element name="joinJobDate" nillable="true" type="xs:string" />  
  <xs:element name="joinUnitDate" nillable="true" type="xs:string" />  
  <xs:element name="keyUser" nillable="true" type="xs:string" />  
  <xs:element name="knowledge" nillable="true" type="xs:string" />  
  <xs:element name="lastName" nillable="true" type="xs:string" />  
  <xs:element name="marital" nillable="true" type="xs:string" />  
  <xs:element name="middleName" nillable="true" type="xs:string" />  
  <xs:element name="name" nillable="true" type="xs:string" />  
  <xs:element name="nation" nillable="true" type="xs:string" />  
  <xs:element name="nationality" nillable="true" type="xs:string" />  
  <xs:element name="nativePlace" nillable="true" type="xs:string" />  
  <xs:element name="oid" type="xs:long" />  
  <xs:element name="operateTime" nillable="true" type="xs:string" />  
  <xs:element name="operator" type="xs:long" />  
  <xs:element name="orgCode" nillable="true" type="xs:string" />  
  <xs:element name="orgID" type="xs:long" />  
  <xs:element name="orgName" nillable="true" type="xs:string" />  
  <xs:element name="origin" nillable="true" type="xs:string" />  
  <xs:element name="parttime" nillable="true" type="xs:string" />  
  <xs:element maxOccurs="unbounded" name="parttimeInfo" nillable="true" type="ns0:ParttimeVO" />  
  <xs:element name="passPort" nillable="true" type="xs:string" />  
  <xs:element name="polity" nillable="true" type="xs:string" />  
  <xs:element name="positionType" nillable="true" type="xs:string" />  
  <xs:element name="pracetice" nillable="true" type="xs:string" />  
  <xs:element name="regresidence" nillable="true" type="xs:string" />  
  <xs:element name="re" nillable="true" type="xs:string" />  
  <xs:element name="sourceType" nillable="true" type="xs:string" />  
  <xs:element name="specialty" nillable="true" type="xs:string" />  
  <xs:element name="status" nillable="true" type="xs:string" />  
  <xs:element name="systemID" type="xs:long" />  
  <xs:element name="tele" nillable="true" type="xs:string" />  
  <xs:element name="transfer" nillable="true" type="xs:string" />  
  <xs:element name="unitCode" nillable="true" type="xs:string" />  
  <xs:element name="unitID" type="xs:long" />  
  <xs:element name="unitName" nillable="true" type="xs:string" />  
  <xs:element name="usedName" nillable="true" type="xs:string" />  
  <xs:element name="weave" nillable="true" type="xs:string" />  
  <xs:element name="workSeniority" nillable="true" type="xs:string" />  
  </xs:sequence>
  </xs:complexType>
  <xs:element name="ParttimeVO" type="ns0:ParttimeVO" />  然后我通过DELPHI的webservice的WSDL importer 导入这个路径的内容,发现生成的单元里面的内容如下:// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://ehr.xxx.com.cn/xxx/services/EmpService?wsdl
// (2010/08/02 15:20:38 - 1.33.2.5)
// ************************************************************************ //unit EmpService;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.
  // ************************************************************************ //
implementationinitializationend.  没有任何的函数定义,和以前使用飞信的接口不一样的,请问大家这种webservice格式要如何与delphi关联起来呢?

解决方案 »

  1.   

    你的webservice问题真的多。几个帖子!
    不要在不同的帖子里问同样的问题。而且以前的问题要结贴了!
      

  2.   

    我重新描述一下这个wsdl文件的内容:
    (地址是:http://ehr.xxxxx.com.cn/xxxxx/services/EmpService?wsdl)- <wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://employee.api.webservices.talentbase.neusoft.com/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://employee.services.webservices.talentbase.neusoft.com/xsd" xmlns:axis2="http://employee.services.webservices.talentbase.neusoft.com" targetNamespace="http://employee.services.webservices.talentbase.neusoft.com">
      <wsdl:documentation>employee info</wsdl:documentation> 
    - <wsdl:types>
    - <xs:schema xmlns:ax21="http://employee.api.webservices.talentbase.neusoft.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://employee.api.webservices.talentbase.neusoft.com/xsd">
      <xs:element name="EmpInfo" type="ns0:EmpInfo" /> 
    - <xs:complexType name="EmpInfo">.....................................
    {****************这是一个结构类型************************}- <xs:complexType name="EmployeeVO">
    - <xs:sequence>
      <xs:element name="addOn1" nillable="true" type="xs:string" /> 
      <xs:element name="addOn2" nillable="true" type="xs:string" /> 
      <xs:element name="addOn3" nillable="true" type="xs:string" /> 
      <xs:element name="addOn4" nillable="true" type="xs:string" /> 
      <xs:element name="addOn5" nillable="true" type="xs:string" /> 
      <xs:element name="code" nillable="true" type="xs:string" /> 
      <xs:element name="employeeStatus" nillable="true" type="xs:string" /> 
      <xs:element name="gender" nillable="true" type="xs:string" /> 
      <xs:element name="hireDate" nillable="true" type="xs:string" /> 
      <xs:element name="jobCode" nillable="true" type="xs:string" /> 
      <xs:element name="jobID" type="xs:long" /> 
      <xs:element name="jobName" nillable="true" type="xs:string" /> 
      <xs:element name="name" nillable="true" type="xs:string" /> 
      <xs:element name="oid" type="xs:long" /> 
      <xs:element name="unitCode" nillable="true" type="xs:string" /> 
      <xs:element name="unitID" type="xs:long" /> 
      <xs:element name="unitName" nillable="true" type="xs:string" /> 
      </xs:sequence>
      </xs:complexType>..................................................{********************这是一个函数的声明********************}- <xs:element name="getEmployeeByUnit">
    - <xs:complexType>
    - <xs:sequence>
      <xs:element name="unitID" nillable="true" type="xs:long" /> 
      </xs:sequence>
      </xs:complexType>
      </xs:element>.........................................
    - <wsdl:service name="EmpService">
    - <wsdl:port name="EmpServiceSOAP11port_http" binding="axis2:EmpServiceSOAP11Binding">
      <soap:address location="http://ehr.xxxxx.com.cn:80/xxxxx/services/EmpService" /> 
      </wsdl:port>
    - <wsdl:port name="EmpServiceSOAP12port_http" binding="axis2:EmpServiceSOAP12Binding">
      <soap12:address location="http://ehr.xxxxx.com.cn:80/xxxxx/services/EmpService" /> 
      </wsdl:port>
    - <wsdl:port name="EmpServiceHttpport1" binding="axis2:EmpServiceHttpBinding">
      <http:address location="http://ehr.xxxxx.com.cn:80/xxxxx/rest/EmpService" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>============================================================================
    然后我在DELPHI 的定义如下:{ Invokable interface IfWebxxxxx }unit fWebxxxxxIntf;interface 
    uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
    type
      EmployeeVO=record
        oid:integer;
        code:string;
        name:string;
        unitID:integer;
        jobID:integer;
        gender:string; 
        hireDate:string;
        tele:string;
        email:string;
        dn:string;
        employeeStatus:string; 
      end;
    type
      Ary_EmployeeVO=array of EmployeeVO;
     
      
    type  { Invokable interfaces must derive from IInvokable }
      IfWebxxxxx = interface(IInvokable)
      ['{C5CA59B0-F56C-4E83-BF1F-1371C500E483}']
        //function  Login(const xno: WideString; const fpass: WideString): WideString; stdcall;
        function getEmployeeByUnit(unitID:integer):Ary_EmployeeVO;stdcall;
        { Methods of Invokable interface must not use the default }
        { calling convention; stdcall is recommended }
      end;function GetIfWebxxxxxSerSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): IfWebxxxxx;
    implementationfunction GetIfWebxxxxxSerSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): IfWebxxxxx;
    const
      defWSDL = 'http://ehr.xxxxx.com.cn/xxxxx/services/EmpService?wsdl';
      defURL  = 'http://ehr.xxxxx.com.cn/xxxxx/services/EmpService?wsdl';
      defSvc  = 'EmpService';
      defPrt  = 'EmpServiceSOAP12port_http';
    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 IfWebxxxxx);
        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
      { Invokable interfaces must be registered }
      InvRegistry.RegisterInterface(TypeInfo(IfWebxxxxx));end.====================================================================
    最后我是这样调用的:procedure TsmsForm.Button3Click(Sender: TObject);
    var
      f:IfWebxxxxx;
      ayEmp:Ary_EmployeeVO;
    begin
      SetLength(ayEmp,2000);
      f:=GetIfWebxxxxxSerSoap;
      ayEmp:=f.getEmployeeByUnit(1038501017);
    end;
    执行的时候提示错误:
    WSDoAllReceiver: Incoming message does not contain required Security请问是哪里出了问题呢?
      

  3.   

    执行的时候提示错误:
    WSDoAllReceiver: Incoming message does not contain required Security...WSDoAllReceiver:信息不包含安全的必要...我好像沒有看見你GetServiceSoap方法的定義初始化代碼...eg:varaa:ServiceSoap;aa:=GetServiceSoap(False,'',nil); 
      

  4.   

    f:=GetIfWebxxxxxSerSoap; 这个就是初始化的函数