#!/bin/sh
#
# Get coregrade_api root directory
cd ..
WORK_DIR=`pwd`
# Checking user
if [ "$USER" = "root" ]
then
    echo "Do not run as root!"
    exit 1
fi
# Configure extension
cd $WORK_DIR/src/

echo "Generating interswitch proxy..."
cd shared_tool/soap
wsdl2h -ninterswitch -Ninterswitch -qinterswitch -o QuickTellerService.h https://stageserv.interswitchng.com/uat_quicktellerservice/quickteller.svc?wsdl
#wsdl2h -o QuickTellerService.h https://stageserv.interswitchng.com/uat_quicktellerservice/quickteller.svc?wsdl
soapcpp2 -n -pinterswitch -qinterswitch -1 -C -i -I/usr/share/gsoap/import/ QuickTellerService.h
#soapcpp2 -C -i -I/usr/share/gsoap/import/ QuickTellerService.h
## copy C++
#cp soapC.cpp ../soapC.cc
#cp soapBasicHttpBinding_USCOREQuickTellerServiceProxy.cpp ../soapBasicHttpBinding_USCOREQuickTellerServiceProxy.cc
## copy headers
#cp soapH.h ../../include/
#cp soapBasicHttpBinding_USCOREQuickTellerServiceProxy.h ../../include/
#cp BasicHttpBinding_USCOREQuickTellerService.nsmap ../../include/
#cp soapStub.h ../../include/
# copy C++
cp interswitchC.cpp ../interswitchC.cc
cp interswitchBasicHttpBinding_USCOREQuickTellerServiceProxy.cpp ../interswitchBasicHttpBinding_USCOREQuickTellerServiceProxy.cc
# copy headers
cp interswitchH.h ../../include/
cp interswitchBasicHttpBinding_USCOREQuickTellerServiceProxy.h ../../include/
cp interswitch.nsmap ../../include/
cp interswitchStub.h ../../include/
cd ../..
