1

I'm trying to make a soap post and get a rowset but I think that my xpath is bad-constructed.

%%[
VAR @xml
]%%

<script runat="server">
    Platform.Load("core","1.1.1");

    var url = 'http://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejero.asmx';
    var contentType = 'text/xml';
    var payload = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body /></soap:Envelope>'; 
    var headerNames = ["SOAPAction"];
    var headerValues = ["http://tempuri.org/OVCServWeb/OVCCallejero/ConsultaProvincia"];
    var result = HTTP.Post(url, contentType, payload, headerNames, headerValues);

    var xml = result.Response[0];

    Variable.SetValue("@xml", xml);
</script>
%%[
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")
 SET @xml = REPLACE(@xml, ' xmlns="http://www.catastro.meh.es/"',"")

 SET @res = BuildRowsetFromXml(@xml, "/Provincias/consulta_provinciero/provinciero/prov/np", 1)
 SET @rowCount =  RowCount(@res)
 outputLine (concat(@rowCount))

That outputLine always is zero but there is more than 40 elements

Why am I doing wrong?

Thank you!

1

Xpath issue,

just putting my xpath as

"//Provincias/consulta_provinciero/provinciero/prov/np"

problem solved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.