How to consume an XML service using SOAP?
First thing you need is a service provider. It can be a service you create yourself, or an existing service like EPM project management service, from Microsoft.
You will then query your service provider and it will return to you the answer.
All these data will be exchanged in XML, which is basically a text file containing tag names and the value of each tag name.
Now, let's go back to a couple of definition:
SOAP
SOAP defines a way to move XML messages from point A to point B
<!--[if !vml]-->
<!--[endif]-->
<!--[if !vml]-->
<!--[endif]-->
XML
The Extensible Markup Language (XML) facilitates universal data access. XML is a plain-text, Unicode-based meta-language: a language for defining markup languages. It is not tied to any programming language, operating system, or software vendor. XML provides access to technologies for manipulating, structuring, transforming and querying data.
Anatomy of an XML Document:
Below is a sample XML document that represents the description of a EPM Project file.
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Name>PDSSoapProject.xml</Name>
<Company>Express Web Services</Company>
<Author>Eric Gourmet</Author>
<CreationDate>2005-09-29T11:12:00</CreationDate>
<LastSaved>2005-09-30T10:59:00</LastSaved>
<StartDate>2005-09-29T08:00:00</StartDate>
<FinishDate>2005-09-29T08:00:00</FinishDate>
</Project>
So basically, a web service provides an interface to be queried and to return answers. XML and SOAP defined how the data will be structured and the transfer protocol to exchange them.
The data content, the queries available depends only from the provider.
Let see an example of one query on a PDS server
Microsoft has defined a set of XML queries available and name them PDS APIs.
PDS APIs
The PDS Application Programming Interface (API) enables client application access to Project Server portfolio data. Client applications can programmatically log on to Project Server and use SOAP to call PDS API methods. The PDS implements a SOAP listener, which receives method calls in XML format and returns an XML response.
In this example, an XML Query called PDSINFO will be sent, using SOAP, to the PDS web service. In return you will have the response below.
<!--[if !vml]-->
<!--[endif]-->
We have now demystified the Web Service concept, illustrated by using Microsoft EPM Server.
In our next blogs, we will see how to implement our own web service!