XQuery and integration with Web Service method that returns XML

I am trying to understand how I might be able to call a Web Service method from XQuery and then interpret the results that the service sends back - unfortunately I have little experience in XQuery and even less in Web Services.

Can anyone give me an example of some XQuery code that would
 - call a Web Service method with a couple of parameters
 - the Web Service method would return a chunk of XML
 - the XQuery would then interpret that returned XML and carry out some action on what it finds
 
 
It's the XQuery end of things that I am interested in rather than the Web Service end.


Thanks.
LVL 1
LetterpartAsked:
Who is Participating?
 
Geert BormansConnect With a Mentor Information ArchitectCommented:
Here is an example on how DataDirect XQuery interface deals with SOAP calls
(which most generally are extensions to the XQuery language)
http://www.xquery.com/architecture/SOAP.html
0
 
Geert BormansInformation ArchitectCommented:
it all depends on what the type of Web Service you have to deal with
and of the XQuery implementation that is used

XQuery is commonly used with rest interfaces to XML databases
Then the XQuery can be as simple as the below example
(real url obfuscated for this forum)
let $a := doc('http://.../datum/1807-08-12')
return
 <title>
    {$a//title[1]/text()}
 </title>

Open in new window

0
 
Geert BormansInformation ArchitectCommented:
rest being REST of course
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
LetterpartAuthor Commented:
I have seen how I can make requests to the Web Service methods I will need to access using a free Microsoft product - Web Service Studio  (http://archive.msdn.microsoft.com/webservicestudio20 ).

That allowed me to retrieve the WDSL and see the various methods and parameters.

When I use that product to invoke a method I can see that it appears to be using SOAP and there is Request information in XML format, and Response information in XML format.
It looks like your DataDirect example of building a message payload and invoking a SOAP Request will be useful - thanks for that, and your other example.
0
 
LetterpartAuthor Commented:
Many thanks for your example code and reference link, and prompt response.
0
 
Geert BormansInformation ArchitectCommented:
welcome
0
All Courses

From novice to tech pro — start learning today.