I'm calling a webservice from Db2 9.1 on zOS using function SOAPHTTPNV. The result comes back ok, but the webservice is called multiple times, once for every row in the resultset (or occurrence of element ROW in the response). Why is that ?
The SQL
SELECT T.NR_KAT, T.PNR_F
FROM
XMLTABLE(
xmlnamespaces ('http://schemas.xmlsoap.org/soap/envelope/' AS
"soap",
'http://schemas/SERVICE/100921' AS "p"),
'$d/soap:Envelope/soap:Body/p:SERVICE_RESPONSE/p:document/p:result/p:ROW'
PASSING XMLPARSE(
DOCUMENT DB2XML.SOAPHTTPNV(
'http://serviceurl',
VARCHAR(''),
VARCHAR('<soap:Envelope
request_simplified
</soap:Envelope>'
))) AS "d"
COLUMNS
NR_KAT VARCHAR(2) PATH 'p:NR_KAT',
PNR_F VARCHAR(12) PATH 'p:PNR_F'
) AS T
;
The result of the SQL in SPUFI
NR_KAT PNR_F
---------+---------+---------+---------+------
09 194513051834
08 194515042978
19 194515300398
The xml response from webservice
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<SERVICE_RESPONSE xmlns="http://schemas/SERVICE/100921">
<document>
<result>
<ROW>
<NR_KAT>09</NR_KAT>
<PNR_F>194513051834</PNR_F>
</ROW>
<ROW>
<NR_KAT>08</NR_KAT>
<PNR_F>194515042978</PNR_F>
</ROW>
<ROW>
<NR_KAT>19</NR_KAT>
<PNR_F>194515300398</PNR_F>
</ROW>
</result>
</document>
</SERVICE_RESPONSE>
</Body>
</Envelope>