This project has retired. For details please refer to its
Attic page.
DispositionReport xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.uddi.v2_service;
18
19 import java.lang.reflect.UndeclaredThrowableException;
20 import javax.xml.bind.JAXBException;
21 import javax.xml.soap.Detail;
22 import javax.xml.ws.WebFault;
23 import javax.xml.ws.soap.SOAPFaultException;
24 import org.apache.commons.logging.Log;
25 import org.apache.commons.logging.LogFactory;
26
27
28
29
30
31
32
33
34
35 @WebFault(name = "dispositionReport", targetNamespace = "urn:uddi-org:api_v2")
36 public class DispositionReport
37 extends Exception
38 {
39
40
41
42
43
44 private org.uddi.api_v2.DispositionReport faultInfo;
45 private static transient Log log = LogFactory.getLog(DispositionReport.class);
46
47
48
49
50
51
52 public DispositionReport(String message, org.uddi.api_v2.DispositionReport faultInfo) {
53 super(message);
54 this.faultInfo = faultInfo;
55 }
56
57
58
59
60
61
62
63 public DispositionReport(String message, org.uddi.api_v2.DispositionReport faultInfo, Throwable cause) {
64 super(message, cause);
65 this.faultInfo = faultInfo;
66 }
67
68
69
70
71
72
73 public org.uddi.api_v2.DispositionReport getFaultInfo() {
74 return faultInfo;
75 }
76
77
78
79
80
81
82
83
84
85
86 public static org.uddi.api_v2.DispositionReport getDispositionReport(Exception e) {
87 org.uddi.api_v2.DispositionReport report = null;
88 if (e instanceof DispositionReport) {
89 DispositionReport faultMsg = (DispositionReport) e;
90 report = faultMsg.faultInfo;
91 } else if (e instanceof SOAPFaultException) {
92 SOAPFaultException soapFault = (SOAPFaultException) e;
93 Detail detail = soapFault.getFault().getDetail();
94 if (detail != null && detail.getFirstChild()!=null) {
95 try {
96 report = new org.uddi.api_v2.DispositionReport(detail.getFirstChild());
97 } catch (JAXBException je) {
98 log.error("Could not unmarshall detail to a DispositionReport");
99 }
100 }
101 } else if (e instanceof UndeclaredThrowableException) {
102 UndeclaredThrowableException ute =(UndeclaredThrowableException) e;
103 if (ute.getUndeclaredThrowable()!=null && ute.getUndeclaredThrowable().getCause()!=null
104 && ute.getUndeclaredThrowable().getCause().getCause() instanceof DispositionReport) {
105 DispositionReport faultMsg = (DispositionReport) ute.getUndeclaredThrowable().getCause().getCause();
106 report = faultMsg.getFaultInfo();
107 }
108 } else {
109 log.error("Unsupported Exception: " + e.getClass());
110 }
111 return report;
112 }
113 }