Paultje
12 years agoNew Contributor
Problem with multiple return in XQuery Match Assertion
Currently I'm trying to make an XQuery Match assertion on the GetWeatherInformation operation of the Weather service (http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL) that returns the WeatherIDs and the Descriptions.
This is the XML response of the GetWeatherInformation operation:
This is the XQuery Match assertion I've made:
And this is the result of that assertion (by clicking 'Select from current'):
Does anyone know what I've done wrong here?
Thanks for your help!
This is the XML response of the GetWeatherInformation operation:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetWeatherInformationResponse xmlns="http://ws.cdyne.com/WeatherWS/">
<GetWeatherInformationResult>
<WeatherDescription>
<WeatherID>1</WeatherID>
<Description>Thunder Storms</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/thunderstorms.gif</PictureURL>
</WeatherDescription>
<WeatherDescription>
<WeatherID>2</WeatherID>
<Description>Partly Cloudy</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/partlycloudy.gif</PictureURL>
</WeatherDescription>
<WeatherDescription>
<WeatherID>3</WeatherID>
<Description>Mostly Cloudy</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/mostlycloudy.gif</PictureURL>
</WeatherDescription>
(...)
<WeatherDescription>
<WeatherID>35</WeatherID>
<Description>Snow, Blowing Snow, and Fog</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/blowingsnow.gif</PictureURL>
</WeatherDescription>
<WeatherDescription>
<WeatherID>36</WeatherID>
<Description>Unknown Precipitation</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/na.gif</PictureURL>
</WeatherDescription>
<WeatherDescription>
<WeatherID>37</WeatherID>
<Description>AM CLOUDS</Description>
<PictureURL>http://ws.cdyne.com/WeatherWS/Images/partlycloudy.gif</PictureURL>
</WeatherDescription>
</GetWeatherInformationResult>
</GetWeatherInformationResponse>
</soap:Body>
</soap:Envelope>
This is the XQuery Match assertion I've made:
declare namespace test = 'http://ws.cdyne.com/WeatherWS/';
<Result>
{
for $z in //test:WeatherDescription
return (<WeatherID>{data($z/WeatherID)}</WeatherID>,<Description>{data($z/Description)}</Description>)
}
</Result>
And this is the result of that assertion (by clicking 'Select from current'):
<Result>
<WeatherID/>
<Description/>
<WeatherID/>
<Description/>
<WeatherID/>
<Description/>
(...)
<WeatherID/>
<Description/>
<WeatherID/>
<Description/>
<WeatherID/>
<Description/>
</Result>
Does anyone know what I've done wrong here?
Thanks for your help!