I'm using two web services from the same host: Earth Orientation Center
I can get each one to work on a fresh kernel but I cannot get both of them to work during the same instance of the kernel. I think this is a context problem so I have tried loading each one into their own context.
The Code Instal the service:
Needs["WebServices`"]
InstallService["http://hpiers.obspm.fr/eop-pc/webservice/server_MATRICE_EOP.php?wsdl"]
Make a call:
year = 2005;
month = 12;
day = 31;
hour = 12;
minute = 34;
seconde = 34;
pm = 1;
ut = 1;
nut = 1;
tides = 1;
wservice =
MATRICEfromDate[
LaDate["theyear" -> year, "themonth" -> month, "theday" -> day,
"thehour" -> hour, "theminute" -> minute, "thesecond" -> seconde,
"thepm" -> pm, "theut" -> ut, "thenut" -> nut,
"thetides" -> tides]]
This works and I get a matrix.
complexType$2200["a11" -> 0.318954, "a12" -> 0.94777,
"a13" -> 0.000580507, "a21" -> -0.94777, "a22" -> 0.318954,
"a23" -> 0.0000409354, "a31" -> -0.000146358, "a32" -> -0.000563244,
"a33" -> 1.]
But now if I install the other web service
InstallService["http://hpiers.obspm.fr/eop-pc/webservice/server_EOP2.php?wsdl"]
Then make a call:
year = 2005;
month = 12;
day = 31;
wservice =
C04fromDate[
LaDate["theyear" -> year, "themonth" -> month, "theday" -> day]]
It also works!
complexType$3424["MJD" -> 53735, "x" -> 0.053717, "y" -> 0.384245,
"UT1UTC" -> -0.661133, "LOD" -> -1.6*10^-6, "dX" -> 0.000228,
"dY" -> -0.000287, "xerr" -> 0.00014, "yerr" -> 0.000141,
"UT1UTCerr" -> 1.7*10^-6, "LODerr" -> 0.0000135, "dXerr" -> 0.000098,
"dYerr" -> 0.000091]
So what is my problem? When I go back an run the first function MATRICEfromDate
I get:
SerializeSchemaInstance::children: Invalid children: thehour->12.
I cannot get both of them to work consistently in one kernel session. I think is has to do with the context of the LaDate
Edits
I have tried adding AllowShortContext -> False
as was suggested. However, this did not work but it help open the door to a better understanding of the problem. I have now explicitly added a context:
InstallService["http://hpiers.obspm.fr/eop-pc/webservice/
server_MATRICE_EOP.php?wsdl", "First`", AllowShortContext -> False]
InstallService["http://hpiers.obspm.fr/eop-pc/webservice/
server_EOP2.php?wsdl", "Second`", AllowShortContext -> False]
I then call the web service with the following functions (I use the same inputs as above)
wservice =
First`MATRICEfromDate[
First`LaDate["theyear" -> year, "themonth" -> month,
"theday" -> day, "thehour" -> hour, "theminute" -> minute,
"thesecond" -> seconde, "thepm" -> pm, "theut" -> ut,
"thenut" -> nut, "thetides" -> tides]]
and...
wservice =
Second`C04fromDate[
Second`LaDate["theyear" -> year, "themonth" -> month,
"theday" -> day]]
The problem revolves to the context of LaDate
. Here is a look at the variables in the two contexts:
?Second`*
C04fromDate dYerr$2982 MJD$2946 themonth$2872 xerr$2967
complexType$2943 dY$2964 thedate$2939 theyear$2867 x$2949
dXerr$2979 LODerr$2976 thedate$2939$2987
dX$2961 LOD$2958 theday$2877 UT1UTC$2955 y$2952
Notice there is no LaDate
. Now look at the other context:
?First`*
a11$2737 a23$2752 LaDate thehour$2545 thesecond$2555
a12$2740 a31$2755 MATRICEfromDate theminute$2550 thetides$2575
a13$2743 a32$2758 thedate$2730 themonth$2535 theut$2565
a21$2746 a33$2761 thedate$2730$2766 thenut$2570
a22$2749 complexType$2734 theday$2540 thepm$2560
Here you will find the LaDate
.
Some how I need to get a LaDate
into each context because they are different.
Another attempt
I have taken the two web servers and placed them in separate packages inside the Begin["`Private`"];
section and then wrote a wrapper function which I exposed via usage
and still no luck. I think I'm just going to parse old FORTRAN data files from the USNO