/*
 * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
 * This file contains definitions of the web service
 */

#include "MathOps.h"


MathOps::MathOps()
{
}

MathOps::~MathOps()
{
}

int MathOps::div(int Value0, int Value1)  
{
     if (Value1 == 0) 
     {
         DivByZeroStruct* pObjFault = new DivByZeroStruct();
         if(pObjFault)
         {
             pObjFault->varString = "Division by zero exception";
             pObjFault->varInt = 1;
             pObjFault->varFloat = 10.52;
             throw pObjFault;
         }
         //throw AxisDivByZeroException();
     }

     if(Value0 < 0 || Value1 < 0) 
     {
         OutOfBoundStruct* pObjFault = new OutOfBoundStruct();
         SpecialDetailStruct* pObjSpecialDetailFault = new SpecialDetailStruct();
         if(pObjSpecialDetailFault)
             pObjSpecialDetailFault->varString = "This bound exception is a forced limitation";
         if (pObjFault)
         {
             pObjFault->varString = "Value out of bound exception";
             pObjFault->varInt = 2;
             pObjFault->specialDetail = pObjSpecialDetailFault;
             throw pObjFault;
         }
     }

     if(Value0 == 1000)
     {
         SpecialDetailStruct* pObjFault = new SpecialDetailStruct();
         if(pObjFault)
         {
             pObjFault->varString = strdup("You have entered 1000 for the 1st paramter. 1000 is reserved. Please do not use it");
         throw pObjFault;
         }
         //throw AxisNormalDetailException();
     }

     return Value0/Value1;
        
}
