diff --git a/scripts/rest-clients/README b/scripts/rest-clients/README index 64adc0dd4..70fc9c778 100644 --- a/scripts/rest-clients/README +++ b/scripts/rest-clients/README @@ -6,6 +6,13 @@ + When working with the local application: + * Get XML Schema for any service: + + - get-xml-schema.sh + + Example: + - get-xml-schema.sh criteriontypes + * [Optional] For clarity: remove "navaldev" database + reload Jetty. * Import criterion types: @@ -42,21 +49,9 @@ - update-order.sh order-update-sample.xml (authenticate with wswriter/wswriter) -+ When working with the online demo: ++ When working with the online demo add "--prod" argument to every command. +Example: * import-criterions-types.sh --prod criterion-types-sample.xml (authenticate with wswriter/wswriter) - * export-criterion-types.sh --prod (authenticate with wsreader/wsreader) - - * import-resources.sh --prod resources-sample.xml - (authenticate with wswriter/wswriter) - - * export-order-element.sh --prod ORDER-ELEMENT-CODE (authenticate with - wsreader/wsreader) - - * import-order.sh --prod order-sample.xml (authenticate with - wswriter/wswriter) - - * update-order.sh --prod order-update-sample.xml (authenticate with - wswriter/wswriter) diff --git a/scripts/rest-clients/get-xml-schema.sh b/scripts/rest-clients/get-xml-schema.sh new file mode 100755 index 000000000..9bcf90d32 --- /dev/null +++ b/scripts/rest-clients/get-xml-schema.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +. ./rest-common-env.sh + +printf "Login name: " +read loginName +printf "Password: " +read password + +baseServiceURL=$DEVELOPMENT_BASE_SERVICE_URL +certificate=$DEVELOPMENT_CERTIFICATE + +for i in "$@" +do + if [ "$i" = "--prod" ]; then + baseServiceURL=$PRODUCTION_BASE_SERVICE_URL + certificate=$PRODUCTION_CERTIFICATE + else + service=$i + fi +done + +if [ "$service" = "" ]; then + printf "Missing service path\n" 1>&2 + exit 1 +fi + +authorization=`./base64.sh $loginName:$password` + + +wget --no-check-certificate \ + --header "Authorization: Basic $authorization" \ + -O $service-schema.xml \ + $baseServiceURL/$service/?_wadl&_type=xml