Package org.apache.juddi.datatype.response

Examples of org.apache.juddi.datatype.response.Result


        faultActor = rex.getFaultActor()// SOAP Fault faultActor
       
        DispositionReport dispRpt = rex.getDispositionReport();
        if (dispRpt != null)
        {
          Result result = null;
          ErrInfo errInfo = null;
       
          Vector results = dispRpt.getResultVector();
          if ((results != null) && (!results.isEmpty()))
            result = (Result)results.elementAt(0);
       
          if (result != null)
          {
            errno = String.valueOf(result.getErrno())// UDDI DispositionReport errno
            errInfo = result.getErrInfo();
         
            if (errInfo != null)
            {
              errCode = errInfo.getErrCode()// UDDI DispositionReport errCode
              errText = errInfo.getErrMsg()// UDDI DispositionReport errMsg
            }
          }
        }
      }
      else
      {
        // All other exceptions (other than RegistryException
        // and subclasses) are either a result of a jUDDI
        // configuration problem or something that we *should*
        // be catching and converting to a RegistryException
        // but are not (yet!).
         
        faultCode = "Server";
        faultString = ex.getMessage();
        faultActor = null;
         
        errno = String.valueOf(Result.E_FATAL_ERROR);
        errCode = Result.lookupErrCode(Result.E_FATAL_ERROR);
        errText = Result.lookupErrText(Result.E_FATAL_ERROR) +
                  " An internal UDDI server error has " +
                  "occurred. Please report this error " +
                  "to the UDDI server administrator.";
      }
           
      // We should have everything we need to assemble
      // the SOAPFault so lets piece it together and
      // send it on it's way.
             
      try {
        SOAPBody soapResBody = soapResEnv.getBody();
        SOAPFault soapFault = soapResBody.addFault();
        soapFault.setFaultCode(faultCode);
        soapFault.setFaultString(faultString);
        soapFault.setFaultActor(faultActor);
       
        Detail faultDetail = soapFault.addDetail();
       
        SOAPElement dispRpt = faultDetail.addChildElement("dispositionReport","",IRegistry.UDDI_V2_NAMESPACE);       
        dispRpt.setAttribute("generic",IRegistry.UDDI_V2_GENERIC);
        dispRpt.setAttribute("operator",Config.getOperator());
       
        SOAPElement result = dispRpt.addChildElement("result");
        result.setAttribute("errno",errno);
       
        SOAPElement errInfo = result.addChildElement("errInfo");
        errInfo.setAttribute("errCode",errCode);
        errInfo.setValue(errText);
      }
      catch (Exception e) {
        e.printStackTrace();
View Full Code Here


        faultActor = rex.getFaultActor()// SOAP Fault faultActor
       
        DispositionReport dispRpt = rex.getDispositionReport();
        if (dispRpt != null)
        {
          Result result = null;
          ErrInfo errInfo = null;
       
          Vector results = dispRpt.getResultVector();
          if ((results != null) && (!results.isEmpty()))
            result = (Result)results.elementAt(0);
       
          if (result != null)
          {
            errno = String.valueOf(result.getErrno())// UDDI Result errno
            errInfo = result.getErrInfo();
         
            if (errInfo != null)
            {
              errCode = errInfo.getErrCode()// UDDI ErrInfo errCode
              errText = errInfo.getErrMsg()// UDDI ErrInfo errMsg
            }
          }
        }
      }
      else if (ex instanceof SOAPException)
      {
        log.error(ex.getMessage());
         
        // Because something occured that jUDDI wasn't expecting
        // let's set default SOAP Fault values.  Since SOAPExceptions
        // here are most likely XML validation errors let's blame the
        // client by placing "Client" in the Fault Code and pass
        // the Exception message back to the client.
       
        faultCode = "Client";
        faultString = ex.getMessage();
        faultActor = null;
       
        // Let's set default values for the UDDI DispositionReport
        // here.  While we didn't catch a RegistryException (or
        // subclass) we're going to be friendly and include a
        // FatalError DispositionReport within the message from the
        // SAX parsing problem in the SOAP Fault anyway.
       
        errno = String.valueOf(Result.E_FATAL_ERROR);
        errCode = Result.lookupErrCode(Result.E_FATAL_ERROR);
        errText = Result.lookupErrText(Result.E_FATAL_ERROR) +
                  " " + ex.getMessage();
      }
      else // anything else
      {
        // All other exceptions (other than SOAPException or
        // RegistryException and subclasses) are either a result
        // of a jUDDI configuration problem or something that
        // we *should* be catching and converting to a
        // RegistryException but are not (yet!).
           
        log.error(ex.getMessage(),ex);

        // Because something occured that jUDDI wasn't expecting
        // let's set default SOAP Fault values.  Since jUDDI
        // should be catching anything significant let's blame
        // jUDDI by placing "Server" in the Fault Code and pass
        // the Exception message on to the client.
       
        faultCode = "Server";
        faultString = ex.getMessage();
        faultActor = null;
         
        // Let's set default values for the UDDI DispositionReport
        // here.  While we didn't catch a RegistryException (or
        // subclass) but we're going to be friendly and include a
        // FatalError DispositionReport within the SOAP Fault anyway.
       
        errno = String.valueOf(Result.E_FATAL_ERROR);
        errCode = Result.lookupErrCode(Result.E_FATAL_ERROR);
        errText = Result.lookupErrText(Result.E_FATAL_ERROR) +
                  " An internal UDDI server error has " +
                  "occurred. Please report this error " +
                  "to the UDDI server administrator.";
      }
     
      // We should have everything we need to assemble
      // the SOAPFault so lets piece it together and
      // send it on it's way.
     
      try {
        SOAPBody soapResBody = soapRes.getSOAPBody();    
        SOAPFault soapFault = soapResBody.addFault();
        soapFault.setFaultCode(faultCode);
        soapFault.setFaultString(faultString);
        soapFault.setFaultActor(faultActor);
       
        // We're always going to include a DispositionReport (for
        // the hell of it) so that's what we're doing here.
      
        Detail faultDetail = soapFault.addDetail();
       
        SOAPElement dispRpt = faultDetail.addChildElement("dispositionReport","",IRegistry.UDDI_V2_NAMESPACE);       
        dispRpt.setAttribute("generic",IRegistry.UDDI_V2_GENERIC);
        dispRpt.setAttribute("operator",Config.getOperator());
       
        SOAPElement result = dispRpt.addChildElement("result");
        result.setAttribute("errno",errno);
       
        SOAPElement errInfo = result.addChildElement("errInfo");
        errInfo.setAttribute("errCode",errCode);
        errInfo.setValue(errText);
      }
      catch (Exception e) { // if we end up in here it's just NOT good.
        log.error("A serious error has occured while assembling the SOAP Fault.",e);
View Full Code Here

    String errCode = Result.lookupErrCode(errno);

    setFaultCode(fCode);
    setFaultString(getMessage());
    addResult(new Result(errno,errCode,getMessage()));
  }
View Full Code Here

    // just return a successful DispositionReport.
   
    DispositionReport dispRpt = new DispositionReport();
    dispRpt.setGeneric(generic);
    dispRpt.setOperator(Config.getOperator());
    dispRpt.addResult(new Result(Result.E_SUCCESS));
    return dispRpt;
  }
View Full Code Here

    // didn't encounter an exception so let's create
    // and return a successfull DispositionReport
    DispositionReport dispRpt = new DispositionReport();
    dispRpt.setGeneric(generic);
    dispRpt.setOperator(Config.getOperator());
    dispRpt.addResult(new Result(Result.E_SUCCESS));
    return dispRpt;

  }
View Full Code Here

    // didn't encounter an exception so let's create
    // and return a successfull DispositionReport
    DispositionReport dispRpt = new DispositionReport();
    dispRpt.setGeneric(generic);
    dispRpt.setOperator(Config.getOperator());
    dispRpt.addResult(new Result(Result.E_SUCCESS));
    return dispRpt;

  }
View Full Code Here

    // didn't encounter an exception so let's create
    // and return a successfull DispositionReport
    DispositionReport dispRpt = new DispositionReport();
    dispRpt.setGeneric(generic);
    dispRpt.setOperator(Config.getOperator());
    dispRpt.addResult(new Result(Result.E_SUCCESS));
    return dispRpt;
  }
View Full Code Here

    // didn't encounter an exception so let's create
    // and return a successfull DispositionReport
    DispositionReport dispRpt = new DispositionReport();
    dispRpt.setGeneric(generic);
    dispRpt.setOperator(Config.getOperator());
    dispRpt.addResult(new Result(Result.E_SUCCESS));
    return dispRpt;
  }
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    Result obj = new Result();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    obj.setErrno(element.getAttribute("errno"));

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,ErrInfoHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(ErrInfoHandler.TAG_NAME);
      obj.setErrInfo((ErrInfo)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    Result result = (Result)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);
    AbstractHandler handler = null;

    element.setAttribute("errno",String.valueOf(result.getErrno()));

    ErrInfo errInfo = result.getErrInfo();
    if (errInfo!=null)
    {
      handler = maker.lookup(ErrInfoHandler.TAG_NAME);
      handler.marshal(errInfo,element);
    }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.response.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.