簡體   English   中英

org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:Unexpected subelement underTimelyRenewal

[英]org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement underTimelyRenewal

在點擊軸 2 網絡服務之前,我收到以下異常。

org.apache.axis2.AxisFault:org.apache.axis2.databinding.ADBException:Unexpected subelement underTimelyRenewal

我無法在 tomcat 本地或在 Weblogic 中運行的 DEV 環境中重現相同的問題。 它只發生在 1 個在 Weblogic 11g 上運行的環境中。 這讓人覺得我在那個環境中缺少一些配置,我不確定它是什么。 對此的任何幫助表示高度贊賞。

這是調用 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);
        }
    }

這個錯誤可能有點誤導。 在我修改了 WSDL 並添加了一個新的必需元素之后,我創建了我的客戶端。 比這個錯誤出現了。 解決方案是,我忘記在我的 Web 服務的一種方法中填充這個元素。 如果出現此錯誤,還要檢查服務器中是否填寫了您的必填元素。 它在一種環境下工作而不在另一種環境中工作也可能意味着,在一台服務器(開發服務器)而不是在另一台(生產服務器)下填寫必填項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM