Hi All!

Hi All!

I'm using Delphi XE.

Given the next SOAP XML (copied the full XML here to fully understand my problem):

[code]

xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xs="http://www.w3.org/2000/10/XMLSchema"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:trt="http://www.onvif.org/ver10/media/wsdl">



Profile1

VideoSourceConfiguration0_0
0
VideoSource0



AudioSourceConfiguration0
0
AudioSource0


VideoEncoderConfiguration0_0
0
MPEG4

1600
1200

50.0

10
1
6000


10
SP


0
Baseline



IPv4
239.128.1.99
::1

5560
0
false

PT30M


AudioEncoderConfiguration0
0
AMR
12200
8


IPv4
239.128.1.99
::1

5562
0
false

P100YT30M


eptzconfg1
0
eptz_c0_s0
http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace
http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace
http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace
http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace
http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace
http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace

http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace">
http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace">

P999YT30M


http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace

-1.0
1.0


-1.0
1.0





http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace

0.0
1.0








[/code]

When Delphi's parser read the node:
AMR
and it's not registered then an Exception occours in TypInfo.SetEnumProp():
raise EPropertyConvertError.CreateResFmt(@SInvalidPropertyElement,[Value]);

So every previously parsed and processed, created object's created remains in memory... :(

My first solution is to catch the exception in OPToSOAPDomConv TSOAPDomConv.ConvertSOAPToObject():

[code]
try
      LoadObject(Obj, RootNode, ObjNode);
    except
      on E: Exception do
      begin
        // log
        FreeAndNil(Result);
      end;
    end;
[/code]

Anyone has a better suggestion to solve this?
Or is it fixed in XE6?

Thx:
Nandor Kiss
http://www.w3.org/2003/05/soap-envelope

Comments