Eway Recurring Payment in android

最后都变了- 提交于 2019-12-14 03:22:10

问题


how to resolve

This is response when i called soap service, eway document provide only api but not solution when i getting this type of response.

anyType{Result=Fail; ErrorSeverity=Error; ErrorDetails=The 'eWayCustomerID' element has an invalid value according to its data type.; RebillCustomerID=0; }

this my code

 public void callWebservice()
    {
        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
        Request.addProperty("customerTitle", "Mr");
        Request.addProperty("customerFirstName", "kk");
        Request.addProperty("customerLastName", "mine");
        Request.addProperty("customerAddress", "");
        Request.addProperty("customerSuburb", "");
        Request.addProperty("customerState", "");
        Request.addProperty("customerCompany", "");
        Request.addProperty("customerPostCode", "");
        Request.addProperty("customerCountry", "");
        Request.addProperty("customerEmail", "");
        Request.addProperty("customerFax", "");
        Request.addProperty("customerPhone1", "");
        Request.addProperty("customerPhone2", "");
        Request.addProperty("customerRef", "Ref1234");
        Request.addProperty("customerJobDesc", "");
        Request.addProperty("customerComments", "Please Ship ASASP");
        Request.addProperty("customerURL", "");


        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        envelope.headerOut = new Element[1];
        envelope.headerOut[0] = buildAuthHeader();

        Log.i("header", "" + envelope.headerOut.toString());

        envelope.dotNet = true;
        envelope.bodyOut = Request;
        envelope.setOutputSoapObject(Request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        Log.i("bodyout", "" + envelope.bodyOut.toString());

        try {
            androidHttpTransport.debug = false;
            androidHttpTransport.call(SOAP_ACTION, envelope);

            SoapObject response = (SoapObject)envelope.getResponse();
//            SoapPrimitive resultString = (SoapPrimitive) envelope.getResponse();
            Log.i("myApp", response.toString());
            System.out.println("*****" + response.toString());
        }
        catch (SoapFault e)
        {
            e.printStackTrace();
        }
        catch (Exception e)
        {
            e.printStackTrace();
            Log.d("Exception Generated", "" + e.getMessage());
        }
    }

    private Element buildAuthHeader()
    {
        Element h = new Element().createElement(NAMESPACE, "AuthHeader");
        Element ewayCId = new Element().createElement(NAMESPACE,"eWAYCustomerID");
        ewayCId.addChild(Node.TEXT,"");
        h.addChild(Node.ELEMENT,ewayCId);
        Element username = new Element().createElement(NAMESPACE, "Username");
        username.addChild(Node.TEXT, "");
        h.addChild(Node.ELEMENT, username);
        Element pass = new Element().createElement(NAMESPACE, "Password");
        pass.addChild(Node.TEXT, "");
        h.addChild(Node.ELEMENT, pass);

        return h;
    }

Please Help Me.

The answer is appreciate and Thank you

来源:https://stackoverflow.com/questions/37882338/eway-recurring-payment-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!