Data Virtuality does not provide a WSDL parser at the moment, so, if you don't want to read the XML by hand, you will need an external tool.
We recommend to use SoapUI.
Let's use the folng example, the weatherendpoint http://www.webservicex.com/globalweather.asmx?WSDL
First of all create a webservice datasource let say soap

open a new project in SoapUI
select a service
test it with test values

copy the xml request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"> <soapenv:Header/> <soapenv:Body> <web:GetCitiesByCountry> <!--Optional:--> <web:CountryName>Australia</web:CountryName> </web:GetCitiesByCountry> </soapenv:Body></soapenv:Envelope> |
remove body and envelope and copy the namespaces to the root element
<web:GetCitiesByCountry xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"><web:CountryName>Australia</web:CountryName></web:GetCitiesByCountry> |
create a file datasource, e.g. xmlfiles

use your webservice datasource and save the returned xml data in a file GetCitiesByCountry.xml in the datasource xmlfiles
call "xmlfiles.saveFile"( "filePath" => 'GetCitiesByCountry.xml', "file" => ( select * from table( call "soap.invoke"( "binding" => 'SOAP12', "action" => 'GetCitiesByCountry', "request" => '<web:GetCitiesByCountry xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"> <web:CountryName>Australia</web:CountryName> </web:GetCitiesByCountry>',) ) "xml" ));; |
open the XML/JSON Query builder and open the xml file

choose the xml you wan to get.
In this case the retuned xml contains a single CDATA element, which contains a encapsulated XML:
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> <GetCitiesByCountryResult><
Finally we can combine everything in
SELECT "xmlTable2".* FROM TABLE ( call "soap.invoke" ( "binding" => 'SOAP12', "action" => 'GetCitiesByCountry', "request" => '<web:GetCitiesByCountry xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET"><web:CountryName>Australia</web:CountryName></web:GetCitiesByCountry>', , XMLTABLE ( XMLNAMESPACES ( DEFAULT 'http://www.webserviceX.NET' ), '/GetCitiesByCountryResponse' PASSING "soapxml"."result" COLUMNS "GetCitiesByCountryResult" STRING PATH 'GetCitiesByCountryResult' ) "xmlTable" , XMLTABLE ( '/NewDataSet/Table' PASSING XMLPARSE ( DOCUMENT ( "xmlTable.GetCitiesByCountryResult" ) ) COLUMNS "Country" STRING PATH 'Country', "City" STRING PATH 'City' ) "xmlTable2";; |
Comments
0 comments
Please sign in to leave a comment.