微信支付,怎么获取prepay_id?

Java写的,获取到的prepay_id 一直为空,不知道该怎么获取,这与设置API秘钥有关吗?

public static String getPayNo(String url, String xmlParam) {
DefaultHttpClient client = new DefaultHttpClient();
client.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS,
true);
HttpPost httpost = HttpClientConnectionManager.getPostMethod(url);
String prepay_id = "";
try {
httpost.setEntity(new StringEntity(xmlParam, "UTF-8"));
HttpResponse response = httpclient.execute(httpost);
String jsonStr = EntityUtils
.toString(response.getEntity(), "UTF-8");

        System.out.println("--jsonStr--"+jsonStr);
        Map<String, Object> dataMap = new HashMap<String, Object>();

        if (jsonStr.indexOf("FAIL") != -1) {
            return prepay_id;
        }
        Map map = doXMLParse(jsonStr);
        String return_code = (String) map.get("return_code");
        prepay_id = (String) map.get("prepay_id");
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return prepay_id;
}

有没有签名,自己去做签名,然后给微信那边发送请求后返回prepay_id

可以看看官网返回 prepay_id的接口
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
API对应的SDK和调用示例
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=11_1

微信的调用示例就不用看了,n年没更新了,一般微信支付的流程是组装参数、生成sign,与微信预下单接口交互,完了再根据预下单接口返回的参数和之前掉预下单接口的参数,再生成sign,返回app端,拉起支付页面。整个流程都是XML格式协议,这点很重要,好久之前做的了,有什么再问

https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1