1,593
社区成员
发帖
与我相关
我的任务
分享
unit uploadFileService1;
interface
uses Soap.InvokeRegistry, Soap.SOAPHTTPClient, System.Types, Soap.XSBuiltIns;
const
IS_OPTN = $0001;
IS_UNQL = $0008;
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 Embarcadero types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:base64Binary - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
cxfFileWrapper2 = class; { "http://webServices.taiyu.com/"[GblCplx] }
cxfFileWrapper = class; { "http://webServices.taiyu.com/"[GblElm] }
// ************************************************************************ //
// XML : cxfFileWrapper, global, <complexType>
// Namespace : http://webServices.taiyu.com/
// ************************************************************************ //
cxfFileWrapper2 = class(TRemotable)
private
FfileName: string;
FfileName_Specified: boolean;
FfileExtension: string;
FfileExtension_Specified: boolean;
FbatchNumber: string;
FbatchNumber_Specified: boolean;
Fmsg: string;
Fmsg_Specified: boolean;
Ffile_: TByteDynArray;
Ffile__Specified: boolean;
procedure SetfileName(Index: Integer; const Astring: string);
function fileName_Specified(Index: Integer): boolean;
procedure SetfileExtension(Index: Integer; const Astring: string);
function fileExtension_Specified(Index: Integer): boolean;
procedure SetbatchNumber(Index: Integer; const Astring: string);
function batchNumber_Specified(Index: Integer): boolean;
procedure Setmsg(Index: Integer; const Astring: string);
function msg_Specified(Index: Integer): boolean;
procedure Setfile_(Index: Integer; const ATByteDynArray: TByteDynArray);
function file__Specified(Index: Integer): boolean;
published
property fileName: string Index (IS_OPTN or IS_UNQL) read FfileName write SetfileName stored fileName_Specified;
property fileExtension: string Index (IS_OPTN or IS_UNQL) read FfileExtension write SetfileExtension stored fileExtension_Specified;
property batchNumber: string Index (IS_OPTN or IS_UNQL) read FbatchNumber write SetbatchNumber stored batchNumber_Specified;
property msg: string Index (IS_OPTN or IS_UNQL) read Fmsg write Setmsg stored msg_Specified;
property file_: TByteDynArray Index (IS_OPTN or IS_UNQL) read Ffile_ write Setfile_ stored file__Specified;
end;
// ************************************************************************ //
// XML : cxfFileWrapper, global, <element>
// Namespace : http://webServices.taiyu.com/
// ************************************************************************ //
cxfFileWrapper = class(cxfFileWrapper2)
private
published
end;
// ************************************************************************ //
// Namespace : http://webServices.taiyu.com/
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// use : literal
// binding : UploadFileServiceServiceSoapBinding
// service : UploadFileServiceService
// port : UploadFileServicePort
// URL : http://192.168.0.130/dmsi/services/uploadFileService
// ************************************************************************ //
UploadFileService = interface(IInvokable)
['{77050B9A-BC13-820B-85F0-0822437B1F4D}']
procedure isTransferFlag(const arg0: cxfFileWrapper); stdcall;
function getTransferDmsi(const arg0: cxfFileWrapper): cxfFileWrapper; stdcall;
end;
function GetUploadFileService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): UploadFileService;
implementation
uses System.SysUtils;
function GetUploadFileService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): UploadFileService;
const
defWSDL = 'http://192.168.0.130/dmsi/services/uploadFileService?wsdl';
defURL = 'http://192.168.0.130/dmsi/services/uploadFileService';
defSvc = 'UploadFileServiceService';
defPrt = 'UploadFileServicePort';
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 UploadFileService);
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;
procedure cxfFileWrapper2.SetfileName(Index: Integer; const Astring: string);
begin
FfileName := Astring;
FfileName_Specified := True;
end;
function cxfFileWrapper2.fileName_Specified(Index: Integer): boolean;
begin
Result := FfileName_Specified;
end;
procedure cxfFileWrapper2.SetfileExtension(Index: Integer; const Astring: string);
begin
FfileExtension := Astring;
FfileExtension_Specified := True;
end;
function cxfFileWrapper2.fileExtension_Specified(Index: Integer): boolean;
begin
Result := FfileExtension_Specified;
end;
procedure cxfFileWrapper2.SetbatchNumber(Index: Integer; const Astring: string);
begin
FbatchNumber := Astring;
FbatchNumber_Specified := True;
end;
function cxfFileWrapper2.batchNumber_Specified(Index: Integer): boolean;
begin
Result := FbatchNumber_Specified;
end;
procedure cxfFileWrapper2.Setmsg(Index: Integer; const Astring: string);
begin
Fmsg := Astring;
Fmsg_Specified := True;
end;
function cxfFileWrapper2.msg_Specified(Index: Integer): boolean;
begin
Result := Fmsg_Specified;
end;
procedure cxfFileWrapper2.Setfile_(Index: Integer; const ATByteDynArray: TByteDynArray);
begin
Ffile_ := ATByteDynArray;
Ffile__Specified := True;
end;
function cxfFileWrapper2.file__Specified(Index: Integer): boolean;
begin
Result := Ffile__Specified;
end;
initialization
{ UploadFileService }
InvRegistry.RegisterInterface(TypeInfo(UploadFileService), 'http://webServices.taiyu.com/', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(UploadFileService), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(UploadFileService), ioLiteral );
{ UploadFileService.isTransferFlag }
InvRegistry.RegisterParamInfo(TypeInfo(UploadFileService), 'isTransferFlag', 'arg0', '',
'[Namespace="http://webServices.taiyu.com/"]');
{ UploadFileService.getTransferDmsi }
InvRegistry.RegisterParamInfo(TypeInfo(UploadFileService), 'getTransferDmsi', 'arg0', '',
'[Namespace="http://webServices.taiyu.com/"]');
InvRegistry.RegisterParamInfo(TypeInfo(UploadFileService), 'getTransferDmsi', 'return', '',
'[Namespace="http://webServices.taiyu.com/"]');
RemClassRegistry.RegisterXSClass(cxfFileWrapper2, 'http://webServices.taiyu.com/', 'cxfFileWrapper2', 'cxfFileWrapper');
RemClassRegistry.RegisterExternalPropName(TypeInfo(cxfFileWrapper2), 'file_', '[ExtName="file"]');
RemClassRegistry.RegisterXSClass(cxfFileWrapper, 'http://webServices.taiyu.com/', 'cxfFileWrapper');
end.
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://webServices.taiyu.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="UploadFileServiceService" targetNamespace="http://webServices.taiyu.com/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webServices.taiyu.com/" targetNamespace="http://webServices.taiyu.com/" version="1.0">
<xs:element name="cxfFileWrapper" type="tns:cxfFileWrapper"/>
<xs:complexType name="cxfFileWrapper">
<xs:sequence>
<xs:element minOccurs="0" name="fileName" type="xs:string"/>
<xs:element minOccurs="0" name="fileExtension" type="xs:string"/>
<xs:element minOccurs="0" name="batchNumber" type="xs:string"/>
<xs:element minOccurs="0" name="msg" type="xs:string"/>
<xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" minOccurs="0" name="file" ns1:expectedContentTypes="application/octet-stream" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="getTransferDmsiResponse">
<wsdl:part name="return" type="tns:cxfFileWrapper">
</wsdl:part>
</wsdl:message>
<wsdl:message name="isTransferFlagResponse">
</wsdl:message>
<wsdl:message name="getTransferDmsi">
<wsdl:part name="arg0" type="tns:cxfFileWrapper">
</wsdl:part>
</wsdl:message>
<wsdl:message name="isTransferFlag">
<wsdl:part name="arg0" type="tns:cxfFileWrapper">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="UploadFileService">
<wsdl:operation name="isTransferFlag">
<wsdl:input message="tns:isTransferFlag" name="isTransferFlag">
</wsdl:input>
<wsdl:output message="tns:isTransferFlagResponse" name="isTransferFlagResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getTransferDmsi">
<wsdl:input message="tns:getTransferDmsi" name="getTransferDmsi">
</wsdl:input>
<wsdl:output message="tns:getTransferDmsiResponse" name="getTransferDmsiResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UploadFileServiceServiceSoapBinding" type="tns:UploadFileService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="isTransferFlag">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input name="isTransferFlag">
<soap:body namespace="http://webServices.taiyu.com/" use="literal"/>
</wsdl:input>
<wsdl:output name="isTransferFlagResponse">
<soap:body namespace="http://webServices.taiyu.com/" use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getTransferDmsi">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input name="getTransferDmsi">
<soap:body namespace="http://webServices.taiyu.com/" use="literal"/>
</wsdl:input>
<wsdl:output name="getTransferDmsiResponse">
<soap:body namespace="http://webServices.taiyu.com/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UploadFileServiceService">
<wsdl:port binding="tns:UploadFileServiceServiceSoapBinding" name="UploadFileServicePort">
<soap:address location="http://192.168.0.130/dmsi/services/uploadFileService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>