I'm trying to write a batch file that will simplify the generation of WebService stubs. The problem is that one of the SET commands for a variable is not setting the value. I've tried various things to get it to honour this SET but to no avail. Clearly missing something obvious. The rest of the script is working fine.
IF %1==-b (
ECHO %2
SET BINDINGS_FILE=%2
SHIFT & SHIFT
ECHO File: %BINDINGS_FILE%
IF EXIST "%BINDINGS_FILE%" (
SET BINDINGS=-b %BINDINGS_FILE%
) ELSE (
ECHO Please enter a valid Bindings file name: %BINDINGS_FILE%.
GOTO DONE
)
ECHO BINDINGS = %BINDINGS%
)
When I execute it with the following command, it prints the bindings file as %2 but the variable into which it gets SET remains empty.
generate-stubs.bat -b wsdl/Binding.xml -p com.acme.service wsdl/WebService.wsdl
wsdl/Binding.xml
File:
Please enter a valid Bindings file name: .
Done!
Any suggestions appreciated.