Solved

XQuery and integration with Web Service method that returns XML

Posted on 2011-03-15
6
366 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:Letterpart
  • 4
  • 2
6 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 35136482
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
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 35136484
rest being REST of course
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 35136496
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:Letterpart
ID: 35136693
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
 
LVL 1

Author Closing Comment

by:Letterpart
ID: 35140268
Many thanks for your example code and reference link, and prompt response.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 35142355
welcome
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 38
Help with SimpleXML charts with PHP 4 83
Fixing Non-Standard characters in text 8 90
Formatting issues in XSL FO 3 30
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now