欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 房产 > 建筑 > Delphi 内置的用于 SOAP WebService 的数据类型定义

Delphi 内置的用于 SOAP WebService 的数据类型定义

2025/2/24 19:01:14 来源:https://blog.csdn.net/pcplayer/article/details/144105704  浏览:    关键词:Delphi 内置的用于 SOAP WebService 的数据类型定义

记录一下备查。

数据定义在这个单元:unit Soap.InvokeRegistry;

比如:

  TByteSOAPArray = array of Byte;TIntegerSOAPArray = array of Integer;TCardinalSOAPArray = array of Cardinal;TWordSOAPArray = array of Word;TSmallIntSOAPArray = array of SmallInt;TShortIntSOAPArray = array of ShortInt;TInt64SOAPArray = array of Int64;TLongWordSOAPArray = array of LongWord;TSingleSOAPArray = array of Single;TDoubleSOAPArray = array of Double;TBooleanSOAPArray = array of Boolean;TStringSOAPArray = array of string;

这些数据类型定义不是简单的定义一下,而是要注册到系统里面,注册代码也在这个单元里面。

注册代码片段:

{$IFNDEF NEXTGEN}RemClassRegistry.RegisterXSInfo(TypeInfo(System.ShortString), XMLSchemaNameSpace, 'string');RemClassRegistry.RegisterXSInfo(TypeInfo(System.AnsiChar), XMLSchemaNameSpace, 'string');RemClassRegistry.RegisterXSInfo(TypeInfo(System.WideChar), XMLSchemaNameSpace, 'string');
{$ENDIF !NEXTGEN}RemClassRegistry.RegisterXSInfo(TypeInfo(System.Char), XMLSchemaNameSpace, 'string');RemClassRegistry.RegisterXSInfo(TypeInfo(TByteSOAPArray), XMLSchemaNameSpace, 'base64Binary');RemClassRegistry.RegisterXSInfo(TypeInfo(System.Types.TByteDynArray), XMLSchemaNameSpace, 'base64Binary');{ Whether we register 'anyType' or 'anySimpleType first determines how we expose Variants -we'll opt for anyType as it seems to be the most interoperable although anySimpleTypeis the better semantic match }RemClassRegistry.RegisterXSInfo(TypeInfo(System.Variant), XMLSchemaNameSpace, 'anyType');RemClassRegistry.RegisterXSInfo(TypeInfo(System.Variant), XMLSchemaNameSpace, 'anySimpleType');RemClassRegistry.RegisterXSInfo(TypeInfo(System.Variant), XMLSchemaNameSpace, 'ur-type');RemClassRegistry.RegisterXSInfo(TypeInfo(System.OleVariant), XMLSchemaNameSpace, 'anyType');

理论上,在  SOAP WebService 的接口里面使用的数据类型,必须是注册过的。

当然,简单类型,比如 Integer 可以直接使用。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词