org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:timelyRenewal下的意外子元素

问题描述 投票:3回答:1

在点击axis2 Web服务之前,我得到以下异常。

org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:timelyRenewal下的意外子元素

我无法在tomcat或在Weblogic中运行的DEV环境中本地重现相同的问题。它只发生在Weblogic 11g上运行的1个环境中。这让我觉得我在那个环境中缺少一些配置,我不确定它是什么。对此的任何帮助都非常感谢。

这是调用Web服务的代码。

public  com.ibs.accouting.employeeVerificationResponse getEmployeeVerificationRequest(

                        com.ibs.accounting.EmployeeVerificationRequest employeeVerificationRequest108)


                throws java.rmi.RemoteException

                {
          org.apache.axis2.context.MessageContext _messageContext = null;
          try{
           org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[5].getName());
          _operationClient.getOptions().setAction("http://ibs.com/accounting/WBLEmployeeVerificationRequest");
          _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);



              addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&");


          // create a message context
          _messageContext = new org.apache.axis2.context.MessageContext();



          // create SOAP envelope with that payload
          org.apache.axiom.soap.SOAPEnvelope env = null;


                                                env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
                                                employeeVerificationRequest108,
                                                optimizeContent(new javax.xml.namespace.QName("http://ibs.com/accounting",
                                                "getEmployeeVerificationRequest")));

    //adding SOAP soap_headers
     _serviceClient.addHeadersToEnvelope(env);
    // set the message context with that soap envelope
    _messageContext.setEnvelope(env);

    // add the message contxt to the operation client
    _operationClient.addMessageContext(_messageContext);

    //execute the operation client
    _operationClient.execute(true);


           org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(
                                       org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();


                            java.lang.Object object = fromOM(
                                         _returnEnv.getBody().getFirstElement() ,
                                         com.ibs.accounting.EmployeeVerificationResponse.class,
                                          getEnvelopeNamespaces(_returnEnv));


                                    return (com.ibs.accounting.EmployeeVerificationResponse)object;

     }catch(org.apache.axis2.AxisFault f){

        org.apache.axiom.om.OMElement faultElt = f.getDetail();
        if (faultElt!=null){
            if (faultExceptionNameMap.containsKey(faultElt.getQName())){
                //make the fault by reflection
                try{
                    java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());
                    java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
                    java.lang.Exception ex=
                            (java.lang.Exception) exceptionClass.newInstance();
                    //message class
                    java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());
                    java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
                    java.lang.Object messageObject = fromOM(faultElt,messageClass,null);
                    java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
                               new java.lang.Class[]{messageClass});
                    m.invoke(ex,new java.lang.Object[]{messageObject});


                    throw new java.rmi.RemoteException(ex.getMessage(), ex);
                }catch(java.lang.ClassCastException e){
                   // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                } catch (java.lang.ClassNotFoundException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }catch (java.lang.NoSuchMethodException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                } catch (java.lang.reflect.InvocationTargetException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }  catch (java.lang.IllegalAccessException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }   catch (java.lang.InstantiationException e) {
                    // we cannot intantiate the class - throw the original Axis fault
                    throw f;
                }
            }else{
                throw f;
            }
        }else{
            throw f;
        }
        } finally {
            _messageContext.getTransportOut().getSender().cleanup(_messageContext);
        }
    }
java web-services soap axis2
1个回答
0
投票

这个错误可能会产生误导。在我修改了WSDL并添加了一个新的必需元素之后,我创建了我的客户端。比这个错误出现了。解决方案是,我忘了在我的Web服务的一个方法中填充此元素。如果出现此错误,还要检查服务器中是否填写了必需元素。它在一个环境中而不是在另一个环境中工作也意味着,强制项目填充在一个服务器(开发服务器)上而不是在另一个服务器上(生产服务器)。

© www.soinside.com 2019 - 2024. All rights reserved.