Field attribute

Hi,

I have to consume a Soap Web Service
on the enveloppe I have fields like this

<fields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:reportField">
                            <id>SIGN_TECH</id>
                            <binaryData>
                                <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:beee83b7-166c-494c-890a-def990e9887b-3011@cxf.apache.org" />
                            </binaryData>
                            <fillingDate>2017-03-21T14:19:45.268+01:00</fillingDate>
                        </fields>

When the Rodl file was Generated I had something like this

But of course here the field BinaryData is not a Type BinaryData of ROSDK. We use MTOM here
I need to retrieve the href of the binaryData how can I modify the Rodl file to get it working ?
Once the rodl is done how can I get the href attibute ?

Regards

try to replace Binary datatype with AnsiString

using a AnsiString I get an Empty string.
I have also tryed ti create a new Struct if a field xop instead of AnsiString but BinaryData.xop return also an empty string

have you set soapname=xop:Include attribute for your xop field?

I have set it

But I still get an empty string

if you revert to original RODL with binary type, will this field contain non-empty value?

I have a binary size of Zero using binary field

can you set breakpoint at reading this field (in _intf.pas) as see what is happened in debug mode?

Hi Evgeny,

I have tryed but I’m a little bit lost because I don’t know exactly the way RO SDK works.

here

procedure reportField.ReadComplex(aSerializer: TObject);
var
  __Serializer: TROSerializer;
  l_binaryData: Binary;
  l_extensions: wsValuedEntry_extensions_Array;
  l_fillingDate: DateTime;
  l_id: UTF8String;
  l_value: UTF8String;
  l_valueCode: UTF8String;
begin
  __Serializer := TROSerializer(aSerializer);
  ;
  if __Serializer.RecordStrictOrder then begin
    inherited ReadComplex(aSerializer);

    l_binaryData := Self.int_binaryData;
    try
      __Serializer.ReadBinary('binaryData', l_binaryData);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'binaryData']);
      end;
    end;
    if Self.int_binaryData <> l_binaryData then begin
      Self.binaryData.Free();
    end;
    Self.binaryData := l_binaryData;
    l_fillingDate := Self.fillingDate;
    try
      __Serializer.ReadDateTime('fillingDate', l_fillingDate);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'fillingDate']);
      end;
    end;
    Self.fillingDate := l_fillingDate;
    l_value := Self.value;
    try
      __Serializer.ReadUTF8String('value', l_value);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'value']);
      end;
    end;
    Self.value := l_value;
    l_valueCode := Self.valueCode;
    try
      __Serializer.ReadUTF8String('valueCode', l_valueCode);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'valueCode']);
      end;
    end;
    Self.valueCode := l_valueCode;
  end
  else begin
    l_binaryData := Self.int_binaryData;
    try
      __Serializer.ReadBinary('binaryData', l_binaryData);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'binaryData']);
      end;
    end;
    if Self.int_binaryData <> l_binaryData then begin
      Self.binaryData.Free();
    end;
    Self.binaryData := l_binaryData;
    l_extensions := Self.int_extensions;
    try
      __Serializer.ReadArray('extensions', wsValuedEntry_extensions_Array, l_extensions);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'extensions']);
      end;
    end;
    if Self.int_extensions <> l_extensions then begin
      Self.extensions.Free();
    end;
    Self.extensions := l_extensions;
    l_fillingDate := Self.fillingDate;
    try
      __Serializer.ReadDateTime('fillingDate', l_fillingDate);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'fillingDate']);
      end;
    end;
    Self.fillingDate := l_fillingDate;
    l_id := Self.id;
    try
      __Serializer.ReadUTF8String('id', l_id);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'id']);
      end;
    end;
    Self.id := l_id;
    l_value := Self.value;
    try
      __Serializer.ReadUTF8String('value', l_value);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'value']);
      end;
    end;
    Self.value := l_value;
    l_valueCode := Self.valueCode;
    try
      __Serializer.ReadUTF8String('valueCode', l_valueCode);
    except
      on E: Exception do begin
        uROClasses.RaiseError('Exception "%s" with message "%s" happens during reading field "%s".', [E.ClassName(), E.Message, 'valueCode']);
      end;
    end;
    Self.valueCode := l_valueCode;
  end;
end;

how can I display the content of __Serializer ?

set breakpoint in

procedure TROXMLSerializer.ReadBinary(const aName: string; var Ref; 
   ArrayElementId: integer);

and inspect properties of fNode and ss. it should correctly decode stream and result put into obj

here’s the fNode.XML content

but in ss := TStringStream.Create(fNode.Value); FNodeValue is ‘’

It explains why you had empty value when you defined xop item in binarydata struct:

<xop:Include 
     xmlns:xop="http://www.w3.org/2004/08/xop/include" 
     href="cid:beee83b7-166c-494c-890a-def990e9887b-3011@cxf.apache.org" />

this item has no value but has 2 attributes: href and xmlns:xop.

unfortunately, this “feature” isn’t supported by RO SDK. you need to parse it manually

parsing it manually is not a problem for me, I will add my code for this, but how can I get this Binarydata as XML string from my _int unit. what should I modify in my rodl to do this ?

try to specify xml type instead of binary and see was it read correctly in

procedure TROXMLSerializer.ReadXml(const aName: String; var Ref;
  ArrayElementId: Integer);

Thanks Evgeny.