Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: The element does not contain a single text node



Permlink Replies: 4 - Last Post: Nov 2, 2015 1:56 AM Last Post By: Christophe LACH
Denis Prince

Posts: 4
Registered: 7/1/07
The element does not contain a single text node
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 25, 2015 1:42 AM
I am calling a web service (Delphi XE7) with this function (from the proxy class):

procedure DemanderLot(var _strXmlSortie: string; var _objEnteteRamq: EnteteRAMQ2; var _bytContFich: TByteDynArray); stdcall;

Here is the SOAP response taken from the 'afterexecute' event of the httprio component:

--uuid:0752cfaf-a953-405e-8dac-aa8a0dbc2a3e+id=16
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<DemanderLotResponse xmlns="http://www.ramq.gouv.qc.ca/OPX2_ServEchgLotFichDP_svc/1">
<_strXmlSortie>
<param>
<nom_fich>EC20151024164008.zip</nom_fich>
<no_accu_recept>1610020151024124007</no_accu_recept>
<info_err></info_err>
</param>
</_strXmlSortie>
<_objEnteteRamq xmlns:a="http://www.ramq.gouv.qc.ca/OOA2_ServTranfMsgFich_svc/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:IdEntIntvnEchg>16100</a:IdEntIntvnEchg>
<a:NoEchgFich>1610020151024164007979</a:NoEchgFich>
<a:TypEntIntvnEchg>NT</a:TypEntIntvnEchg>
<a:EtatEchgFich>AAEAAAD/////AQAAAAAAAAAMAgAAAGBSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2NwbywgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTU1YTAzYTJhZjU2OTcxN2QEAQAAALIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2Nwby5Db250eEVjaGdGaWNoLCBSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2NwbywgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTU1YTAzYTJhZjU2OTcxN2RdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAALVJBTVEuT08uT09BMl9UcmFpdE1zZ0ZpY2hfY3BvLkNvbnR4RWNoZ0ZpY2hbXQIAAAAICAkDAAAAAgAAAAIAAAAHAwAAAAABAAAABAAAAAQrUkFNUS5PTy5PT0EyX1RyYWl0TXNnRmljaF9jcG8uQ29udHhFY2hnRmljaAIAAAAJBAAAAAkFAAAADQIFBAAAACtSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2Nwby5Db250eEVjaGdGaWNoAwAAAAtzdHJDbGVDb250eAtzdHJWYWxDb250eA1kaXNwb3NlZFZhbHVlAQEAAQIAAAAGBgAAACIxNjEwMDIwMTUxMDI0MTY0MDA3OTc5Q2xlTm9FY2hhbmdlBgcAAAAWMTYxMDAyMDE1MTAyNDE2NDAwNzk3OQABBQAAAAQAAAAGCAAAACgxNjEwMDIwMTUxMDI0MTY0MDA3OTc5Q2xlQWNjdXNlUmVjZXB0aW9uBgkAAAATMTYxMDAyMDE1MTAyNDEyNDAwNwAL</a:EtatEchgFich>
</_objEnteteRamq>
<_bytContFich><xop:Include href="cid:http://tempuri.org/1/635812872081670596" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></_bytContFich>
</DemanderLotResponse>
</s:Body>
</s:Envelope>
--uuid:0752cfaf-a953-405e-8dac-aa8a0dbc2a3e+id=16
Content-ID: <http://tempuri.org/1/635812872081670596>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

I get the error message :

"The element '_bytContFich' does not contain a single text node."

What could be causing this?

Any help would be greatly appreciated.

Thank you
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: The element does not contain a single text node
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2015 8:33 AM   in response to: Denis Prince in response to: Denis Prince
Denis Prince wrote:
I am calling a web service (Delphi XE7) with this function (from the proxy class):

procedure DemanderLot(var _strXmlSortie: string; var _objEnteteRamq: EnteteRAMQ2; var _bytContFich: TByteDynArray); stdcall;

Here is the SOAP response taken from the 'afterexecute' event of the httprio component:

--uuid:0752cfaf-a953-405e-8dac-aa8a0dbc2a3e+id=16
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<DemanderLotResponse xmlns="http://www.ramq.gouv.qc.ca/OPX2_ServEchgLotFichDP_svc/1">
<_strXmlSortie>
<param>
<nom_fich>EC20151024164008.zip</nom_fich>
<no_accu_recept>1610020151024124007</no_accu_recept>
<info_err></info_err>
</param>
</_strXmlSortie>
<_objEnteteRamq xmlns:a="http://www.ramq.gouv.qc.ca/OOA2_ServTranfMsgFich_svc/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:IdEntIntvnEchg>16100</a:IdEntIntvnEchg>
<a:NoEchgFich>1610020151024164007979</a:NoEchgFich>
<a:TypEntIntvnEchg>NT</a:TypEntIntvnEchg>
<a:EtatEchgFich>AAEAAAD/////AQAAAAAAAAAMAgAAAGBSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2NwbywgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTU1YTAzYTJhZjU2OTcxN2QEAQAAALIBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2Nwby5Db250eEVjaGdGaWNoLCBSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2NwbywgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPTU1YTAzYTJhZjU2OTcxN2RdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAALVJBTVEuT08uT09BMl9UcmFpdE1zZ0ZpY2hfY3BvLkNvbnR4RWNoZ0ZpY2hbXQIAAAAICAkDAAAAAgAAAAIAAAAHAwAAAAABAAAABAAAAAQrUkFNUS5PTy5PT0EyX1RyYWl0TXNnRmljaF9jcG8uQ29udHhFY2hnRmljaAIAAAAJBAAAAAkFAAAADQIFBAAAACtSQU1RLk9PLk9PQTJfVHJhaXRNc2dGaWNoX2Nwby5Db250eEVjaGdGaWNoAwAAAAtzdHJDbGVDb250eAtzdHJWYWxDb250eA1kaXNwb3NlZFZhbHVlAQEAAQIAAAAGBgAAACIxNjEwMDIwMTUxMDI0MTY0MDA3OTc5Q2xlTm9FY2hhbmdlBgcAAAAWMTYxMDAyMDE1MTAyNDE2NDAwNzk3OQABBQAAAAQAAAAGCAAAACgxNjEwMDIwMTUxMDI0MTY0MDA3OTc5Q2xlQWNjdXNlUmVjZXB0aW9uBgkAAAATMTYxMDAyMDE1MTAyNDEyNDAwNwAL</a:EtatEchgFich>
</_objEnteteRamq>
<_bytContFich><xop:Include href="cid:http://tempuri.org/1/635812872081670596" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></_bytContFich>
</DemanderLotResponse>
</s:Body>
</s:Envelope>
--uuid:0752cfaf-a953-405e-8dac-aa8a0dbc2a3e+id=16
Content-ID: <http://tempuri.org/1/635812872081670596>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

I get the error message :

"The element '_bytContFich' does not contain a single text node."

What could be causing this?

Any help would be greatly appreciated.

Thank you

Sorry, I misread your xml and posted an incorrect answer. Removed.

Dan

Edited by: Dan Barclay on Oct 26, 2015 10:35 AM
Christophe LACH

Posts: 37
Registered: 12/2/01
Re: The element does not contain a single text node
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2015 4:08 AM   in response to: Denis Prince in response to: Denis Prince
<_bytContFich><xop:Include href="cid:http://tempuri.org/1/635812872081670596" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></_bytContFich>

I get the error message :

"The element '_bytContFich' does not contain a single text node."

What could be causing this?

My guess is because Delphi httprio does not support MTOM/XOP wsdlimp did no map correctly the XOP tags above and probably declared _bytContFich as a string.

The only way around is to modify the declaration manually and map yourself the xop tags. after that you still have to read the xop data yourself I think.

Denis Prince

Posts: 4
Registered: 7/1/07
Re: The element does not contain a single text node
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2015 12:16 PM   in response to: Christophe LACH in response to: Christophe LACH
Thank you for your help Christophe.

The exception occurs here where Node.NodeName = '_bytContFich' :

procedure TSOAPDomConv.ConvertSoapToNativeData(DataP: Pointer; TypeInfo: PTypeInfo;
RootNode, Node: IXMLNode; Translate: Boolean);
var
TypeUri, TypeName: InvString;
IsNull: Boolean;
Obj: TObject;
P: Pointer;
ID: InvString;
begin
Node := GetDataNode(RootNode, Node, ID);
IsNull := NodeIsNull(Node);
if TypeInfo.Kind = tkVariant then
begin
if IsNull then
begin
Variant(PVarData(DataP)^) := NULL;
end else
ConvertSoapToVariant(Node, DataP);
end
else if TypeInfo.Kind = tkDynArray then
begin
P := DataP; <<<<----------------------------------------------------------------------------- exception
P := ConvertSoapToNativeArray(P, TypeInfo, RootNode, Node);
Pointer(DataP^) := P
end

........................

Does that mean that '_bytContFich' was declared as a TbyteDynArray?


Christophe LACH wrote:
<_bytContFich><xop:Include href="cid:http://tempuri.org/1/635812872081670596" xmlns:xop="http://www.w3.org/2004/08/xop/include"/></_bytContFich>

I get the error message :

"The element '_bytContFich' does not contain a single text node."

What could be causing this?

My guess is because Delphi httprio does not support MTOM/XOP wsdlimp did no map correctly the XOP tags above and probably declared _bytContFich as a string.

The only way around is to modify the declaration manually and map yourself the xop tags. after that you still have to read the xop data yourself I think.

Christophe LACH

Posts: 37
Registered: 12/2/01
Re: The element does not contain a single text node
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 2, 2015 1:43 AM   in response to: Denis Prince in response to: Denis Prince
Denis Prince wrote:
The exception occurs here where Node.NodeName = '_bytContFich' :

Does that mean that '_bytContFich' was declared as a TbyteDynArray?{quote}

Difficult to say without the wsdl or the interface section, but wsdlimp will probably map unkown structures he does not recognise to binarydata.

Since MTOM/XOP is not supported it's probably what happened.

There's a know hack for sending MTOM attachments http://codeverge.com/embarcadero.delphi.webservices/sending-mtom-attachments-hack/1082181

but nothing for receiving them.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02