private DispositionReport getSuccessMessage() { DispositionReport r = new DispositionReport(); r.setGeneric("2.0"); r.setTruncated(Truncated.FALSE); Result x = new Result(); r.setOperator(getNodeID()); r.getResult().add(x); return r; }
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; }
public DispositionReport(Node firstChild) throws JAXBException{ super(); JAXBContextUtil.getContext(this.getClass().getPackage().getName()); Unmarshaller u = JAXBContextUtil.getContext( this.getClass().getPackage().getName()).createUnmarshaller(); JAXBElement<DispositionReport> element = u.unmarshal(firstChild, DispositionReport.class); this.result = element.getValue().getResult(); this.truncated = element.getValue().truncated; }
/** * Create an instance of {@link DispositionReport } * */ public DispositionReport createDispositionReport() { return new DispositionReport(); }
public void getNonExitingBusiness() { String nonExistingKey = "nonexistingKey"; try { GetBusinessDetail body = new GetBusinessDetail(); body.setGeneric("2.0"); 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 = org.uddi.v2_service.DispositionReport.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); } } }
/** * Determines if one of the Results in the this DispositionReport has a Error Code * that matches the errCodeKey passed in. The errCodeKey should be one * of the * * @param errCodeKey * @return true if the errCodeKey matches with a code in the Results. */ public boolean countainsErrorCode(final String errCodeKey) { boolean isKeyMatch = false; for (Result result : getResult()) { String errCode = result.getErrInfo().getErrCode(); if (errCodeKey.equals(errCode)) { isKeyMatch = true; break; } } return isKeyMatch; }
if (detail != null && detail.getFirstChild()!=null) { try { report = new org.uddi.api_v2.DispositionReport(detail.getFirstChild()); } catch (JAXBException je) { log.error("Could not unmarshall detail to a DispositionReport");
private static org.uddi.api_v2.DispositionReport MapDispositionReport(org.uddi.api_v3.DispositionReport faultInfo, String operator) { if (faultInfo == null) { return null; } org.uddi.api_v2.DispositionReport r = new org.uddi.api_v2.DispositionReport(); r.setGeneric(VERSION); r.setOperator(operator); r.setTruncated(Truncated.FALSE); r.getResult().addAll(MapResults(faultInfo.getResult())); return r; }
private static List<Result> MapFault(SOAPFault result) { List<Result> r = new ArrayList<Result>(); if (result == null) { return r; } if (result.getDetail() != null) { while (result.getDetail().getDetailEntries().hasNext()) { Object next = result.getDetail().getDetailEntries().next(); if (next instanceof DispositionReport) { DispositionReport z = (DispositionReport) next; r.addAll(MapResult(z.getFaultInfo().getResult())); } logger.warn("unable to parse fault detail, type:" + next.getClass().getCanonicalName() + " " + next.toString()); } } return r; } private static Log logger = LogFactory.getLog(MapUDDIv2Tov3.class);
private DispositionReport getSuccessMessage() { DispositionReport r = new DispositionReport(); r.setGeneric("2.0"); r.setTruncated(Truncated.FALSE); Result x = new Result(); r.setOperator(getNodeID()); r.getResult().add(x); return r; }