Bug in soap href id handling ?

53 views
Skip to the first unread message

DawnCode

unread,
2 Oct 2015, 07:18:5702/10/2015
to WST-LIST
Hi,

  in a project which I have WST acting as server RPC / Encoded a client in .Net sended requests like this :

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                                               
<s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                                                   
<q1:InsertZTotal xmlns:q1="OrExSysDataMigration">
                                                       
<AuthKey xsi:type="xsd:string">cTBVVG1UbEJrNXRZeHlXeGR3Q0hIblp0QmUwOHV5TT0=</AuthKey>
                                                       
<OrderZTotal href="#id1"/>
                                                       
<InsertErrors href="#id2"/>
                                                   
</q1:InsertZTotal>
                                                   
<q2:rcOrderZTotalRec id="id1" xsi:type="q2:rcOrderZTotalRec" xmlns:q2="OrExSysDataMigration">
                                                       
<FISCALDATE xsi:type="xsd:date">2015-10-02</FISCALDATE>
                                                       
<RVCSID xsi:type="xsd:long">12</RVCSID>
                                                       
<TOTAL xsi:type="xsd:decimal">10.5</TOTAL>
                                                   
</q2:rcOrderZTotalRec>
                                                   
<q3:rcErrors id="id2" xsi:type="q3:rcErrors" xmlns:q3="OrExSysDataMigration"/>
                                               
</s:Body>
                                           
</s:Envelope>



  In order WST regognize them I had to patch base_soap_formatter.pas :

Index: base_soap_formatter.pas
===================================================================
--- base_soap_formatter.pas    (revision 4365)
+++ base_soap_formatter.pas    (working copy)
@@ -510,7 +510,7 @@
       locHRefValue
:= locNode.NodeValue;
       
if ( locHRefValue[1] = '#' ) then
         locHRefValue
:= Copy(locHRefValue,2,Length(locHRefValue));
-      Result := SelectSingleNode(Format('//*[@id=%s]',[locHRefValue]),locNode.OwnerDocument,True);
+      Result := SelectSingleNode(Format('//*[@id=%s]',[QuotedStr(locHRefValue)]),locNode.OwnerDocument,True);
       
//ANode.OwnerDocument.GetElementById(locHRefValue);
       
if ( Result = nil ) then
         
raise ESOAPException.CreateFmt(SERR_NodeNotFoundByID,[locHRefValue]);



 regards,

Inoussa OUEDRAOGO

unread,
15 Oct 2015, 12:09:3415/10/2015
to wst-list
Hi
Thank you very much. I will apply the fix.
Could you please specify you environment (FPC or Delphi, which version, OS, processor) ?

PS : Sorry for the delay.

--
Inoussa O.

DawnCode

unread,
19 Oct 2015, 03:26:2919/10/2015
to WST-LIST
HI,

On Thursday, October 15, 2015 at 7:09:34 PM UTC+3, Inoussa OUEDRAOGO wrote:
<snip>
Could you please specify you environment (FPC or Delphi, which version, OS, processor) ?

  the server / project is compiled with FPC 3.0.1 ( fixes branch ), WST trunk ( from https://svn.code.sf.net/p/lazarus-ccr/svn/wst/trunk ) using indy ( for various reasons ) and is running as an application in a WIN 2012 VM ( in a KVM Hypervisor ).

Hope it helps.

regards,
 

Inoussa OUEDRAOGO

unread,
19 Oct 2015, 07:40:3819/10/2015
to wst-list
Thanks.


--
Inoussa O.
Reply all
Reply to author
Forward
0 new messages