Skip to content
Snippets Groups Projects
Commit 06f689c1 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Cleaning up(?) the WSDL mess

parent 8d5f2248
Branches
Tags
No related merge requests found
...@@ -243,6 +243,7 @@ ...@@ -243,6 +243,7 @@
</vmArgs> </vmArgs>
<wsdlLocation>https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl</wsdlLocation> <wsdlLocation>https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/DMIWeatherService.svc.stale</staleFile> <staleFile>${project.build.directory}/jaxws/stale/DMIWeatherService.svc.stale</staleFile>
<keep>true</keep>
</configuration> </configuration>
<id>wsimport-generate-DMIWeatherService.svc</id> <id>wsimport-generate-DMIWeatherService.svc</id>
<phase>generate-sources</phase> <phase>generate-sources</phase>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xml"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.wsdl"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.wsdl"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd0" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd0.xsd"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd0" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd0.xsd"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd1" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd1.xsd"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd1" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd1.xsd"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd2" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd2.xsd"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd2" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd2.xsd"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd3" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd3.xsd"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd3" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd3.xsd"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd4" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd4.xsd"/> <system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?xsd=xsd4" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.xsd_xsd4.xsd"/>
<system systemId="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?singleWsdl" uri="wsdl/dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc.singlewsdl.wsdl"/>
</catalog> </catalog>
\ No newline at end of file
...@@ -24,7 +24,6 @@ import java.text.ParseException; ...@@ -24,7 +24,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -85,7 +84,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{ ...@@ -85,7 +84,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{
try { try {
observations = wdsUtil.getWeatherObservations( observations = wdsUtil.getWeatherObservations(
weatherStation.getDataFetchUri(), weatherStation,
WeatherObservation.LOG_INTERVAL_ID_1H, WeatherObservation.LOG_INTERVAL_ID_1H,
new String[]{ new String[]{
WeatherElements.TEMPERATURE_MEAN, WeatherElements.TEMPERATURE_MEAN,
...@@ -96,8 +95,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{ ...@@ -96,8 +95,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{
WeatherElements.WIND_SPEED_2M WeatherElements.WIND_SPEED_2M
}, },
configuration.getDateStartInTimeZone(), configuration.getDateStartInTimeZone(),
dateEndWeatherData, dateEndWeatherData);
timeZone);
observations = validateAndSanitizeObservations(observations, configuration.getDateStartInTimeZone()); observations = validateAndSanitizeObservations(observations, configuration.getDateStartInTimeZone());
//System.out.println(configuration.getDateStartInTimeZone()); //System.out.println(configuration.getDateStartInTimeZone());
} catch (ConfigValidationException | WeatherObservationListException | WeatherDataSourceException ex) { } catch (ConfigValidationException | WeatherObservationListException | WeatherDataSourceException ex) {
...@@ -271,5 +269,4 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{ ...@@ -271,5 +269,4 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{
retVal = wUtil.truncateToLastCommonObservation(retVal); retVal = wUtil.truncateToLastCommonObservation(retVal);
return retVal; return retVal;
} }
} }
...@@ -58,7 +58,7 @@ public class DMIPointWebDataParser { ...@@ -58,7 +58,7 @@ public class DMIPointWebDataParser {
List<WeatherObservation> retVal = new ArrayList<>(); List<WeatherObservation> retVal = new ArrayList<>();
try { try {
IWeatherService proxy = new WeatherService().getSslOffloadedBasicHttpBindingIWeatherService(); IWeatherService proxy = new WeatherService().getSslOffloadedBasicHttpBindingIWeatherService();
ArrayOfWeatherDataSource wdsource = new ArrayOfWeatherDataSource(); UseableArrayOfWeatherDataSource wdsource = new UseableArrayOfWeatherDataSource();
wdsource.add(WeatherDataSource.OBS); wdsource.add(WeatherDataSource.OBS);
wdsource.add(WeatherDataSource.FORECAST); wdsource.add(WeatherDataSource.FORECAST);
wdsource.add(WeatherDataSource.NORMAL); wdsource.add(WeatherDataSource.NORMAL);
...@@ -74,7 +74,7 @@ public class DMIPointWebDataParser { ...@@ -74,7 +74,7 @@ public class DMIPointWebDataParser {
} }
ArrayOfWeatherDataParameter wdparam = new ArrayOfWeatherDataParameter(); UseableArrayOfWeatherDataParameter wdparam = new UseableArrayOfWeatherDataParameter();
DMIPointWebDataParser.PARAM_MAP.values().stream().forEach( DMIPointWebDataParser.PARAM_MAP.values().stream().forEach(
listedParam -> wdparam.add(listedParam) listedParam -> wdparam.add(listedParam)
); );
......
/*
* Copyright (c) 2017 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with VIPSLogic. If not, see <http://www.nibio.no/licenses/>.
*
*/
package no.nibio.vips.util.weather.dnmipointweb;
/**
* @copyright 2017 <a href="http://www.nibio.no/">NIBIO</a>
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
public class UseableArrayOfWeatherDataParameter extends ArrayOfWeatherDataParameter{
public void add(WeatherDataParameter wdp)
{
this.getWeatherDataParameter().add(wdp);
}
}
/*
* Copyright (c) 2017 NIBIO <http://www.nibio.no/>.
*
* This file is part of VIPSLogic.
* VIPSLogic is free software: you can redistribute it and/or modify
* it under the terms of the NIBIO Open Source License as published by
* NIBIO, either version 1 of the License, or (at your option) any
* later version.
*
* VIPSLogic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* NIBIO Open Source License for more details.
*
* You should have received a copy of the NIBIO Open Source License
* along with VIPSLogic. If not, see <http://www.nibio.no/licenses/>.
*
*/
package no.nibio.vips.util.weather.dnmipointweb;
/**
* @copyright 2017 <a href="http://www.nibio.no/">NIBIO</a>
* @author Tor-Einar Skog <tor-einar.skog@nibio.no>
*/
public class UseableArrayOfWeatherDataSource extends ArrayOfWeatherDataSource{
public void add(WeatherDataSource wds)
{
this.getWeatherDataSource().add(wds);
}
}
...@@ -70,9 +70,7 @@ public class DMIPointWebDataParserTest { ...@@ -70,9 +70,7 @@ public class DMIPointWebDataParserTest {
Double longitude = 10.0213; Double longitude = 10.0213;
Double latitude = 56.0199; Double latitude = 56.0199;
List<WeatherObservation> result = instance.getData(longitude, latitude, dateFrom, dateTo); List<WeatherObservation> result = instance.getData(longitude, latitude, dateFrom, dateTo);
result.stream().forEach(r->System.out.println(r.toString())); result.stream().forEach(r->System.out.println(r.toString()));
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
} }
} }
<HTML><HEAD><link rel="alternate" type="text/xml" href="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?disco"/><STYLE type="text/css">#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px}</STYLE><TITLE>WeatherService Service</TITLE></HEAD><BODY><DIV id="content"><P class="heading1">WeatherService Service</P><BR/><P class="intro">You have created a service.<P class='intro'>To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:</P> <BR/><PRE>svcutil.exe <A HREF="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl">https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?wsdl</A></PRE><P>You can also access the service description as a single file:<BR/><PRE><A HREF="https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?singleWsdl">https://dmiweatherservice-plant.dlbr.dk/DMIWeatherService.svc?singleWsdl</A></PRE></P></P><P class="intro"/>This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:<BR/><P class='intro'><B>C#</B></P><PRE><font color="blue">class </font><font color="teal">Test
</font>{
<font color="blue"> static void </font>Main()
{
<font color="teal">WeatherServiceClient</font> client = <font color="blue">new </font><font color="teal">WeatherServiceClient</font>();
<font color="green"> // Use the 'client' variable to call operations on the service.
</font><font color="green"> // Always close the client.
</font> client.Close();
}
}
</PRE><BR/><P class='intro'><B>Visual Basic</B></P><PRE><font color="blue">Class </font><font color="teal">Test
</font><font color="blue"> Shared Sub </font>Main()
<font color="blue"> Dim </font>client As <font color="teal">WeatherServiceClient</font> = <font color="blue">New </font><font color="teal">WeatherServiceClient</font>()
<font color="green"> ' Use the 'client' variable to call operations on the service.
</font><font color="green"> ' Always close the client.
</font> client.Close()
<font color="blue"> End Sub
</font><font color="blue">End Class</font></PRE></DIV></BODY></HTML>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment