@echo off

for /f "usebackq tokens=*" %%i in (`cd`) do @set DIR_WORK=%%i
cd /D "%BIZXCLIENT_HOME%\bin"

set JAR_DIR=.
set JAR_FILES=
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\stax2-api-3.1.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\xalan.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\xercesImpl.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\xml-apis.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\serializer.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\axiom-api-1.2.20_om_util.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\bizx-client.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\bizx-axis2reconst.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\bizx-axis2org.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\bizx-server-adapter.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-codec-1.3.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-collections-3.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-dbcp-1.2.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-discovery-0.2.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-fileupload-1.1.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-httpclient-3.0.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-io-1.2.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-logging-1.1.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\commons-pool-1.3.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\log4j-1.3alpha-8.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\servletapi-2.3.jar
set JAR_FILES=%JAR_FILES%;%JAR_DIR%\sqlite.jar
set CLASSPATH=%JAR_FILES%

"%BIZXJAVA_HOME%\bin\java" ^
  -Xms128M ^
  -Xmx128M ^
  -Xss512K ^
  -classpath %CLASSPATH% ^
  -DConfigFileName=bizxcli.properties ^
  -DErrorFileName=bizxcli_error ^
  jp.webedi.sfi.bizx.client.communication.BizXClientMain 1 %1 %2

set RET_CODE=%errorlevel%
cd /D "%DIR_WORK%"

exit /b %RET_CODE%
