能不能举个例子!
我现在是调用用java开发的webservice接口程序如下:
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://localhost:8080/HelloWorld/services/HelloWorld?wsdl
// Encoding : UTF-8
// Version : 1.0
// (2004-3-3 22:11:02 - 1.33.2.5)
// ************************************************************************ //
unit HelloWorld1;
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.
// ************************************************************************ //
// !:byte - "http://www.w3.org/2001/XMLSchema"
// !:string - "http://www.w3.org/2001/XMLSchema"
ArrayOffbyte = array of Shortint
{ "null" }
// ************************************************************************ //
// Namespace : http://localhost:8080/HelloWorld/services/HelloWorld
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : HelloWorldSoapBinding
// service : HelloWorldService
// port : HelloWorld
// URL : http://localhost:8080/HelloWorld/services/HelloWorld
// ************************************************************************ //
HelloWorld = interface(IInvokable)
['{CD147AB6-6841-976B-3DA9-2B82C2182674}']
function aa(const temp: ArrayOffbyte): ArrayOffbyte
stdcall;
function sayHelloWorld: WideString
stdcall;
function echo(const u: WideString): WideString
stdcall;
end;
function GetHelloWorld(UseWSDL: Boolean=System.False
Addr: string=''
HTTPRIO: THTTPRIO = nil): HelloWorld;
implementation
function GetHelloWorld(UseWSDL: Boolean
Addr: string
HTTPRIO: THTTPRIO): HelloWorld;
const
defWSDL = 'http://localhost:8080/HelloWorld/services/HelloWorld?wsdl';
defURL = 'http://localhost:8080/HelloWorld/services/HelloWorld';
defSvc = 'HelloWorldService';
defPrt = 'HelloWorld';
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 HelloWorld);
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(HelloWorld), 'http://localhost:8080/HelloWorld/services/HelloWorld', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(HelloWorld), '');
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOffbyte), 'null', 'ArrayOffbyte');
end.
不知道如何把流给传入函数。谢谢!