1,593
社区成员
发帖
与我相关
我的任务
分享
问题就在这里你确定http://localhost:8080/jscbmis/services/ExamService 是你的Namespace?
InvRegistry.RegisterInterface(TypeInfo(IRemoteDataService), 'http://localhost:8080/jscbmis/services/ExamService ', 'utf-8 ');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IRemoteDataService), 'http://localhost:8080/jscbmis/services/ExamService/%operationName% ');
procedure TmainForm.BtnSaveDBClick(Sender: TObject);
var
soaptemp:IRemoteDataService;
begin
soaptemp := HTTPRIO1 as IRemoteDataService;
soaptemp.WSDLLocation:= 'http://localhost:8080/jscbmis/services/ExamService?WSDL';
showmessage(soaptemp.getName( 'bruce '));
end;
我用delphi做过调用java webservice的东西,这个是我导入WSDL的代码
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : D:\projects\WSDL\Veh.wsdl.xml
// Encoding : UTF-8
// Version : 1.0
// (2007-7-9 10:06:50 - 1.33.2.5)
// ************************************************************************ //
unit ImplVeh;
interface
uses 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"
// !:int - "http://www.w3.org/2001/XMLSchema"
// !:long - "http://www.w3.org/2001/XMLSchema"
// ************************************************************************ //
// Namespace : http://service.ws.tmri.com
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : VehSoapBinding
// service : VehService
// port : Veh
// URL : http://10.160.118.40:9080/ServicePlatform/services/Veh
// ************************************************************************ //
Veh = interface(IInvokable)
['{032969C0-190F-A5B1-F79D-17283635E2AC}']
function getVehWorkPart(const hpzl: WideString; const hphm: WideString; const sn: WideString): WideString; stdcall;
function getVehWorkFull(const hpzl: WideString; const hphm: WideString; const sn: WideString): WideString; stdcall;
function write_vehicle_zt(const hpzl: WideString; const hphm: WideString; const zt: WideString; const bj: Integer; const sn: WideString): WideString; stdcall;
function wrtie_vehcheckmid(const hpzl: WideString; const hphm: WideString; const clsbdh: WideString; const jyjg: WideString; const jyrq: WideString; const cjdw: WideString; const sn: WideString): WideString; stdcall;
function getVehQueryFull(const hpzl: WideString; const hphm: WideString; const sn: WideString): WideString; stdcall;
function write_vehicle_hphm_sn(const hpzl: WideString; const hphm: WideString; const jbr: WideString; const sn: WideString): WideString; stdcall;
function getVehFlow(const glbm: WideString; const xygw: WideString; const sn: WideString): WideString; stdcall;
function getVehQueryPart(const hpzl: WideString; const hphm: WideString; const sn: WideString): WideString; stdcall;
function getVehimage(const hpzl: WideString; const hphm: WideString; const sn: WideString): WideString; stdcall;
function write_vehimage(const hpzl: WideString; const hphm: WideString; const zp: WideString; const sn: WideString): WideString; stdcall;
function write_bxxx(const hpzl: WideString; const hphm: WideString; const clsbdh: WideString; const bxpzh: WideString; const bxje: Int64; const sxrq: WideString; const zzrq: WideString; const bxgs: WideString; const sn: WideString): WideString; stdcall;
end;
function GetVeh(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): Veh;
implementation
function GetVeh(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): Veh;
const
defWSDL = 'D:\projects\WSDL\Veh.wsdl.xml';
defURL = 'http://10.160.118.40:9080/ServicePlatform/services/Veh';
defSvc = 'VehService';
defPrt = 'Veh';
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 Veh);
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(Veh), 'http://service.ws.tmri.com', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Veh), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(Veh), ioLiteral);
end.