public ManagePaymentMethodResponseMessage managePaymentMethod(
     String api,
     String safekey,
     managePaymentMethodType managePaymentMethodType,
     boolean managePaymentMethodTypeSpecified,
     additionalInfo additionalInformation,
     customer customer,
     VectorcustomField customfield,
     List<HeaderProperty> headers) {
   SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
   soapEnvelope.implicitTypes = true;
   soapEnvelope.dotNet = true;
   SoapObject soapReq =
       new SoapObject("http://soap.api.controller.web.payjar.com/", "managePaymentMethod");
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/",
       "AdditionalInformation",
       new additionalInfo().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Customer", new customer().getClass());
   soapReq.addProperty("Api", api);
   soapReq.addProperty("Safekey", safekey);
   soapReq.addProperty("managePaymentMethodType", managePaymentMethodType.toString());
   soapReq.addProperty("managePaymentMethodTypeSpecified", managePaymentMethodTypeSpecified);
   soapReq.addProperty("AdditionalInformation", additionalInformation);
   soapReq.addProperty("Customer", customer);
   soapReq.addProperty("Customfield", customfield);
   soapEnvelope.setOutputSoapObject(soapReq);
   HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
   try {
     if (headers != null) {
       httpTransport.call(
           "http://soap.api.controller.web.payjar.com/managePaymentMethod", soapEnvelope, headers);
     } else {
       httpTransport.call(
           "http://soap.api.controller.web.payjar.com/managePaymentMethod", soapEnvelope);
     }
     Object retObj = soapEnvelope.bodyIn;
     if (retObj instanceof SoapFault) {
       SoapFault fault = (SoapFault) retObj;
       Exception ex = new Exception(fault.faultstring);
       if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(ex);
     } else {
       SoapObject result = (SoapObject) retObj;
       if (result.getPropertyCount() > 0) {
         Object obj = result.getProperty(0);
         SoapObject j = (SoapObject) obj;
         ManagePaymentMethodResponseMessage resultVariable =
             new ManagePaymentMethodResponseMessage(j);
         return resultVariable;
       }
     }
   } catch (Exception e) {
     if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(e);
     e.printStackTrace();
   }
   return null;
 }
 public String hi(List<HeaderProperty> headers) {
   SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
   soapEnvelope.implicitTypes = true;
   soapEnvelope.dotNet = true;
   SoapObject soapReq = new SoapObject("http://soap.api.controller.web.payjar.com/", "hi");
   soapEnvelope.setOutputSoapObject(soapReq);
   HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
   try {
     if (headers != null) {
       httpTransport.call("http://soap.api.controller.web.payjar.com/hi", soapEnvelope, headers);
     } else {
       httpTransport.call("http://soap.api.controller.web.payjar.com/hi", soapEnvelope);
     }
     Object retObj = soapEnvelope.bodyIn;
     if (retObj instanceof SoapFault) {
       SoapFault fault = (SoapFault) retObj;
       Exception ex = new Exception(fault.faultstring);
       if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(ex);
     } else {
       SoapObject result = (SoapObject) retObj;
       if (result.getPropertyCount() > 0) {
         Object obj = result.getProperty(0);
         if (obj != null && obj.getClass().equals(SoapPrimitive.class)) {
           SoapPrimitive j = (SoapPrimitive) obj;
           String resultVariable = j.toString();
           return resultVariable;
         } else if (obj != null && obj instanceof String) {
           String resultVariable = (String) obj;
           return resultVariable;
         }
       }
     }
   } catch (Exception e) {
     if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(e);
     e.printStackTrace();
   }
   return "";
 }
  public GetTransactionResponseMessage getTransaction(
      String api,
      String safekey,
      additionalInfo additionalInformation,
      List<HeaderProperty> headers,
      String username,
      String password) {
    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    soapEnvelope.implicitTypes = true;
    soapEnvelope.dotNet = true;
    soapEnvelope.setAddAdornments(true);
    SoapObject soapReq = new SoapObject("", "n1:getTransaction");

    // getTransaction namespace, NB for PAYU
    AttributeInfo attributeInfo = new AttributeInfo();
    attributeInfo.setValue("http://soap.api.controller.web.payjar.com/");
    attributeInfo.setName("xmlns:n1");
    soapReq.addAttribute(attributeInfo);

    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/",
        "AdditionalInformation",
        new additionalInfo().getClass());
    soapReq.addProperty("Api", api);
    soapReq.addProperty("Safekey", safekey);
    additionalInformation.isGetTransaction = true;
    soapReq.addProperty("AdditionalInformation", additionalInformation);
    soapEnvelope.setOutputSoapObject(soapReq);

    // set security header for PAYU
    Element header[] = new Element[1];
    header[0] =
        new Element()
            .createElement(
                "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                "Security");
    header[0].setAttribute(null, "v:mustUnderstand", "1");

    Element to =
        new Element()
            .createElement(
                "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                "UsernameToken");

    Element action1 = new Element().createElement(null, "n0:Username");
    action1.setAttribute(
        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
        "Id",
        "UsernameToken-9");
    action1.addChild(Node.TEXT, username);
    to.addChild(Node.ELEMENT, action1);

    Element action2 = new Element().createElement(null, "n0:Password");
    action2.setAttribute(
        null,
        "Type",
        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
    action2.addChild(Node.TEXT, password);
    to.addChild(Node.ELEMENT, action2);

    header[0].addChild(Node.ELEMENT, to);

    soapEnvelope.headerOut = header;

    HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
    httpTransport.debug = true;
    try {
      httpTransport.getServiceConnection().setRequestProperty("Connection", "close");
      System.setProperty("http.keepAlive", "false");
      httpTransport.getServiceConnection().setRequestProperty("Accept-Encoding", "gzip");
      if (headers != null) {
        httpTransport.call(
            "http://soap.api.controller.web.payjar.com/getTransaction", soapEnvelope, headers);
      } else {
        sendgetTransaction(
            "http://soap.api.controller.web.payjar.com/getTransaction", soapEnvelope, 0);
      }
      Object retObj = soapEnvelope.bodyIn;
      if (retObj instanceof SoapFault) {
        SoapFault fault = (SoapFault) retObj;
        Exception ex = new Exception(fault.faultstring);
        if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(ex);
      } else {
        SoapObject result = (SoapObject) retObj;
        if (result.getPropertyCount() > 0) {
          Object obj = result.getProperty(0);
          SoapObject j = (SoapObject) obj;
          GetTransactionResponseMessage resultVariable = new GetTransactionResponseMessage(j);
          return resultVariable;
        }
      }
    } catch (Exception e) {
      if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(e);
      e.printStackTrace();
    }
    return null;
  }
 public DoTransactionResponseMessage doTransaction(
     String api,
     String safekey,
     transactionType transactionType,
     boolean transactionTypeSpecified,
     authenticationType authenticationType,
     boolean authenticationTypeSpecified,
     additionalInfo additionalInformation,
     customer customer,
     basket basket,
     fraud fraud,
     VectorcreditCard creditcard,
     Vectoreft eft,
     VectordiscoveryMiles discoveryMiles,
     VectorpayPal payPal,
     VectordebitCard debitcard,
     VectorloyaltyCard loyalty,
     VectorbankTransfer bankTransfer,
     Vectorwallet wallet,
     VectorthirdParty thirdParty,
     Vectorebucks ebucks,
     autoPay autopay,
     soulstace soulstace,
     globalpay globalpay,
     VectorcustomField customfield,
     credit credit,
     transactionRecord transactionRecord,
     List<HeaderProperty> headers) {
   SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
   soapEnvelope.implicitTypes = true;
   soapEnvelope.dotNet = true;
   SoapObject soapReq =
       new SoapObject("http://soap.api.controller.web.payjar.com/", "doTransaction");
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/",
       "AdditionalInformation",
       new additionalInfo().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Customer", new customer().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Basket", new basket().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Fraud", new fraud().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Autopay", new autoPay().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Soulstace", new soulstace().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Globalpay", new globalpay().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/", "Credit", new credit().getClass());
   soapEnvelope.addMapping(
       "http://soap.api.controller.web.payjar.com/",
       "TransactionRecord",
       new transactionRecord().getClass());
   soapReq.addProperty("Api", api);
   soapReq.addProperty("Safekey", safekey);
   soapReq.addProperty("TransactionType", transactionType.toString());
   soapReq.addProperty("TransactionTypeSpecified", transactionTypeSpecified);
   soapReq.addProperty("AuthenticationType", authenticationType.toString());
   soapReq.addProperty("AuthenticationTypeSpecified", authenticationTypeSpecified);
   soapReq.addProperty("AdditionalInformation", additionalInformation);
   soapReq.addProperty("Customer", customer);
   soapReq.addProperty("Basket", basket);
   soapReq.addProperty("Fraud", fraud);
   soapReq.addProperty("Creditcard", creditcard);
   soapReq.addProperty("Eft", eft);
   soapReq.addProperty("DiscoveryMiles", discoveryMiles);
   soapReq.addProperty("PayPal", payPal);
   soapReq.addProperty("Debitcard", debitcard);
   soapReq.addProperty("Loyalty", loyalty);
   soapReq.addProperty("BankTransfer", bankTransfer);
   soapReq.addProperty("Wallet", wallet);
   soapReq.addProperty("ThirdParty", thirdParty);
   soapReq.addProperty("Ebucks", ebucks);
   soapReq.addProperty("Autopay", autopay);
   soapReq.addProperty("Soulstace", soulstace);
   soapReq.addProperty("Globalpay", globalpay);
   soapReq.addProperty("Customfield", customfield);
   soapReq.addProperty("Credit", credit);
   soapReq.addProperty("TransactionRecord", transactionRecord);
   soapEnvelope.setOutputSoapObject(soapReq);
   HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
   try {
     if (headers != null) {
       httpTransport.call(
           "http://soap.api.controller.web.payjar.com/doTransaction", soapEnvelope, headers);
     } else {
       httpTransport.call("http://soap.api.controller.web.payjar.com/doTransaction", soapEnvelope);
     }
     Object retObj = soapEnvelope.bodyIn;
     if (retObj instanceof SoapFault) {
       SoapFault fault = (SoapFault) retObj;
       Exception ex = new Exception(fault.faultstring);
       if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(ex);
     } else {
       SoapObject result = (SoapObject) retObj;
       if (result.getPropertyCount() > 0) {
         Object obj = result.getProperty(0);
         SoapObject j = (SoapObject) obj;
         DoTransactionResponseMessage resultVariable = new DoTransactionResponseMessage(j);
         return resultVariable;
       }
     }
   } catch (Exception e) {
     if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(e);
     e.printStackTrace();
   }
   return null;
 }
  public SetTransactionResponseMessage setTransaction2(
      String api,
      String safekey,
      transactionType transactionType,
      boolean transactionTypeSpecified,
      boolean stage,
      boolean stageSpecified,
      additionalInfo additionalInformation,
      customer customer,
      basket basket,
      fraud fraud,
      VectorcreditCard creditcard,
      Vectoreft eft,
      VectorloyaltyCard loyalty,
      VectorbankTransfer bankTransfer,
      ebucks ebucks,
      autoPay autopay,
      soulstace soulstace,
      globalpay globalpay,
      VectorcustomField customfield,
      transactionRecord transactionRecord,
      List<HeaderProperty> headers,
      String username,
      String password) {
    SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    soapEnvelope.implicitTypes = false;
    soapEnvelope.dotNet = true;
    soapEnvelope.setAddAdornments(true);
    SoapObject soapReq = new SoapObject("", "n1:setTransaction");

    // settranaction namespace, NB for PAYU
    AttributeInfo attributeInfo = new AttributeInfo();
    attributeInfo.setValue("http://soap.api.controller.web.payjar.com/");
    attributeInfo.setName("xmlns:n1");
    soapReq.addAttribute(attributeInfo);

    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/",
        "AdditionalInformation",
        new additionalInfo().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Customer", new customer().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Basket", new basket().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Fraud", new fraud().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Ebucks", new ebucks().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Autopay", new autoPay().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Soulstace", new soulstace().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/", "Globalpay", new globalpay().getClass());
    soapEnvelope.addMapping(
        "http://soap.api.controller.web.payjar.com/",
        "TransactionRecord",
        new transactionRecord().getClass());

    soapReq.addProperty("Customer", customer);
    soapReq.addProperty("Api", api);
    soapReq.addProperty("Safekey", safekey);
    if (transactionTypeSpecified)
      soapReq.addProperty("TransactionType", transactionType.toString());
    if (stageSpecified) soapReq.addProperty("Stage", stage);
    soapReq.addProperty("AdditionalInformation", additionalInformation);
    soapReq.addProperty("Basket", basket);
    //        soapReq.addProperty("Fraud", fraud);
    //        soapReq.addProperty("Creditcard", creditcard);
    //        soapReq.addProperty("Loyalty", loyalty);
    //        soapReq.addProperty("BankTransfer", bankTransfer);
    //        soapReq.addProperty("Ebucks", ebucks);
    //        soapReq.addProperty("Autopay", autopay);
    //        soapReq.addProperty("Soulstace", soulstace);
    //        soapReq.addProperty("Globalpay", globalpay);
    // soapReq.addProperty("Customfield", customfield);
    soapReq.addProperty("TransactionRecord", transactionRecord);
    soapEnvelope.setOutputSoapObject(soapReq);

    // set security header for PAYU
    Element header[] = new Element[1];
    header[0] =
        new Element()
            .createElement(
                "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                "Security");
    header[0].setAttribute(null, "v:mustUnderstand", "1");

    Element to =
        new Element()
            .createElement(
                "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                "UsernameToken");

    Element action1 = new Element().createElement(null, "n0:Username");
    action1.setAttribute(
        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
        "Id",
        "UsernameToken-9");
    action1.addChild(Node.TEXT, username);
    to.addChild(Node.ELEMENT, action1);

    Element action2 = new Element().createElement(null, "n0:Password");
    action2.setAttribute(
        null,
        "Type",
        "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
    action2.addChild(Node.TEXT, password);
    to.addChild(Node.ELEMENT, action2);

    header[0].addChild(Node.ELEMENT, to);

    soapEnvelope.headerOut = header;

    HttpTransportSE httpTransport = new HttpTransportSE(url, timeOut);
    httpTransport.debug = true;
    try {
      if (headers != null) {
        httpTransport.call(
            "http://soap.api.controller.web.payjar.com/setTransaction", soapEnvelope, headers);
      } else {
        httpTransport.call(
            "http://soap.api.controller.web.payjar.com/setTransaction", soapEnvelope);
      }
      Object retObj = soapEnvelope.bodyIn;
      String a = soapEnvelope.toString();
      if (retObj instanceof SoapFault) {
        SoapFault fault = (SoapFault) retObj;
        Exception ex = new Exception(fault.faultstring);
        if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(ex);
      } else {
        SoapObject result = (SoapObject) retObj;
        if (result.getPropertyCount() > 0) {
          Object obj = result.getProperty(0);
          SoapObject j = (SoapObject) obj;
          SetTransactionResponseMessage resultVariable = new SetTransactionResponseMessage(j);
          return resultVariable;
        }
      }
    } catch (Exception e) {
      if (eventHandler != null) eventHandler.Wsdl2CodeFinishedWithException(e);
      e.printStackTrace();
    }
    return null;
  }