# Designing and Implementing Weather Generators as Web Services
## 3 Design and Implementation
### Web Service Server
#### 3.3.2 Core Weather Generator Service
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Service Endpoint** & [[http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com)]([http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com)): \\  & 8080/DISAGWS/rest/generate? \\ \hline
**HTTP GET Parameter** & **Description** & **Example** \\ \hline num & Number of weather realization scenario that client wants to generate & 100 then 100 scenarios of weather realization are generated. \\ \hline from & Starting year and month for generating weather realization & 2016, 1 then weather realization will start from the 1 st January 2016 \\ \hline to & Ending year and month for generating weather realization & 2017, 1 then weather realization will end at 31 st January 2017 \\ \hline weatherhistory & Long-term climatological data in WTD format giving in the URI form & Link to the data \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Request parameter of the DisAg service. 2. predictWTD weather generator web service (PDISAGWS) This is a web service that wraps predictWTD weather generator model into itself. Wrapping mechanism is as same as DisAg service. predictWTD accepts climate forecast represented by probability of BN, NN and AN. Users can invoke the service using HTTP GET and parsing parameters as described in Table 4.  
Example request for requesting 10 scenarios of weather realization from weatherhistory_urn:IBUNYA: AMeDAS-NIAES:GAMAGOORI-51281 is as follows. HTTP GET Request  
[[http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/PDISAGWS/rest/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/PDISAGWS/rest/)]([http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/PDISAGWS/rest/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/PDISAGWS/rest/)) generate?num=10&climateforecast=BN15,NN32,AN53&from=2016,2&to=2017,2&weatherhistory= [[http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:808/DataTransformation/rest/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:808/DataTransformation/rest/)]([http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:808/DataTransformation/rest/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:808/DataTransformation/rest/)) transform/[[http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/HW_SOS_2/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/HW_SOS_2/)]([http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/HW_SOS_2/](http://ec2-52-69-188-223.ap-northeast-1.compute.amazonaws.com:8080/HW_SOS_2/)) service?service=SOS&version=2.0.0&request=GetObservation&MergeObservationsIntoDataArray= true&offering=weatherhistory_urn:IBUNYA:AMeDAS-NIAES:GAMAGOORI-51281  
Result: XML document that contains the list of URLs to weather realization in WTD format, model name, climatological data and stochastic model parameters file is returned. The structure of XML document is same as the response from DisAg service.