Adding some attributes to the Rodl


(Armindo DA SILVA) #1


I have a Struct called ReferentialData
and 2 others (pReferentialData and externalReferentialData) that have ReferentialData as ancestor.
The problem is that in the enveloppe then both appear like this
so the server doesn’t know if it is a pReferentialData or a externalReferentialData

I should get something like this
<referentialData xmlns:xsi="" xsi:type="v1:pReferentialData">
for pReferentialData and
<referentialData xmlns:xsi="" xsi:type="v1:externalReferentialData"> for externalReferentialData

I thought I could simply replace in the sent Stream by the matching string. but the problem is that at this time I don’t know myseld if the data is a pReferentialData or externalReferentialData.

Is there a way to force the value directly in the attributes of these 2 objects ? And how ?


(EvgenyK) #2

if you add SOAPName attribute, you can write something like

<pReferentialData xmlns:xsi="">
<externalReferentialData xmlns:xsi="">

so later you can easily detect datatype of struct

(Armindo DA SILVA) #3

Hi Evgeny,

I ave trye dto do this but I still get <referentialData>
Note that many chars are not accepted if I try to use
<referentialData xmlns:xsi="" xsi:type="v1:externalReferentialData">

So I have just used externalReferentialData instead same problem with pReferentialData


(Armindo DA SILVA) #4

This function is never called that’s maybe why:
class function externalReferentialData.GetAttributeValue(aIndex: Integer): String;

(EvgenyK) #5

have you added SOAPName attribute?

procedure TROXMLSerializer.WriteStruct(const aName: string; const Ref; aClass: TClass;
  ArrayElementId: integer);
      if SameText(TROComplexTypeClass(aClass).GetAttributeName(i), 'SOAPName') then //<<<<
        lName := TROComplexTypeClass(aClass).GetAttributeValue(i);

set breakpoint at selected line and launch your application under debugger

(Armindo DA SILVA) #6

I have added SOAPName attribute

but in TROXMLSerializer.WriteStruct aClass.ClassName is always a referentialData and it has only importedfromnamespace attribute like the attrbutes of referentialData in the Rodl file.

here the ancestor is always called not the externalReferentialData

(EvgenyK) #7

can you attach your RODL, pls?
by other hand, you can send it to support@

(Armindo DA SILVA) #8

ok I send an email with Rodl and int files.

(EvgenyK) #9

you have this behavior because _referentialData field inside coreData struct has soapname=referentialData so it will be always written with referentialData name

(Armindo DA SILVA) #10

If I remove this atribute in _referentialData field, will it solve the problem ?

(Armindo DA SILVA) #11

If I remove it I still Get ReferentialData

(EvgenyK) #12

if xsoSendUntyped is unchecked, it adds datatypes, like

<?xml version="1.0" encoding="utf-8"?>
	<SOAP-ENV:Body xmlns:ro="">
		<NS1:NewService___oper xmlns:NS1="">
			<A xsi:type="ro:Sum2Struct">
				<NewField xsi:type="xsd:int">2</NewField>
				<NewField1 xsi:type="xsd:int">20</NewField1>