I donโt know what causes the error, but yes, there is a way around this. You can use the RIO_AfterExecute () handler to modify the SOAPResponse, to modify the XML to "make it suitable." This is an ugly Big Hammer approach, but it ultimately allows you to tinker with data to get around all kinds of problems.
Looking at your two examples, I would try to use stringreplace to replace "xsd: anyType [] [1]" with "xsd: anyType [] [3]". If this does not work, try entering a different dataset with empty values โโso that it looks like more than one.
You will need an RIO object, and then you attach it to the handler as follows:
MyRIO.OnAfterExecute := self.RIO_AfterExecute;
In my case, โIโ refers to the class that I wrote around my SOAP material.
Be sure to set your position to 0 when you finish the query.
Here is some untested code:
procedure MyWrapper.RIO_AfterExecute(const MethodName: string; SOAPResponse: TStream); var SL : TStringList; begin // do stuff with the SOAPResponse here. // It a stream, so I like to load it into a stringlist // ex: SL := TStringList.Create; try SOAPResponse.Position := 0; SL.LoadFromSTream(SOAPREsponse); // fiddle with stringreplace here, to doctor up the SL.text. SOAPResponse.Position := 0; SOAPResponse.size := length(SL.Text); SL.SaveToStream(SOAPResponse); finally SL.free; end; end;
source share