package com.thinkgem.jeesite.modules.pay.pinganbank;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;

public class PingAnBankService {

    public static void main(String args[]) throws Exception {

//		String url = "http://127.0.0.1:7072/";
//		String xml = "";
//		HttpUtil.postXml(url,xml);
// 00202043000000326000 企业码
        String res = "A0010102010020204300000032600000000001084014       0120100809171028    2010080981026055                                                                                                          00000                       0<?xml version=\"1.0\" encoding=\"GBK\"?><Result><Account>11002873390701</Account><CcyCode>RMB</CcyCode></Result>";
        PostMethod postMethod = new PostMethod(
                "http://127.0.0.1:7072");

        postMethod.setRequestEntity(new StringRequestEntity(
                res, "text/html", "UTF-8"));
        postMethod.setRequestHeader("Content-Type",
                "text/xml; charset=UTF-8");

        HttpClient httpClient = new HttpClient();
        int resultint = httpClient.executeMethod(postMethod);
        res = new String(postMethod.getResponseBody(),"UTF-8");
        System.out.println("http response:" + res);
        postMethod.releaseConnection();
        System.out.println(resultint);

    }
}
