Transport.send(message); else throw new DispositionReportFaultMessage("Session is null!", null); } catch (Exception e) { log.error(e.getMessage(),e); throw new DispositionReportFaultMessage(e.getMessage(), null);
public static DispositionReport MapException(DispositionReportFaultMessage ex, String operator) { if (ex == null) { return null; } DispositionReport r = new DispositionReport(ex.getMessage() + (ex.detail != null ? ex.detail.getMessage() : ""), MapDispositionReport(ex.getFaultInfo(), operator)); return r; }
public void getNonExitingBusiness() { String nonExistingKey = "nonexistingKey"; try { GetBusinessDetail body = new GetBusinessDetail(); body.getBusinessKey().add(nonExistingKey); BusinessDetail result = inquiry.getBusinessDetail(body); Assert.fail("No business should be found"); System.out.println(result.getBusinessEntity().size()); } catch (Exception e) { try { System.out.println("(Expected) Error message = " + e.getMessage()); DispositionReport report = DispositionReportFaultMessage.getDispositionReport(e); assertNotNull(report); assertTrue(report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED)); } catch (Exception e1) { Assert.fail("We only expect DispositionReportFaultMessage, not " + e1.getClass()); logger.error(e.getMessage(), e1); } } }
log.error(dr.getMessage(), dr); tx.rollback(); throw dr;
private static String dispositionReportFaultMessageToString(DispositionReportFaultMessage f) { StringBuilder err = new StringBuilder(); if (f != null && f.getFaultInfo() != null) { for (int i = 0; i < f.getFaultInfo().getResult().size(); i++) { err.append("Error number" + f.getFaultInfo().getResult().get(i).getErrno()); if (f.getFaultInfo().getResult().get(i).getKeyType() != null) { err.append(" keytype " + f.getFaultInfo().getResult().get(i).getKeyType().value()); } if (f.getFaultInfo().getResult().get(i).getErrInfo() != null) { err.append( " errocode " + f.getFaultInfo().getResult().get(i).getErrInfo().getErrCode() + " msg " + f.getFaultInfo().getResult().get(i).getErrInfo().getValue()); } } } return err.toString(); } }
log.error(dr.getMessage(), dr); tx.rollback(); throw dr;
if (e instanceof DispositionReportFaultMessage) { DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) e; report = faultMsg.getFaultInfo(); } else if (e instanceof SOAPFaultException) { SOAPFaultException soapFault = (SOAPFaultException) e; && ute.getUndeclaredThrowable().getCause().getCause() instanceof DispositionReportFaultMessage) { DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) ute.getUndeclaredThrowable().getCause().getCause(); report = faultMsg.getFaultInfo();
Transport.send(message); else throw new DispositionReportFaultMessage("Session is null!", null); } catch (Exception e) { log.error(e.getMessage(),e); throw new DispositionReportFaultMessage(e.getMessage(), null);
} catch (DispositionReportFaultMessage e) { body.setAuthInfo("Failed to generate token, please contact UDDI admin"); log.error(e.getMessage(), e);
DispositionReport dr = DispositionReportFaultMessage.getDispositionReport(e); if (dr != null) { JAXBMarshaller.marshallToElement(dr, "org.uddi.api_v3", element);
Transport.send(message); } else { throw new DispositionReportFaultMessage("Session is null!", null); throw new DispositionReportFaultMessage(e.getMessage(), null);
} catch (DispositionReportFaultMessage e) { body.setAuthInfo("Failed to generate token, please contact UDDI admin"); log.error(e.getMessage(), e);
/** * finds a tModel * * @param findTModel * @param node * @return null if not found or error * @throws RemoteException * @throws TransportException * @throws ConfigurationException */ public TModelList findTModel(FindTModel findTModel, Node node) throws RemoteException, TransportException, ConfigurationException { findTModel.setAuthInfo(getAuthToken(node.getSecurityUrl())); try { TModelList tModelList = getUDDINode(node).getTransport().getUDDIInquiryService(node.getInquiryUrl()).findTModel(findTModel); return tModelList; } catch (DispositionReportFaultMessage dr) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr); checkForErrorInDispositionReport(report, null, null); } catch (SOAPFaultException sfe) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe); checkForErrorInDispositionReport(report, null, null); } catch (UndeclaredThrowableException ute) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute); checkForErrorInDispositionReport(report, null, null); }catch (Throwable t){ throw new RemoteException("Unhandled exception", t); } return null; }
Transport.send(message); } else { throw new DispositionReportFaultMessage("Session is null!", null); throw new DispositionReportFaultMessage(e.getMessage(), null);
} catch (DispositionReportFaultMessage df) { logger.error("Unable to transfer entities from " + sourceNode + " to node " + getNode() + " to user " + publisher.getAuthorizedName(), df); throw new TransferNotAllowedException(new ErrorMessage("E_transferBlocked", df.getMessage())); } catch (Exception ex) { logger.error("Unable to transfer entities from " + sourceNode + " to node " + getNode() + " to user " + publisher.getAuthorizedName(), ex);
/** * Gets service details or NULL if it doesn't exist or an error occurred * * @param getDetail * @param node * @return null if not found * @throws RemoteException * @throws TransportException * @throws ConfigurationException */ public ServiceDetail getServiceDetail(GetServiceDetail getDetail, Node node) throws RemoteException, TransportException, ConfigurationException { getDetail.setAuthInfo(getAuthToken(node.getSecurityUrl())); try { ServiceDetail tModelDetail = getUDDINode(node).getTransport().getUDDIInquiryService(node.getInquiryUrl()).getServiceDetail(getDetail); return tModelDetail; } catch (DispositionReportFaultMessage dr) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr); checkForErrorInDispositionReport(report, null, null); } catch (SOAPFaultException sfe) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe); checkForErrorInDispositionReport(report, null, null); } catch (UndeclaredThrowableException ute) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute); checkForErrorInDispositionReport(report, null, null); } catch (Throwable t){ throw new RemoteException("Unhandled exception", t); } return null; }
public static DispositionReportFaultMessage MapException(SOAPFaultException ex) { org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport(); r.setTruncated(false); r.getResult().addAll(MapFault(ex.getFault())); DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r); return x; }
} catch (DispositionReportFaultMessage df) { logger.error("Unable to transfer entities from " + sourceNode + " to node " + getNode() + " to user " + publisher.getAuthorizedName(), df); throw new TransferNotAllowedException(new ErrorMessage("E_transferBlocked", df.getMessage())); } catch (Exception ex) { logger.error("Unable to transfer entities from " + sourceNode + " to node " + getNode() + " to user " + publisher.getAuthorizedName(), ex);
return tModelDetail; } catch (DispositionReportFaultMessage dr) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr); checkForErrorInDispositionReport(report, null, null); } catch (SOAPFaultException sfe) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe); checkForErrorInDispositionReport(report, null, null); } catch (UndeclaredThrowableException ute) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute); checkForErrorInDispositionReport(report, null, null); }catch (Throwable t){
public static DispositionReportFaultMessage MapException(DispositionReport ex) { org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport(); r.setTruncated(ex.getFaultInfo().getTruncated() == Truncated.TRUE); r.getResult().addAll(MapResult(ex.getFaultInfo().getResult())); DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r); return x; }