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 anySimpleType
    is 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 可以直接使用。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值