delphi里如何接收使用webservice中c#自定义的类型,希望有详细的代码??
delphi里如何接收使用webservice中c#自定义的类型,希望有详细的代码??
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"
TestClass = class; { "http://tempuri.org/" }
// ************************************************************************ //
// Namespace : http://tempuri.org/
// ************************************************************************ //
TestClass = class(TRemotable)
private
FId: Integer;
FName: WideString;
published
property Id: Integer read FId write FId;
property Name: WideString read FName write FName;
end;
ArrayOfTestClass = array of TestClass; { "http://tempuri.org/" }
// ************************************************************************ //
// Namespace : http://tempuri.org/
// soapAction: http://tempuri.org/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// binding : MonitorServiceSoap
// service : MonitorService
// port : MonitorServiceSoap
// ************************************************************************ //
MonitorServiceSoap = interface(IInvokable)
['{5E9794F7-A1AA-22AD-3D81-D2B25B731A18}']
function HelloWorld: WideString; stdcall;
function getTestClassList: ArrayOfTestClass; stdcall;
end;
function GetMonitorServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): MonitorServiceSoap;
[解决办法]
自定义类型是不能跨预研编程的,只有转为XML或JSON等中间格式才可以。