Developer’s corner

The Astronomical Coordinate XML Web Service. How to consume it in Java ? in Perl ?

This XML Web Service provides astronomical coordinate translation.

XML Web Service URL at CDS : http://cdsws.u-strasbg.fr/axis/services/AstroCoo

                  a second server is available at CDS : http://cdsws2.u-strasbg.fr

Available methods : . convert(double x, double y, double z, int precision)

Parameter(s) : x (10.0) y (15.0) z (20.0) precision (0=NONE, 1=DEG, 3=ARCMIN, 5=ARCSEC, 8=MAS)

Result : a String like 03 45 14.3838 +47 58 07.990 (J2000.0)

Get the SOAP result for x=10.0 y=15.0 z=20.0 precision=8

. convert(double lon, double lat, int precision)

Parameter(s) : lon (12.0) lat (45.0) precision (0=NONE, 1=DEG, 3=ARCMIN, 5=ARCSEC, 8=MAS)

Result : a String like 04 21 34. +53 32.5 (J2000.0)

Get the SOAP result for lon=12.0 lat=45.0 precision=5

. convert(int frame1, int frame2, double x, double y, double z, int precision, double equinox1, double equinox2)

Parameter(s) : frame1 (1=FK4, 2=GAL, 3=SGAL, 4=ECL, 5=FK5, 6=ICRS) frame2 (1=FK4, 2=GAL, 3=SGAL, 4=ECL, 5=FK5, 6=ICRS) x (10.0) y (15.0) z (20.0) precision (0=NONE, 1=DEG, 3=ARCMIN, 5=ARCSEC, 8=MAS) equinox1 (Julian Years or Besselian, unused for GAL, SGAL, ICRS) equinox2 (Julian Years or Besselian, unused for GAL, SGAL, ICRS)

Result : a String like 150.4806267 -05.3873952 (Gal)

Get the SOAP result for frame1=1 frame2=2 x=10.0 y=15.0 z=20.0 precision=8 equinox1=2000.0 equinox2=1900.0

. convert(int frame1, int frame2, double lon, double lat, int precision, double equinox1, double equinox2)

Parameter(s) : frame1 (1=FK4, 2=GAL, 3=SGAL, 4=ECL, 5=FK5, 6=ICRS) frame2 (1=FK4, 2=GAL, 3=SGAL, 4=ECL, 5=FK5, 6=ICRS) lon (12.0) lat (45.0) precision (0=NONE, 1=DEG, 3=ARCMIN, 5=ARCSEC, 8=MAS) equinox1 (Julian Years or Besselian, unused for GAL, SGAL, ICRS) equinox2 (Julian Years or Besselian, unused for GAL, SGAL, ICRS)

Result: a String like 122.2936260 -17.8674235 (Gal)

Get the SOAP result for frame1=1 frame2=2 lon=12.0 lat=45.0 precision=8 equinox1=2000.0 equinox2=1900.0

.getAvailability() Parameter(s) : none

Result : returns an XML file conform to the “availability 0.2” schema (IVOA Support Interfaces and Basic Profile)

In the following example(s) the user has not to manipulate the SOAP code… Example for (10.0, 20.0, 15.0) with a precision 5 (=ARCSEC) : Query :

<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:apachesoap=“http://xml.apache.org/xml-soap” xmlns:impl=“urn:AstroCoo” xmlns:intf=“urn:AstroCoo” xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:wsdl=“http://schemas.xmlsoap.org/wsdl/” xmlns:wsdlsoap=“http://schemas.xmlsoap.org/wsdl/soap/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” > <SOAP-ENV:Body> <mns:convert xmlns:mns=“urn:AstroCoo” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”> <x xsi:type=“xsd:double”>10.0</x> <y xsi:type=“xsd:double”>20.0</y> <z xsi:type=“xsd:double”>15.0</z> <precision xsi:type=“xsd:int”>5</precision> </mns:convert> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

Result :

<?xml version=“1.0” encoding=“UTF-8”?>

<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

<soapenv:Body>

<ns1:convertResponse soapenv:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:ns1=“urn:AstroCoo”>

<return xsi:type=“xsd:string”>04 13 44.4 +33 51 16. (J2000.0)</return>

</ns1:convertResponse>

</soapenv:Body>

</soapenv:Envelope>

astrocoordinates.txt · Last modified: 2011/11/28 10:01 by administrator

Thanks for acknowledging the CDS developer’s resources (libraries, source code, etc.)

© UDS/CNRS

Contact