Unofficial SOAP Bug Fixes
By Bruneau Babet bbabet@nospam.borland.com
Remove the nospam. from email address when mailing me
In general, applying these fixes require you to rebuild some of the VCL. The easiest way to do this, is to go to Tools | Environment Options and from the Library tab add $(DELPHI)\Source\Internet;$(DELPHI)\Source\SOAP to your Library Path.
These fixes are unofficial, are not supported by Borland, and are to be used at your own risk.
Quick Jumps:
The case of serialized Boolean members of a complex type is incorrect (i.e. 'True'/'False' instead of 'true'/'false') |
Description: When serializing Boolean members of a TRemotable-descendant class, the value of the latter are sent as 'True' or 'False'. Some SOAP implementations, including Delphi's, will accept these values. However, many will complain, and for good reason, since the legal literal representations of a boolean are '1', '0', 'true' or 'false'.
Fix: |
function TSOAPDomConv.GetObjectPropAsText(Instance: TObject; PropInfo: PPropInfo): WideString; var I: LongInt; E: Extended; I64: Int64; begin case (PropInfo.PropType)^.Kind of tkInteger: begin I := GetOrdProp(Instance, PropInfo); Result := IntToStr(I); end; tkFloat: begin E := GetFloatProp(Instance, PropInfo); Result := FloatToStrEx(E); end; tkWString: Result := GetWideStrProp(Instance, PropInfo); tkString, tkLString: Result := GetStrProp(Instance, PropInfo); tkInt64: begin I64 := GetInt64Prop(Instance, PropInfo); Result := IntToStr(I64); end; tkEnumeration: |
Memory leak in Servers that expose WideString parameters |
Description: Delphi SOAP fails to delete WideStrings allocated by the framework on behalf of Servers that expose WideString parameters.
Fix: |
type {...} TDataContext = class protected FObjsToDestroy: array of TObject; DataOffset: Integer; Data: array of Byte; DataP: array of Pointer; VarToClear: array of Pointer; DynArrayToClear: array of TDynToClear; StrToClear: array of Pointer; |
Error publishing WebService's WSDL when MSXML4 is installed |
Description: As of SP#2, Delphi's msxmldom unit will attempt to use MSXMLDOM v4.0 if the latter is present. However, this may cause the creation and Publishing of a WSDL document by a Delphi WebService to fail. The typical symptom of this failure is that the client requesting the WSDL gets back an HTML document instead; and the document contains the following error message: Error: This name may not contain the ':' character
Fix: |
function TXMLNode.FindNamespaceDecl(const NamespaceURI: DOMString): IXMLNode; var I: Integer; |
HTTPRIO component reloads a Service's WSDL for each WebService call |
Description: When using the WSDLLocation property of a THTTPRIO to invoke a Web Service, each invokation results in a 'GET' of the WSDL document. NOTE: This bug was introduced when proxy support was added for the retrieval of the WSDL.
Fix: |
{ ActivateWSDL } function ActivateWSDL(WSDL: TWSDLItems; const Name: string; const Password: string; const Proxy: string): Boolean; begin Result := True; try |
(Ole)Variant array of one element are incorrectly deserialized |
Description: When a WebService Server or Client receives data that's deserialized into an OleVariant or Variant type, if the XML data sent is an array of a single element, the deserialization logic fails to see the data as an array; This causes a problem if the consumer of the (Ole)Variant expects an array. This problem may cause a MIDAS FetchParams of one parameter to fail, for example (while the call with two or more parameters succeed).
Fix: |
procedure TSOAPDomConv.WriteVarArray(RootNode, Node: IXMLNode; Name: InvString; V: Variant); var I, DimCount: Integer; LoDim, HiDim, Indices: array of integer; V1: Variant; ElemNode: IXMLNode; VAPropSet: Boolean; begin if not VarIsArray(V) then begin WriteVariant(RootNode, Node, Name, V); end else begin ElemNode := Node.AddChild(Name); DimCount := VarArrayDimCount(V); SetLength(LoDim, DimCount); SetLength(HiDim, DimCount); for I := 1 to DimCount do begin LoDim[I - 1] := VarArrayLowBound(V, I); HiDim[I - 1] := VarArrayHighBound(V, I); end; SetLength(Indices, DimCount); for I := 0 to DimCount - 1 do Indices[I] := LoDim[I]; VAPropSet := False; while True do begin V1 := VarArrayGet(V, Indices); if VarIsArray(V1) and not VarIsType(V1, varArray or varByte) then |
Bad XML Namespaces for 'dateTime' and other XSBuiltIn types when members of Complex Type |
Description: dateTime, decimal and other types implemented as a TXSxxxx class (in XSBuiltIn.pas) have incorrect namespaces when they are members of a complex (i.e. TRemotable-descendant) type.
Fix: |
function TSOAPDomConv.CreateObjectNode(Instance: TObject; RootNode, Node: IXMLNode; Name, URI: InvString; UsePrefix: Boolean): InvString; var {...} end else begin ClsType := GetTypeData((PropList[I].PropType)^).ClassType; RemClassRegistry.ClassToURI(ClsType, ElemURI, TypeName, IsScalar); MultiRef := MultiRefObject(ClsType); if IsScalar then begin |
Links:
Last Modified: 17-MAY-02