java中axis2-1.6.2中的webservice客户端实现

java中axis2-1.6.2中的webservice客户端实现,java,web-services,Java,Web Services,我已经用java在axis2-1.6.2中实现了webservice客户端,第一次调用时得到响应,第二次调用时得到以下错误 java.lang.NullPointerException at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:293) at org.apache.axis2.description.OutInAxisOperationClient.

我已经用java在axis2-1.6.2中实现了webservice客户端,第一次调用时得到响应,第二次调用时得到以下错误

java.lang.NullPointerException
 at org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClient.java:293)
        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:180)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
 at org.apache.axis2.ccws.CustomerCareServiceStub.subscriberRetrieveLite(CustomerCareServiceStub.java:2380)
        at Prepost.SubscriberRetrieveBalance.subscriberRetrieveLite(SubscriberRetrieveBalance.java:111)
        at Prepost.CheckUser.doGet(CheckUser.java:149)
下面是API实现类构造函数,它设置了唯一的参数,该参数对于所有请求都是相同的

public SubscriberRetrieveBalance(String url, String strCON_TimeOut, String strSO_TimeOut) {
    try {
        this.url = url;
        stub = new CustomerCareServiceStub(url);
        ServiceClient sClient = stub._getServiceClient();
        Options options = sClient.getOptions();
        options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
        options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION, AddressingConstants.Submission.WSA_NAMESPACE);
        //options.setTimeOutInMilliSeconds(2000);
        TransportInDescription transportIn = new TransportInDescription("HTTP");
        options.setTransportIn(transportIn);
        options.setProperty(HTTPConstants.SO_TIMEOUT, Integer.parseInt(strSO_TimeOut));
        options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.parseInt(strCON_TimeOut));
        sClient.setOptions(options);
    } catch (Exception e) {
        if (e.getMessage().equals("Can not find the external id")) {
            System.out.println("Exception ::" + e.getMessage());
        }
    }
}
它在一个servlet中被调用,为了性能问题,我为不同的-2状态(URL)创建了这个类的对象,并在第一个请求到达相应状态时将这些对象保存到hashmap中,然后创建新对象并将该对象用于该状态的后续请求

SubscriberRetrieveBalance objBal = null;
            BalanceBean bal = new BalanceBean();
            if (mapObj.isEmpty() || (mapObj.get(strIP) == null)) {

                objBal = new SubscriberRetrieveBalance(url, strCON_TimeOut, strSO_TimeOut);
                mapObj.put(strIP, objBal);
            } else {

                objBal = mapObj.get(strIP);
            }
            bal = objBal.subscriberRetrieveLite(strMsisdn, userId, token, strCircleId, strCircleName, strSessionId, strDlgId);
它第一次给出响应,然后给出属于该状态的所有请求的nullpointer异常和以上错误

SubscriberRetrieveBalance objBal = null;
            BalanceBean bal = new BalanceBean();
            if (mapObj.isEmpty() || (mapObj.get(strIP) == null)) {

                objBal = new SubscriberRetrieveBalance(url, strCON_TimeOut, strSO_TimeOut);
                mapObj.put(strIP, objBal);
            } else {

                objBal = mapObj.get(strIP);
            }
            bal = objBal.subscriberRetrieveLite(strMsisdn, userId, token, strCircleId, strCircleName, strSessionId, strDlgId);
这段代码在axis2-1.5上运行良好

axis2-1.6.2版本中是否有任何更改,每次都需要API实现类的新对象

请建议