GEDCOM SOAP Web Service API
Contents
- 1 Introduction
- 2 API Web Service Functions
- 2.1 ● Authenticate
- 2.2 ● changeGedcom
- 2.3 ● checkUpdates
- 2.4 ● checkUpdatesByID
- 2.5 ● deleteRecord
- 2.6 ● getAncestry
- 2.7 ● getDescendants
- 2.8 ● getFamilyByID
- 2.9 ● getGedcomRecord
- 2.10 ● getKnownServers
- 2.11 ● getPersonByID
- 2.12 ● getSourceByID
- 2.13 ● getVar
- 2.14 ● getXref
- 2.15 ● search
- 2.16 ● ServiceInfo
- 2.17 ● updateRecord
Introduction
UNDER CONSTRUCTION from web site http://www.phpgedview.net/devdocs/webservice_api.php which is being deprecated.
This documentation describes how to use the SOAP webservices included in PGV version 4.0 and higher. This documentation assumes that you are familiar with SOAP and web services.
The SOAP web services in PGV allow you to access the data remotely. In order to access the data through the web service you need to have a SOAP client. The simplest way to create a SOAP client is through the WSDL file. You can obtain the WSDL file for a PGV site by going to http://www.pgvsite.com/phpGedView/genservice.php?wsdl
Note: You can test if this documentation is out of date, by examining what is documented in the WSDL. To get the WSDL try this for a default apache or IIS PHPGEDVIEW setup: http://localhost/pgv/genservice.php?wsdl Also note that if you first use the ServiceInfo method below, you can glean enough information to use many of the other methods. Some of the useful information that you can get are things like the list of names of gedcom files, which you can then use with other methods.
//Test PHPGEDView Web Services
localhost.GenealogyService ws = new TestPHPGedViewWS.localhost.GenealogyService();
localhost.serviceInfoResult siResult = ws.serviceInfo();
foreach (localhost.GedcomInfo gedInfo in siResult.gedcoms)
{
Console.WriteLine("ID = " + gedInfo.ID + " and Title = " + gedInfo.title + ".");
}
You can implement your own compatible web service for your application by extending the class found in the webservice/genealogyService.php file. For reference, the PGV implementation can be found at webservice/PGVServiceLogic.class.php. These files are available here http://cvs.sourceforge.net/viewcvs.py/phpgedview/phpGedView/webservice/?only_with_tag=future.
API Web Service Functions
● Authenticate
Logs you into the service. Allows you to set the default gedcom and compression methods to use. All methods require the session id returned from this method with the exception of ServiceInfo.
Parameters
|
Name |
Description |
username |
Username that has been created on the service you are trying to connect to. Leave blank to connect as a guest. |
Password |
Password for the provided username. Leave blank to connect as a guest. |
gedcom_id |
The gedcom id to use for all calls to the service. Defaults to the default gedcom set by the server. See also: ServiceInfo for a list of gedcoms on the server |
Compression |
Not implemented Choose the compression library to use. See also: ServiceInfo for a list of supported libraries |
Returns - authResult
|
Name |
Description |
SID |
Your session id. This must be provided when using any other methods of the service. Exception: ServiceInfo |
Message |
Server message to give details about the authentication attempt. |
gedcom_id |
The gedcom id that the server has chosen. |
compressionMethod |
Not implemented The compression method the server has chosen. |
Example
| Request |
require_once('includes/SOAP.php'); |
| Response |
... |
● changeGedcom
Parameters
|
Name |
Description |
gedcom |
The id of the Gedcom to use. |
Returns - gedcom
|
Name |
Description |
gedcom |
The gedcom to switched from before you invoked the this method.ServiceInfo |
● checkUpdates
● checkUpdatesByID
Checks the record id for updates since the provided date.ServiceInfo.
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate.
|
RID |
Record id to check. |
lastUpdate |
Date of last update |
Returns - authResult
|
Name |
Description |
result |
Person(Complex Type) |
PID |
Person(Complex Type)Person ID |
gedcomName |
Person's name in gedcom syntax |
birthDate |
Date of birth |
birthplace |
Place of birth |
deathPlace |
Place of death |
deathDate |
Date of death |
gender |
Gender |
gedcom |
Returns the gedcom |
Example
| Request |
require_once('includes/SOAP.php'); |
| Response |
... |
● deleteRecord
● getAncestry
Retrieves the ancestry of the PID provided.
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate. |
rootID |
Person ID to start the ancestry |
generations |
Number of generations to get |
returnGedcom |
Whether or not to return the gedcom |
Returns - ArrayOfPerson
|
Name |
Description |
result |
ArrayOfPerson(Complex Type) |
PID |
Person ID |
gedcomName |
Person's name in gedcom syntax |
birthDate |
Date of birth |
birthplace |
Place of birth |
deathPlace |
Place of death |
deathDate |
Date of death |
gender |
Gender |
gedcom |
Returns the gedcom |
Example
Request |
require_once('includes/SOAP.php'); |
Response |
... </st1:state><ST1:PLACE w:st="on"> Washington |
● getDescendants
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate. |
limit |
Maximum amount of results to return |
Returns - ArrayOfServer
|
Name |
Description |
Servers |
ArrayOfServer (Complex type) |
name |
Name given to the server |
Address |
URI to the known server |
Example
Request |
require_once('includes/SOAP.php'); |
Response |
... |
● getFamilyByID
● getGedcomRecord
● getKnownServers
Retrieves a list of saved servers from the server.
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate. |
limit |
Maximum amount of results to return |
Returns - ArrayOfServer
|
Name |
Description |
Servers |
ArrayOfServer (Complex type) |
name |
Name given to the server |
Address |
URI to the known server |
Example
Request |
require_once('includes/SOAP.php'); |
Response |
... |
● getPersonByID
● getSourceByID
● getVar
● getXref
● search
Performs a basic or advanced search on the gedcom specified in Authenticate.
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate |
query |
Query string to search with (ie 'John') |
Start |
Index of results to start at. To retrieve results 50 - <maxResults> you set start at 50 |
maxResults |
Maximum number of results to return |
Returns - SearchResult
|
Name |
Description |
totalResults |
Total number of results found. |
Persons |
ArrayOfPerson(Complex Type) |
PID |
Person ID |
gedcomName |
Person's name in gedcom syntax |
birthDate |
Date of birth |
birthplace |
Place of birth |
deathPlace |
Place of death |
deathDate |
Date of death |
gender |
Gender |
gedcom |
Returns an empty string. See getPersonByID to retrieve gedcom |
Example
| Request |
require_once('includes/SOAP.php'); |
| Response |
... |
</ST1:PLACE></ST1:STATE>
● ServiceInfo
Provides information about the server
and what it supports. Note: Only method that does not require authentication.
Parameters -
ServiceInfo does not
take any parameters
Returns -
ServiceInfo
|
Name |
Description |
compression |
Comma delimited list of supported compression libraries (ie. none,zlib,zip) |
apiVersion |
Version of the API |
server |
The server's identification (ie. PHPGedView 3.4) |
gedcomList |
ArrayOfGedcomList(Complex Type) |
title |
Title of the gedcom |
id |
Gedcom id |
Example
| Request |
require_once('includes/SOAP.php'); |
| Response |
... |
● updateRecord
Updates a record with the provided gedcom
Parameters
|
Name |
Description |
SID |
Session id that was returned from Authenticate. |
RID |
Record ID to update |
gedcom |
String of the updated gedcom |
Returns - String
|
Name |
Description |
message |
Status message of the result |
Example
| Request |
require_once('includes/SOAP.php'); |
| Response |
... |