Java Code Examples for com.alipay.api.internal.parser.xml.ObjectXmlParser

The following examples show how to use com.alipay.api.internal.parser.xml.ObjectXmlParser. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: alipay-sdk-java-all   Author: alipay   File: AbstractAlipayClient.java    License: Apache License 2.0 6 votes vote down vote up
public <T extends AlipayResponse> T execute(AlipayRequest<T> request, String accessToken,
                                            String appAuthToken, String targetAppId) throws AlipayApiException {

    //如果根证书序列号非空,抛异常提示开发者使用certificateExecute
    if (!StringUtils.isEmpty(this.alipayRootCertSN)) {
        throw new AlipayApiException("检测到证书相关参数已初始化,证书模式下请改为调用certificateExecute");
    }

    AlipayParser<T> parser = null;
    if (AlipayConstants.FORMAT_XML.equals(this.format)) {
        parser = new ObjectXmlParser<T>(request.getResponseClass());
    } else {
        parser = new ObjectJsonParser<T>(request.getResponseClass());
    }

    return _execute(request, parser, accessToken, appAuthToken, targetAppId);
}
 
Example #2
Source Project: alipay-sdk   Author: wendal   File: DefaultAlipayClient.java    License: Apache License 2.0 5 votes vote down vote up
public <T extends AlipayResponse> T execute(AlipayRequest<T> request, String accessToken,
                                            String appAuthToken) throws AlipayApiException {

    AlipayParser<T> parser = null;
    if (AlipayConstants.FORMAT_XML.equals(this.format)) {
        parser = new ObjectXmlParser<T>(request.getResponseClass());
    } else {
        parser = new ObjectJsonParser<T>(request.getResponseClass());
    }

    return _execute(request, parser, accessToken, appAuthToken);
}
 
Example #3
Source Project: pay   Author: 1991wangliang   File: DefaultAlipayClient.java    License: Apache License 2.0 5 votes vote down vote up
public <T extends AlipayResponse> T execute(AlipayRequest<T> request, String accessToken,
                                            String appAuthToken) throws AlipayApiException {

    AlipayParser<T> parser = null;
    if (AlipayConstants.FORMAT_XML.equals(this.format)) {
        parser = new ObjectXmlParser<T>(request.getResponseClass());
    } else {
        parser = new ObjectJsonParser<T>(request.getResponseClass());
    }

    return _execute(request, parser, accessToken, appAuthToken);
}