ephemcc
is intended to people who need to compute the ephemerides of position of the Solar system objects. See also ephemsys
method.
ephemcc
is intended to people who need to compute the ephemerides of position of the Solar system objects. See also ephemsys
method.
ephemcc
service into your application. This can be done by using the Web service method or by using
the following HTTP request:
[parameters]
is a list of parameters separated by the ampersand character
(&
). The allowed parameters are:
Parameter | Definition | Limits or value |
---|---|---|
-name=<string> |
The designation of the target | Ex.: p:Mars, p:5, a:Pallas, a:1999 TC36, c:p/halley |
-type=<string> |
Type of the target (default: empty) | Asteroid | Comet | Dwarf Planet | Planet | Satellite |
-ep=<string> |
Requested epoch, expressed in Julian period, ISO format, or formatted as any English textual datetime |
depends on the planetary theory |
-nbd=<int> |
Number of dates of ephemeris to compute (default: 1) | 1 ≤ nbd ≤ 5000 |
-step=<string> |
Step of increment (float) followed by one of (d)ays or (h)ours or (m)inutes or (s)econds (default: 1d) |
Ex.: 2.345h or 1d |
-tscale=<string> |
Ephemeris time scale (default: UTC) | UTC | TT |
-observer=<string> |
Code or geographic coordinates of the observer's location (default: 500) | Ex.: 500 (geocenter), 007 (Paris), @sun, @rosetta, ... |
-theory=<string> |
Planetary theory to use for the calculation (default: INPOP) | INPOP | DE200 | BDL82 | SLP98 | DE403 | DE405 | DE406 | DE430 | DE431 |
-teph=<int> |
Type of ephemeris: 1: astrometric J2000 (default), 2: apparent of the date, 3: mean of the date, 4: mean J2000 |
1 | 2 | 3 | 4 |
-tcoor=<int> |
Type of coordinates: 1: spherical (default), 2: rectangular, 3: Local coordinates, 4: Hour angle coordinates, 5: dedicated to observation |
1 | 2 | 3 | 4 | 5 |
-rplane=<int> |
Reference plane: 1:equator (default), 2: ecliptic | 1 | 2 |
-oscelem=<string> |
Source of osculating elements for asteroids: ASTORB (default) or MPCORB |
astorb | mpcorb | mpcorb/nea |
-mime=<string> |
Mime type of the results (default: votable) | votable | html | text | text/csv | json |
-output=<string> |
Comma separated list of options (default: blank) | See section Optional parameters |
-from=<string> |
Word which definite the name of the caller application, or which describes the request | any short string (no space character) |
The output results are described in the following section, and are available in
VOTable (default), HTML, comma-separated values (CSV),
plain text format, and JSON object (cf. examples). Some
parameters are optionnal, and their values can be omitted (just left blank the value, e.g.
&-mime=&-output=
). The input parameters without default value are mandatory.
Parameter | Definition | Limits or value |
---|---|---|
-name=<string> |
The number or name or provisional designation of an asteroid or a comet |
Examples:a:22 or a:Kalliope c:1P or c:P/Halley |
-oscelem=<string> |
Source of osculating elements for asteroids: ASTORB (default) or MPCORB (Optional parameter) |
astorb | mpcorb | mpcorb/nea |
-from=<string> |
Word which definite the name of the caller application, or which describes the request |
any short string (no space character) |
The output response is a text/csv
document which contains the following information:
Quantity | Description | Unit |
---|---|---|
Num | Asteroid number (blank if unnumbered) | - |
Name | Name or preliminary designation | - |
OrbitComputer | Orbit computer | - |
H_Bowell | Absolute magnitude H | mag |
G_Bowell | Slope parameter G | - |
BmV | Color index B-V (blank if unknown) | mag |
IRAS_Diam | IRAS diameter (blank if unknown) | km |
IRAS_Taxo | IRAS Taxonomic classification (blank if unknown) | - |
SixIntCodes | Six integer codes (see table of explanation in ASTORB) | - |
OrbitalArc | Orbital arc spanned by observations used in orbit computation | days |
NbObs | Number of observations used in orbit computation | - |
OscEpoch | Epoch of osculation (TDT) | yyyymmdd |
MeanAnomaly | Mean anomaly | deg |
ArgOfPerihelion | Argument of perihelion (J2000.0) | deg |
AscNodeLongitude | Longitude of ascending node (J2000.0) | deg |
Inc | Inclination (J2000.0) | deg |
Ecc | Eccentricity | - |
a | Semimajor axis | au |
OrbitCompEpoch | Date of orbit computation (UTC - 7h) | yymmdd |
CEU | Absolute value of the current 1-sigma ephemeris uncertainty (CEU) | arcsec |
CEU_rate | Rate of change of CEU | arcsec/day |
CEU_epoch | Date of CEU (0h UT) | yyyymmdd |
PEU | Next peak ephemeris uncertainty (PEU) from date of CEU | arcsec |
PEU_epoch | Date of occurrence of next peak ephemeris uncertainty (PEU), from date of CEU | yyyymmdd |
GPEUfromCEU | Greatest PEU in 10 years from date of CEU | arcsec |
GPEUfromCEU_epoch | Date of occurrence of greatest PEU in 10 years from date of CEU | yyyymmdd |
GPEUnextPEU | Greatest PEU in 10 years from date of next PEU | arcsec |
GPEUnextPEU_epoch | Date of occurrence of greatest PEU in 10 years from date of next PEU | yyyymmdd |
Quantity | Description | Unit |
---|---|---|
Note | Note number associated with the comet | - |
Note_epoch | Date of update | DD/MM/YYYY |
Num | IAU code of the comet | - |
Name | IAU name of the comet | - |
OrbitComputer | Name of the author elements | - |
RefEpoch | Reference epoch of the osculating elements | julian day |
RelativityFlag | Relativity flag: 1: effect taken into account, 0: none | - |
NbObs | Number of observations used in solution | - |
RMS (arcsec) | RMS residual | arcsec |
FirstObsEpoch | Date of first observation | DD/MM/YYYY |
LastObsEpoch | Date of last observation | DD/MM/YYYY |
px | Position vector x coordinate | au |
py | Position vector y coordinate | au |
pz | Position vector z coordinate | au |
px | Velocity vector x coordinate | au/day |
vy | Velocity vector y coordinate | au/day |
vz | Velocity vector z coordinate | au/day |
A1 | Parameter A1 of non-gravitational forces | - |
A2 | Parameter A2 of non-gravitational forces | - |
A3 | Parameter A3 of non-gravitational forces | - |
tau | Date of perihelion passage | julian day |
q | Perihelion distance | au |
Ecc | Eccentricity of the orbit | - |
ArgOfPerihelion | Argument of perihelion (J2000.0) | deg |
AscNodeLongitude | Longitude of the ascending node (J2000.0) | deg |
Inc | Inclination to ecliptic (J2000.0) | deg |
H1 | Constant term of magnitude | - |
R1 | Coefficient of log(r) | - |
D1 | Coefficient of log(Delta) | - |
H2 | Constant term of magnitude | - |
R2 | Coefficient of log(r) | - |
D2 | Coefficient of log(Delta) | - |
ephemcc
method:
clientID
array('from' => 'YourName', 'hostip'=>'', 'lang'=>'en|fr')
Variable | Type | Units | Limits or values | Default | Comment |
---|---|---|---|---|---|
name |
string | designation or URL | - | none | Name or number of the target, or list of targets provided through an URL |
type |
string | - | Asteroid | Comet | Dwarf Planet | Planet | Satellite | none | Type of the target |
epoch |
string | epoch or URL |
depends on the planetary theory | none | Requested epoch (julian period, ISO format, English textual datetime), or list of epochs provided through an URL |
nbd |
int | - | 1 ≤ nbd ≤ 5000 | 1 | Number of dates of ephemeris to compute |
step |
string | d|h|m|s | step ≤ 100d | 1d | Step of increment (float) followed by one of (d)ays or (h)ours or (m)inutes or (s)econds |
tscale |
string | - | UTC | TT | UTC | Time scale of the ephemeris |
observer |
string | - | Code (IAU or special) or geographic coordinates of the observer's location | 500 | IAU codes of observatories; Geographic coordinates must be expressed in degrees (longitude, latitude) and meters (altitude) |
theory |
string | - | INPOP | DE200 | BDL82 | SLP98 | DE403 | DE405 | DE406 | DE430 | DE431 | INPOP | Planetary theory |
teph |
int | - | 1 | 2 | 3 | 4 | 1 | Type of ephemeris: 1:astrometric J2000, 2:apparent of the date, 3: mean of the date, 4: mean J2000 |
tcoor |
int | - | 1 | 2 | 3 | 4 | 5 | 6 | 1 | Type of coordinates: 1:spherical, 2:rectangular, 3: Local coordinates, 4: Hour angle coordinates, 5: dedicated to observation |
rplane |
int | - | 1 | 2 | 1 | Reference plane: 1:equator, 2:ecliptic |
oscelem |
string | - | astorb | mpcorb | mpcorb/nea | astorb | Source of osculating elements for asteroids: ASTORB or MPCORB |
mime |
string | - | votable | html | text | text/csv | json | votable | Mime type of the results |
output |
string | - | Comma separated list of options | blank | See section Optional parameters |
get |
string | - | orbital_params | blank | Use this parameter (together with name and oscelem ) to
request specific data used by Miriade ephemcc method to compute
ephemerides. No ephemeris is provided. |
The output of the ephemcc
method is an object containing the following attributes:
flag=1
means ok; flag=0
or flag=-1
mean that an error occured400: bad request
, 422: Unprocessable Entity
, 500: internal error
);
', and fields
are separated by one or more blank character. The first block is the keyword '#! ephem
' which marks the beginning of the data.;
', and fields
are separated by a comma. The first line provides the ticket (Unix timestamp of the response) and the flag of the response,
and the second line provides the field headers.output
) can be used to format the display of the date,
or to add extra ephemeris data. The available parameters are:
--greg
--iso
--jd
--lighttime
--rv
--ttmutc
--colors(<filter>[,<filter>,...])
--thermalflux(λ,pv,η,ε)
--pafParams(am,h☉)
epoch=2453002.24128009239, observer=500,
nbd=5, step=1d, tscale=UTC, theory=INPOP, teph=1, tcoor=1, oscelem=astorb
and:
The output parameters of the ephemcc
method depend on the type of coordinates (arg. tcoor
)
and the options (arg. output
) that are choosen by the client. Click on the following buttons to display the
output parameters in function of the value of the tcoor
argument.
Col. | Definition | Units | Format | Option | Note |
---|---|---|---|---|---|
1 | Object name | - | String | (1) | |
2 | Gregorian Date or Julian period | datetime or day | ISO-8601 or decimal | (2,3) | |
3 | TT-UTC value | s | decimal | --ttmutc |
|
4, 5 | Spherical coordinates at the date | h:m:s and °:′:″ | sexagesimal | (4) | |
6 | Range to observer | au | decimal | ||
7 | Light time between the target and observer | min | decimal | --lighttime |
(3) |
8 | Visual magnitude | mag | decimal | (5) | |
9‑38 | Magnitudes for requested filters | mag | decimal | --colors() |
(6,3) |
39 | Thermal flux for requested wavelengths | Jy | decimal | ‑‑thermalflux() |
(7,3) |
40 | Phase angle | degree | decimal | ||
41 | Solar elongation | degree | decimal | ||
42 | Motion in RA on the celestial sphere (Δαcos(δ)) | arcsec/min | decimal | ||
43 | Motion in DEC on the celestial sphere (Δδ) | arcsec/min | decimal | ||
44 | Radial velocity (RV) of target center w.r.t. observer | km/s | decimal | ||
45 | Radial velocity (RVc) of target center corrected for the radial velocity of the observer (BERV) and increased by its velocity toward the Sun (RVs): RVc = RV-BERV+RVs | km/s | decimal | --rv |
(3) |
46 | Projection of the barycentric velocity vector of the observer along the observer-target direction (BERV) | km/s | decimal | --rv |
(3) |
47 | Projection of the heliocentric velocity vector of the target along the heliocentric direction of the target (RVs) | km/s | decimal | --rv |
(3) |
48 | X coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(8) |
49 | Y coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(8) |
Notes:
text
.output
argument.rplane=1
or ecliptic longitude and
latitude if rplane=2
.--colors()
option.--thermalflux()
option. The flux are formatted as a list
of values, e.g. {v1; v2; ...]}
.<system>/<component>
,
e.g. name=a:kalliope/linus
. See the HOWTO
section for a full description about how to name targets.Col. | Definition | Units | Format | Option | Note |
---|---|---|---|---|---|
1 | Object name | - | String | (1) | |
2 | Gregorian Date or Julian period | datetime or day | ISO-8601 or decimal | (2,3) | |
3 | TT-UTC value | s | decimal | --ttmutc |
|
4‑6 | Cartesian vector (x,y,z) position at the date | au | decimal | (4) | |
7 | Range to observer | au | decimal | ||
8 | Light time between the target and observer | min | decimal | --lighttime |
|
9 | Heliocentric distance | au | decimal | ||
10 | Phase angle | degree | decimal | ||
11 | Solar elongation | degree | decimal | ||
12 | Visual magnitude | mag | decimal | (5) | |
13‑42 | Magnitudes for requested filters | mag | decimal | --colors() |
(6,3) |
43 | Thermal flux for requested wavelengths | Jy | decimal | ‑‑thermalflux() |
(7,3) |
44‑46 | Cartesian velocity vector at the date | au/d | decimal | ||
47 | Radial velocity (RV) of target center w.r.t. observer | km/s | decimal | ||
48 | Radial velocity (RVc) of target center corrected for the radial velocity of the observer (BERV) and increased by its velocity toward the Sun (RVs): RVc = RV-BERV+RVs | km/s | decimal | --rv |
|
49 | Projection of the barycentric velocity vector of the observer along the observer-target direction (BERV) | km/s | decimal | --rv |
|
50 | Projection of the heliocentric velocity vector of the target along the heliocentric direction of the target (RVs) | km/s | decimal | --rv |
|
51 | X coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(8) |
52 | Y coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(8) |
Notes:
text
.output
argument.rplane=1
or ecliptic coordinates if rplane=2
.--colors()
option.--thermalflux()
option. The flux are formatted as a list
of values, e.g. {f1; f2; ...}
.<system>/<component>
,
e.g. name=a:kalliope/linus
. See the HOWTO
section for a full description about how to name targets.Col. | Definition | Units | Format | Option | Note |
---|---|---|---|---|---|
1 | Object name | - | String | (1) | |
2 | Gregorian Date or Julian period | datetime or day | ISO-8601 or decimal | (2,3) | |
3 | Local sidereal time | h:m:s | sexagesimal | ||
4 | TT-UTC value | s | decimal | --ttmutc |
|
5 | Azimut (0..360° from north) | degree | decimal | ||
6 | Elevation (0..90° from horizon) | degree | decimal | ||
7 | Range to observer | au | decimal | ||
8 | Light time between the target and observer | min | decimal | --lighttime |
|
9 | Visual magnitude | mag | decimal | (4) | |
10‑39 | Magnitudes for requested filters | mag | decimal | --colors() |
(5) |
40 | Thermal flux for requested wavelengths | Jy | decimal | ‑‑thermalflux() |
(6) |
41 | Phase angle | degree | decimal | ||
42 | Solar elongation | degree | decimal | ||
43 | Refraction | arcsec | decimal | ||
44 | Radial velocity (RV) of target center w.r.t. observer | km/s | decimal | ||
45 | Radial velocity (RVc) of target center corrected for the radial velocity of the observer (BERV) and increased by its velocity toward the Sun (RVs): RVc = RV-BERV+RVs | km/s | decimal | --rv |
|
46 | Projection of the barycentric velocity vector of the observer along the observer-target direction (BERV) | km/s | decimal | --rv |
|
47 | Projection of the heliocentric velocity vector of the target along the heliocentric direction of the target (RVs) | km/s | decimal | --rv |
|
48 | X coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
49 | Y coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
Notes:
text
.output
argument.--colors()
option.--thermalflux()
option. The flux are formatted as a list
of values, e.g. {f1; f2; ...}
.<system>/<component>
,
e.g. name=a:kalliope/linus
. See the HOWTO
section for a full description about how to name targets.Col. | Definition | Units | Format | Option | Note |
---|---|---|---|---|---|
1 | Object name | - | String | (1) | |
2 | Gregorian Date or Julian period | datetime or day | ISO-8601 or decimal | (2,3) | |
3 | Local sidereal time | h:m:s | sexagesimal | ||
4 | TT-UTC value | s | decimal | --ttmutc |
|
5 | Hour angle (0..24h from south) | h | decimal | ||
6 | Declination | degree | decimal | ||
7 | Range to observer | au | decimal | ||
8 | Light time between the target and observer | min | decimal | --lighttime |
|
9 | Visual magnitude | mag | decimal | (4) | |
10‑39 | Magnitudes for requested filters | mag | decimal | --colors() |
(5) |
40 | Thermal flux for requested wavelengths | Jy | decimal | ‑‑thermalflux() |
(6) |
41 | Phase angle | degree | decimal | ||
42 | Solar elongation | degree | decimal | ||
43 | Refraction | arcsec | decimal | ||
44 | Radial velocity (RV) of target center w.r.t. observer | km/s | decimal | ||
45 | Radial velocity (RVc) of target center corrected for the radial velocity of the observer (BERV) and increased by its velocity toward the Sun (RVs): RVc = RV-BERV+RVs | km/s | decimal | --rv |
|
46 | Projection of the barycentric velocity vector of the observer along the observer-target direction (BERV) | km/s | decimal | --rv |
|
47 | Projection of the heliocentric velocity vector of the target along the heliocentric direction of the target (RVs) | km/s | decimal | --rv |
|
48 | X coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
49 | Y coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
Notes:
text
.output
argument.--colors()
option.
See Optional parameters section.--thermalflux()
option. The flux are formatted as a list
of values, e.g. {f1; f2; ...}
.
See Optional parameters section.<system>/<component>
,
e.g. name=a:kalliope/linus
. See the HOWTO
section for a full description about how to name targets.Col. | Definition | Units | Format | Option | Note |
---|---|---|---|---|---|
1 | Object name | - | String | (1) | |
2 | Gregorian Date or Julian period | datetime or day | ISO-8601 or decimal | (2,3) | |
3 | Local sidereal time | h:m:s | sexagesimal | ||
4 | TT-UTC value | s | decimal | --ttmutc |
|
5, 6 | J2000 Right Ascension and Declination | h:m:s and ° : ′ : ″ | sexagesimal | ||
7 | Hour angle (0..24h from south) | h | decimal | ||
8 | Azimut (0..360° from north) | degree | decimal | ||
9 | Elevation (0..90° from horizon) | degree | decimal | ||
10 | Range to observer | au | decimal | ||
11 | Light time between the target and observer | min | decimal | --lighttime |
|
12 | Heliocentric distance | au | decimal | ||
13 | Visual magnitude | mag | decimal | (4) | |
14‑43 | Magnitudes for requested filters | mag | decimal | --colors() |
(5) |
44 | Thermal flux for requested wavelengths | Jy | decimal | ‑‑thermalflux() |
(6) |
45 | Phase angle | degree | decimal | ||
46 | Solar elongation | degree | decimal | ||
47 | Airmass | - | decimal | ||
48 | Motion in RA on the celestial sphere (Δαcos(δ)) | arcsec/min | decimal | ||
49 | Motion in DEC on the celestial sphere (Δδ) | arcsec/min | decimal | ||
50 | Radial velocity (RV) of target center w.r.t. observer | km/s | decimal | ||
51 | Radial velocity (RVc) of target center corrected for the radial velocity of the observer (BERV) and increased by its velocity toward the Sun (RVs): RVc = RV-BERV+RVs | km/s | decimal | --rv |
|
52 | Projection of the barycentric velocity vector of the observer along the observer-target direction (BERV) | km/s | decimal | --rv |
|
53 | Projection of the heliocentric velocity vector of the target along the heliocentric direction of the target (RVs) | km/s | decimal | --rv |
|
54 | X coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
55 | Y coordinate of the differential position of the component w.r.t. the primary | arcsec | decimal | <system>/<component> |
(7) |
Notes:
text
.output
argument.--colors()
option.--thermalflux()
option. The flux are formatted as a list
of values, e.g. {f1; f2; ...}
.<system>/<component>
,
e.g. name=a:kalliope/linus
. See the HOWTO
section for a full description about how to name targets.{ "sso": {}, "coosys": {}, "ephemeris": {}, "data": {}, "unit": {} }
where sso
provides information about the celestial object:"sso": { "num": int,
"name": string,
"type": string,
"parameters": {
"diameter": float,
"ceu": float,
"ceurate": float,
"orbital_period": float,
"mass": float,
"dynamical_class": string,
"taxonomy": { "class": string, "param": string, "source": string } }
where coosys
provides information about the celestial reference frame:"coosys": { "epoch": string, "equinox": string, "system": string }
where ephemeris
provides information about the ephemeris computation:"ephemeris": { "time_scale": string,
"planetary_theory": string,
"relativistic_perturbations": string,
"coordinates": string,
"reference_frame": { "type": string, "plane": string, "center": string } }
where data
contains an array with the ephemerides of the body :"data": [ { "epoch": float,
"ra": float,
"dec": float,
"dobs": float,
"vmag": float,
"phase": float,
"solar_elongation": float,
"mu_ra_cosdec": float,
"mu_dec": float,
"dobs_dot": float } ]
and where unit
provides the unit of the quantities:"unit": { "<keyword>": string [, "<keyword>": string, ...] }
where keyword
belongs to the list of keywords used inside
the document.
curl
or wget
.
For that, just execute one of the following commands in a console:$> curl "<URL>"
or
$> wget "<URL>"
where <URL>
is described in section HTTP request.
In order to help you to invoke the Miriade Web service, we provide some clients
written in differents languages. Here are some detailed explanations to write a client with PHP
and SOAP which invokes the ephemcc
method:
1/ Provide the input parameters which are mandatory for the service:
// Client's ID: provide the name of your project or organisation or yourself
$from = 'MyName';
// Input parameters
$param = array('name' => 'a:ceres',
'type' => "",
'epoch' => 2458191.2412800924,
'nbd' => 5,
'step' => '1d',
'tscale' => 'UTC',
'observer' => '500',
'theory' => 'INPOP',
'teph' => 1,
'tcoor' => 1,
'rplane' => 1,
'oscelem' => 'astorb',
'mime' => 'text',
'output' => '--jd,--rv'
);
2/ Define the SOAP options, the namespace and the WSDL URI of Miriade web service:
// Enables or disables the WSDL caching feature
ini_set('soap.wsdl_cache_enabled', 1);
// Miriade namespace
$namespace = 'https://ssp.imcce.fr/webservices/miriade';
// Miriade WSDL
$uriwsdl = $namespace.'/miriade.wsdl';
3/ Create a SoapClient object in WSDL mode, set the SOAP header, then call the method and catch exceptions:
try {
// Constructs the client
$client = new SoapClient($uriwsdl, array('exceptions'=>1));
// SOAP header
$header = array('from'=>$from, 'hostip'=>'', 'lang'=>'en');
$client->__setSoapHeaders(array(new SOAPHeader($namespace, 'clientID', $header)));
// Call the resolver method
$response = $client->__soapCall('ephemcc',array($param));
// Display the results
if (! empty($param['get']))
{
header("HTTP/1.0 ".$response->status);
if ($response->status < 300) {
header("Content-Type: text/csv");
header('Content-disposition: attachment;filename="orbital_params.csv"');
} else {
header("Content-Type: text/plain");
}
echo $response->result.PHP_EOL;
}
else
{
// Affichage du resultat
if ($param['mime'] == 'text') {
$res = explode(';', $response->result);
$nbr = count($res);
$newkey = array_keys($res);
header("HTTP/1.0 ".$response->status);
header("Content-Type: text/plain");
echo "# Flag: ".$response->flag.PHP_EOL;
echo "# Ticket: ".$response->ticket.PHP_EOL;
for ($i=0; $i<$nbr; $i++) { echo $res[$newkey[$i]],PHP_EOL; }
} else if ($param['mime'] == 'text/csv') {
$res = explode(';', $response->result);
$nbr = count($res);
$newkey = array_keys($res);
header("HTTP/1.0 ".$response->status);
if ($response->status < 300) {
header("Content-Type: text/csv");
} else {
header("Content-Type: text/plain");
}
echo "# Flag: ".$response->flag.PHP_EOL;
echo "# Ticket: ".$response->ticket.PHP_EOL;
for ($i=0; $i<$nbr; $i++) { echo $res[$newkey[$i]],PHP_EOL; }
} else if ($param['mime'] == 'json') {
header("HTTP/1.0 ".$response->status);
header("Content-Type: application/json");
echo $response->result;
} else {
header("HTTP/1.0 ".$response->status);
header("Content-Type: text/xml;content=x-votable");
echo $response->result;
}
}
} catch (SoapFault $fault) {
trigger_error("SOAP Fault: {$fault->getTraceAsString()} (faultcode: {$fault->faultcode},
faultstring: {$fault->faultstring})", E_USER_ERROR);
}