summaryrefslogtreecommitdiff
path: root/examples/ndfd/genbindings.sh
blob: 44644b842eaf69693ce3f0cfa13977460564598c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
URI='http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd'
PREFIX='DWML'

rm -rf uriArchive
rm -rf raw ${PREFIX}.py
mkdir -p raw
touch raw/__init__.py
pyxbgen \
   -u "${URI}" \
   -m "${PREFIX}" \
   --uri-content-archive-directory=uriArchive \
   -r || exit
if [ ! -f ${PREFIX}.py ] ; then
  echo "from raw.${PREFIX} import *" > ${PREFIX}.py
fi

# Retrieve the wsdl.  Heck, show it off even.  Just not using it yet.
WSDL_URI='http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl'
if [ ! -f ndfdXML.wsdl ] ; then
  wget ${WSDL_URI}
fi
rm -f raw/ndfd.py
pyxbgen \
   -W "${WSDL_URI}" \
   -m ndfd \
   --uri-content-archive-directory=uriArchive \
   -r || exit

pyxbwsdl file:ndfdXML.wsdl

# Get an example query
if [ ! -f NDFDgen.xml ] ; then
  wget http://www.weather.gov/forecasts/xml/docs/SOAP_Requests/NDFDgen.xml
fi