Преглед на файлове

Moved web service API generated classes into bookingtracking presentation layer

peter_backlund преди 17 години
родител
ревизия
2e41814092
променени са 14 файла, в които са добавени 665 реда и са изтрити 2 реда
  1. 1
    1
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/HandlingReportParser.java
  2. 79
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/HandlingReportWebService.java
  3. 160
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReport.java
  4. 29
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportErrors.java
  5. 46
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportErrors_Exception.java
  6. 36
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportService.java
  7. 58
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportServiceService.java
  8. 87
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/ObjectFactory.java
  9. 53
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/SubmitReport.java
  10. 29
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/SubmitReportResponse.java
  11. 1
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/package-info.java
  12. 7
    0
      dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/package.html
  13. 78
    0
      dddsample/tracking/core/src/main/resources/HandlingReportService.wsdl
  14. 1
    1
      dddsample/tracking/core/src/main/resources/contexts/context-interfaces-webservice.xml

+ 1
- 1
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/HandlingReportParser.java Целия файл

@@ -1,11 +1,11 @@
1 1
 package se.citerus.dddsample.tracking.core.interfaces.handling;
2 2
 
3
-import com.aggregator.HandlingReport;
4 3
 import org.apache.commons.lang.StringUtils;
5 4
 import se.citerus.dddsample.tracking.core.domain.model.cargo.TrackingId;
6 5
 import se.citerus.dddsample.tracking.core.domain.model.handling.HandlingEvent;
7 6
 import se.citerus.dddsample.tracking.core.domain.model.location.UnLocode;
8 7
 import se.citerus.dddsample.tracking.core.domain.model.voyage.VoyageNumber;
8
+import se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator.HandlingReport;
9 9
 
10 10
 import javax.xml.datatype.XMLGregorianCalendar;
11 11
 import java.text.ParseException;

+ 79
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/HandlingReportWebService.java Целия файл

@@ -0,0 +1,79 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws;
2
+
3
+import org.apache.commons.logging.Log;
4
+import org.apache.commons.logging.LogFactory;
5
+import org.springframework.stereotype.Service;
6
+import se.citerus.dddsample.tracking.core.application.handling.HandlingEventService;
7
+import se.citerus.dddsample.tracking.core.domain.model.cargo.TrackingId;
8
+import se.citerus.dddsample.tracking.core.domain.model.handling.CannotCreateHandlingEventException;
9
+import se.citerus.dddsample.tracking.core.domain.model.handling.HandlingEvent;
10
+import se.citerus.dddsample.tracking.core.domain.model.location.UnLocode;
11
+import se.citerus.dddsample.tracking.core.domain.model.voyage.VoyageNumber;
12
+import static se.citerus.dddsample.tracking.core.interfaces.handling.HandlingReportParser.*;
13
+import se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator.HandlingReportService;
14
+import se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator.HandlingReport;
15
+import se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator.HandlingReportErrors_Exception;
16
+import se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator.HandlingReportErrors;
17
+
18
+import javax.jws.WebParam;
19
+import javax.jws.WebService;
20
+import java.util.*;
21
+
22
+/**
23
+ * This web service endpoint implementation performs basic validation and parsing
24
+ * of an incoming handling report, and attempts to register proper handling events
25
+ * by calling the application layer.
26
+ */
27
+@WebService(endpointInterface = "com.aggregator.HandlingReportService")
28
+@Service
29
+public class HandlingReportWebService implements HandlingReportService {
30
+
31
+  private HandlingEventService handlingEventService;
32
+  private final static Log logger = LogFactory.getLog(HandlingReportWebService.class);
33
+
34
+  @Override
35
+  public void submitReport(@WebParam(name = "arg0", targetNamespace = "") HandlingReport handlingReport) throws HandlingReportErrors_Exception {
36
+    final List<String> validationErrors = new ArrayList<String>();
37
+
38
+    final Date completionTime = parseCompletionTime(handlingReport, validationErrors);
39
+    final VoyageNumber voyageNumber = parseVoyageNumber(handlingReport.getVoyageNumber(), validationErrors);
40
+    final HandlingEvent.Type type = parseEventType(handlingReport.getType(), validationErrors);
41
+    final UnLocode unLocode = parseUnLocode(handlingReport.getUnLocode(), validationErrors);
42
+
43
+    final Map<String, String> allErrors = new HashMap<String, String>();
44
+    for (String trackingIdStr : handlingReport.getTrackingIds()) {
45
+      final TrackingId trackingId = parseTrackingId(trackingIdStr, validationErrors);
46
+
47
+      if (validationErrors.isEmpty()) {
48
+        try {
49
+          handlingEventService.registerHandlingEvent(completionTime, trackingId, voyageNumber, unLocode, type);
50
+        } catch (CannotCreateHandlingEventException e) {
51
+          logger.error(e, e);
52
+          allErrors.put(trackingIdStr, e.getMessage());
53
+        }
54
+      } else {
55
+        logger.error("Parse error in handling report: " + validationErrors);
56
+        allErrors.put(trackingIdStr, validationErrors.toString());
57
+      }
58
+    }
59
+
60
+    if (!allErrors.isEmpty()) {
61
+      final HandlingReportErrors faultInfo = new HandlingReportErrors();
62
+      throw new HandlingReportErrors_Exception(createErrorMessage(allErrors), faultInfo);
63
+    }
64
+  }
65
+
66
+  private String createErrorMessage(final Map<String, String> allErrors) {
67
+    final StringBuilder sb = new StringBuilder("--- BEGIN HANDLING REPORT ERRORS ---\n");
68
+    for (Map.Entry<String, String> e : allErrors.entrySet()) {
69
+      sb.append(e.getKey()).append(" : ").append(e.getValue()).append("\n");
70
+    }
71
+    sb.append("--- END HANDLING REPORT ERRORS ---");
72
+    return sb.toString();
73
+  }
74
+
75
+  public void setHandlingEventService(final HandlingEventService handlingEventService) {
76
+    this.handlingEventService = handlingEventService;
77
+  }
78
+
79
+}

+ 160
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReport.java Целия файл

@@ -0,0 +1,160 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.bind.annotation.XmlAccessType;
4
+import javax.xml.bind.annotation.XmlAccessorType;
5
+import javax.xml.bind.annotation.XmlElement;
6
+import javax.xml.bind.annotation.XmlType;
7
+import javax.xml.datatype.XMLGregorianCalendar;
8
+import java.util.ArrayList;
9
+import java.util.List;
10
+
11
+
12
+/**
13
+ * <p>Java class for handlingReport complex type.
14
+ * <p/>
15
+ * <p>The following schema fragment specifies the expected content contained within this class.
16
+ * <p/>
17
+ * <pre>
18
+ * &lt;complexType name="handlingReport">
19
+ *   &lt;complexContent>
20
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21
+ *       &lt;sequence>
22
+ *         &lt;element name="completionTime" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
23
+ *         &lt;element name="trackingIds" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
24
+ *         &lt;element name="type" type="{http://www.w3.org/2001/XMLSchema}string"/>
25
+ *         &lt;element name="unLocode" type="{http://www.w3.org/2001/XMLSchema}string"/>
26
+ *         &lt;element name="voyageNumber" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
27
+ *       &lt;/sequence>
28
+ *     &lt;/restriction>
29
+ *   &lt;/complexContent>
30
+ * &lt;/complexType>
31
+ * </pre>
32
+ */
33
+@XmlAccessorType(XmlAccessType.FIELD)
34
+@XmlType(name = "handlingReport", propOrder = {
35
+  "completionTime",
36
+  "trackingIds",
37
+  "type",
38
+  "unLocode",
39
+  "voyageNumber"
40
+})
41
+public class HandlingReport {
42
+
43
+  @XmlElement(required = true)
44
+  protected XMLGregorianCalendar completionTime;
45
+  @XmlElement(required = true)
46
+  protected List<String> trackingIds;
47
+  @XmlElement(required = true)
48
+  protected String type;
49
+  @XmlElement(required = true)
50
+  protected String unLocode;
51
+  protected String voyageNumber;
52
+
53
+  /**
54
+   * Gets the value of the completionTime property.
55
+   *
56
+   * @return possible object is
57
+   *         {@link XMLGregorianCalendar }
58
+   */
59
+  public XMLGregorianCalendar getCompletionTime() {
60
+    return completionTime;
61
+  }
62
+
63
+  /**
64
+   * Sets the value of the completionTime property.
65
+   *
66
+   * @param value allowed object is
67
+   *              {@link XMLGregorianCalendar }
68
+   */
69
+  public void setCompletionTime(XMLGregorianCalendar value) {
70
+    this.completionTime = value;
71
+  }
72
+
73
+  /**
74
+   * Gets the value of the trackingIds property.
75
+   * <p/>
76
+   * <p/>
77
+   * This accessor method returns a reference to the live list,
78
+   * not a snapshot. Therefore any modification you make to the
79
+   * returned list will be present inside the JAXB object.
80
+   * This is why there is not a <CODE>set</CODE> method for the trackingIds property.
81
+   * <p/>
82
+   * <p/>
83
+   * For example, to add a new item, do as follows:
84
+   * <pre>
85
+   *    getTrackingIds().add(newItem);
86
+   * </pre>
87
+   * <p/>
88
+   * <p/>
89
+   * <p/>
90
+   * Objects of the following type(s) are allowed in the list
91
+   * {@link String }
92
+   */
93
+  public List<String> getTrackingIds() {
94
+    if (trackingIds == null) {
95
+      trackingIds = new ArrayList<String>();
96
+    }
97
+    return this.trackingIds;
98
+  }
99
+
100
+  /**
101
+   * Gets the value of the type property.
102
+   *
103
+   * @return possible object is
104
+   *         {@link String }
105
+   */
106
+  public String getType() {
107
+    return type;
108
+  }
109
+
110
+  /**
111
+   * Sets the value of the type property.
112
+   *
113
+   * @param value allowed object is
114
+   *              {@link String }
115
+   */
116
+  public void setType(String value) {
117
+    this.type = value;
118
+  }
119
+
120
+  /**
121
+   * Gets the value of the unLocode property.
122
+   *
123
+   * @return possible object is
124
+   *         {@link String }
125
+   */
126
+  public String getUnLocode() {
127
+    return unLocode;
128
+  }
129
+
130
+  /**
131
+   * Sets the value of the unLocode property.
132
+   *
133
+   * @param value allowed object is
134
+   *              {@link String }
135
+   */
136
+  public void setUnLocode(String value) {
137
+    this.unLocode = value;
138
+  }
139
+
140
+  /**
141
+   * Gets the value of the voyageNumber property.
142
+   *
143
+   * @return possible object is
144
+   *         {@link String }
145
+   */
146
+  public String getVoyageNumber() {
147
+    return voyageNumber;
148
+  }
149
+
150
+  /**
151
+   * Sets the value of the voyageNumber property.
152
+   *
153
+   * @param value allowed object is
154
+   *              {@link String }
155
+   */
156
+  public void setVoyageNumber(String value) {
157
+    this.voyageNumber = value;
158
+  }
159
+
160
+}

+ 29
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportErrors.java Целия файл

@@ -0,0 +1,29 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.bind.annotation.XmlAccessType;
4
+import javax.xml.bind.annotation.XmlAccessorType;
5
+import javax.xml.bind.annotation.XmlType;
6
+
7
+
8
+/**
9
+ * <p>Java class for HandlingReportErrors complex type.
10
+ * <p/>
11
+ * <p>The following schema fragment specifies the expected content contained within this class.
12
+ * <p/>
13
+ * <pre>
14
+ * &lt;complexType name="HandlingReportErrors">
15
+ *   &lt;complexContent>
16
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
17
+ *       &lt;sequence>
18
+ *       &lt;/sequence>
19
+ *     &lt;/restriction>
20
+ *   &lt;/complexContent>
21
+ * &lt;/complexType>
22
+ * </pre>
23
+ */
24
+@XmlAccessorType(XmlAccessType.FIELD)
25
+@XmlType(name = "HandlingReportErrors")
26
+public class HandlingReportErrors {
27
+
28
+
29
+}

+ 46
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportErrors_Exception.java Целия файл

@@ -0,0 +1,46 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.ws.WebFault;
4
+
5
+
6
+/**
7
+ * This class was generated by the JAX-WS RI.
8
+ * JAX-WS RI 2.1.1 in JDK 6
9
+ * Generated source version: 2.1
10
+ */
11
+@WebFault(name = "HandlingReportErrors", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/")
12
+public class HandlingReportErrors_Exception
13
+  extends Exception {
14
+
15
+  /**
16
+   * Java type that goes as soapenv:Fault detail element.
17
+   */
18
+  private HandlingReportErrors faultInfo;
19
+
20
+  /**
21
+   * @param message
22
+   * @param faultInfo
23
+   */
24
+  public HandlingReportErrors_Exception(String message, HandlingReportErrors faultInfo) {
25
+    super(message);
26
+    this.faultInfo = faultInfo;
27
+  }
28
+
29
+  /**
30
+   * @param message
31
+   * @param faultInfo
32
+   * @param cause
33
+   */
34
+  public HandlingReportErrors_Exception(String message, HandlingReportErrors faultInfo, Throwable cause) {
35
+    super(message, cause);
36
+    this.faultInfo = faultInfo;
37
+  }
38
+
39
+  /**
40
+   * @return returns fault bean: com.aggregator.HandlingReportErrors
41
+   */
42
+  public HandlingReportErrors getFaultInfo() {
43
+    return faultInfo;
44
+  }
45
+
46
+}

+ 36
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportService.java Целия файл

@@ -0,0 +1,36 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.jws.WebMethod;
4
+import javax.jws.WebParam;
5
+import javax.jws.WebService;
6
+import javax.xml.bind.annotation.XmlSeeAlso;
7
+import javax.xml.ws.RequestWrapper;
8
+import javax.xml.ws.ResponseWrapper;
9
+
10
+
11
+/**
12
+ * This class was generated by the JAX-WS RI.
13
+ * JAX-WS RI 2.1.1 in JDK 6
14
+ * Generated source version: 2.1
15
+ */
16
+@WebService(name = "HandlingReportService", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/")
17
+@XmlSeeAlso({
18
+  ObjectFactory.class
19
+})
20
+public interface HandlingReportService {
21
+
22
+
23
+  /**
24
+   * @param arg0
25
+   * @throws HandlingReportErrors_Exception
26
+   */
27
+  @WebMethod
28
+  @RequestWrapper(localName = "submitReport", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReport")
29
+  @ResponseWrapper(localName = "submitReportResponse", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReportResponse")
30
+  public void submitReport(
31
+    @WebParam(name = "arg0", targetNamespace = "")
32
+    HandlingReport arg0)
33
+    throws HandlingReportErrors_Exception
34
+    ;
35
+
36
+}

+ 58
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/HandlingReportServiceService.java Целия файл

@@ -0,0 +1,58 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.namespace.QName;
4
+import javax.xml.ws.Service;
5
+import javax.xml.ws.WebEndpoint;
6
+import javax.xml.ws.WebServiceClient;
7
+import javax.xml.ws.WebServiceFeature;
8
+import java.net.MalformedURLException;
9
+import java.net.URL;
10
+
11
+
12
+/**
13
+ * This class was generated by the JAX-WS RI.
14
+ * JAX-WS RI 2.1.1 in JDK 6
15
+ * Generated source version: 2.1
16
+ */
17
+@WebServiceClient(name = "HandlingReportServiceService", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", wsdlLocation = "file:///Users/peter/src/dddsample/src/main/resources/HandlingReportService.wsdl")
18
+public class HandlingReportServiceService
19
+  extends Service {
20
+
21
+  private final static URL HANDLINGREPORTSERVICESERVICE_WSDL_LOCATION;
22
+
23
+  static {
24
+    URL url = null;
25
+    try {
26
+      url = new URL("file:/Users/peter/src/dddsample/src/main/resources/HandlingReportService.wsdl");
27
+    } catch (MalformedURLException e) {
28
+      e.printStackTrace();
29
+    }
30
+    HANDLINGREPORTSERVICESERVICE_WSDL_LOCATION = url;
31
+  }
32
+
33
+  public HandlingReportServiceService(URL wsdlLocation, QName serviceName) {
34
+    super(wsdlLocation, serviceName);
35
+  }
36
+
37
+  public HandlingReportServiceService() {
38
+    super(HANDLINGREPORTSERVICESERVICE_WSDL_LOCATION, new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "HandlingReportServiceService"));
39
+  }
40
+
41
+  /**
42
+   * @return returns HandlingReportService
43
+   */
44
+  @WebEndpoint(name = "HandlingReportServicePort")
45
+  public HandlingReportService getHandlingReportServicePort() {
46
+    return (HandlingReportService) super.getPort(new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "HandlingReportServicePort"), HandlingReportService.class);
47
+  }
48
+
49
+  /**
50
+   * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
51
+   * @return returns HandlingReportService
52
+   */
53
+  @WebEndpoint(name = "HandlingReportServicePort")
54
+  public HandlingReportService getHandlingReportServicePort(WebServiceFeature... features) {
55
+    return (HandlingReportService) super.getPort(new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "HandlingReportServicePort"), HandlingReportService.class, features);
56
+  }
57
+
58
+}

+ 87
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/ObjectFactory.java Целия файл

@@ -0,0 +1,87 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.bind.JAXBElement;
4
+import javax.xml.bind.annotation.XmlElementDecl;
5
+import javax.xml.bind.annotation.XmlRegistry;
6
+import javax.xml.namespace.QName;
7
+
8
+
9
+/**
10
+ * This object contains factory methods for each
11
+ * Java content interface and Java element interface
12
+ * generated in the com.aggregator package.
13
+ * <p>An ObjectFactory allows you to programatically
14
+ * construct new instances of the Java representation
15
+ * for XML content. The Java representation of XML
16
+ * content can consist of schema derived interfaces
17
+ * and classes representing the binding of schema
18
+ * type definitions, element declarations and model
19
+ * groups.  Factory methods for each of these are
20
+ * provided in this class.
21
+ */
22
+@XmlRegistry
23
+public class ObjectFactory {
24
+
25
+  private final static QName _SubmitReport_QNAME = new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "submitReport");
26
+  private final static QName _HandlingReportErrors_QNAME = new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "HandlingReportErrors");
27
+  private final static QName _SubmitReportResponse_QNAME = new QName("http://ws.handling.interfaces.dddsample.citerus.se/", "submitReportResponse");
28
+
29
+  /**
30
+   * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.aggregator
31
+   */
32
+  public ObjectFactory() {
33
+  }
34
+
35
+  /**
36
+   * Create an instance of {@link HandlingReportErrors }
37
+   */
38
+  public HandlingReportErrors createHandlingReportErrors() {
39
+    return new HandlingReportErrors();
40
+  }
41
+
42
+  /**
43
+   * Create an instance of {@link SubmitReportResponse }
44
+   */
45
+  public SubmitReportResponse createSubmitReportResponse() {
46
+    return new SubmitReportResponse();
47
+  }
48
+
49
+  /**
50
+   * Create an instance of {@link HandlingReport }
51
+   */
52
+  public HandlingReport createHandlingReport() {
53
+    return new HandlingReport();
54
+  }
55
+
56
+  /**
57
+   * Create an instance of {@link SubmitReport }
58
+   */
59
+  public SubmitReport createSubmitReport() {
60
+    return new SubmitReport();
61
+  }
62
+
63
+  /**
64
+   * Create an instance of {@link JAXBElement }{@code <}{@link SubmitReport }{@code >}}
65
+   */
66
+  @XmlElementDecl(namespace = "http://ws.handling.interfaces.dddsample.citerus.se/", name = "submitReport")
67
+  public JAXBElement<SubmitReport> createSubmitReport(SubmitReport value) {
68
+    return new JAXBElement<SubmitReport>(_SubmitReport_QNAME, SubmitReport.class, null, value);
69
+  }
70
+
71
+  /**
72
+   * Create an instance of {@link JAXBElement }{@code <}{@link HandlingReportErrors }{@code >}}
73
+   */
74
+  @XmlElementDecl(namespace = "http://ws.handling.interfaces.dddsample.citerus.se/", name = "HandlingReportErrors")
75
+  public JAXBElement<HandlingReportErrors> createHandlingReportErrors(HandlingReportErrors value) {
76
+    return new JAXBElement<HandlingReportErrors>(_HandlingReportErrors_QNAME, HandlingReportErrors.class, null, value);
77
+  }
78
+
79
+  /**
80
+   * Create an instance of {@link JAXBElement }{@code <}{@link SubmitReportResponse }{@code >}}
81
+   */
82
+  @XmlElementDecl(namespace = "http://ws.handling.interfaces.dddsample.citerus.se/", name = "submitReportResponse")
83
+  public JAXBElement<SubmitReportResponse> createSubmitReportResponse(SubmitReportResponse value) {
84
+    return new JAXBElement<SubmitReportResponse>(_SubmitReportResponse_QNAME, SubmitReportResponse.class, null, value);
85
+  }
86
+
87
+}

+ 53
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/SubmitReport.java Целия файл

@@ -0,0 +1,53 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.bind.annotation.XmlAccessType;
4
+import javax.xml.bind.annotation.XmlAccessorType;
5
+import javax.xml.bind.annotation.XmlType;
6
+
7
+
8
+/**
9
+ * <p>Java class for submitReport complex type.
10
+ * <p/>
11
+ * <p>The following schema fragment specifies the expected content contained within this class.
12
+ * <p/>
13
+ * <pre>
14
+ * &lt;complexType name="submitReport">
15
+ *   &lt;complexContent>
16
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
17
+ *       &lt;sequence>
18
+ *         &lt;element name="arg0" type="{http://ws.handling.interfaces.dddsample.citerus.se/}handlingReport" minOccurs="0"/>
19
+ *       &lt;/sequence>
20
+ *     &lt;/restriction>
21
+ *   &lt;/complexContent>
22
+ * &lt;/complexType>
23
+ * </pre>
24
+ */
25
+@XmlAccessorType(XmlAccessType.FIELD)
26
+@XmlType(name = "submitReport", propOrder = {
27
+  "arg0"
28
+})
29
+public class SubmitReport {
30
+
31
+  protected HandlingReport arg0;
32
+
33
+  /**
34
+   * Gets the value of the arg0 property.
35
+   *
36
+   * @return possible object is
37
+   *         {@link HandlingReport }
38
+   */
39
+  public HandlingReport getArg0() {
40
+    return arg0;
41
+  }
42
+
43
+  /**
44
+   * Sets the value of the arg0 property.
45
+   *
46
+   * @param value allowed object is
47
+   *              {@link HandlingReport }
48
+   */
49
+  public void setArg0(HandlingReport value) {
50
+    this.arg0 = value;
51
+  }
52
+
53
+}

+ 29
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/SubmitReportResponse.java Целия файл

@@ -0,0 +1,29 @@
1
+package se.citerus.dddsample.tracking.core.interfaces.handling.ws.aggregator;
2
+
3
+import javax.xml.bind.annotation.XmlAccessType;
4
+import javax.xml.bind.annotation.XmlAccessorType;
5
+import javax.xml.bind.annotation.XmlType;
6
+
7
+
8
+/**
9
+ * <p>Java class for submitReportResponse complex type.
10
+ * <p/>
11
+ * <p>The following schema fragment specifies the expected content contained within this class.
12
+ * <p/>
13
+ * <pre>
14
+ * &lt;complexType name="submitReportResponse">
15
+ *   &lt;complexContent>
16
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
17
+ *       &lt;sequence>
18
+ *       &lt;/sequence>
19
+ *     &lt;/restriction>
20
+ *   &lt;/complexContent>
21
+ * &lt;/complexType>
22
+ * </pre>
23
+ */
24
+@XmlAccessorType(XmlAccessType.FIELD)
25
+@XmlType(name = "submitReportResponse")
26
+public class SubmitReportResponse {
27
+
28
+
29
+}

+ 1
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/package-info.java Целия файл

@@ -0,0 +1 @@
1
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.handling.interfaces.dddsample.citerus.se/") package com.aggregator;

+ 7
- 0
dddsample/tracking/core/src/main/java/se/citerus/dddsample/tracking/core/interfaces/handling/ws/aggregator/package.html Целия файл

@@ -0,0 +1,7 @@
1
+<html>
2
+<body>
3
+<p>
4
+	Generated from the upstream Aggregation Service WSDL
5
+</p>
6
+</body>
7
+</html>

+ 78
- 0
dddsample/tracking/core/src/main/resources/HandlingReportService.wsdl Целия файл

@@ -0,0 +1,78 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<wsdl:definitions name="HandlingReportServiceService"
3
+                  targetNamespace="http://ws.handling.interfaces.dddsample.citerus.se/"
4
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
5
+                  xmlns:tns="http://ws.handling.interfaces.dddsample.citerus.se/"
6
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
7
+  <wsdl:types>
8
+    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
9
+               xmlns:tns="http://ws.handling.interfaces.dddsample.citerus.se/" attributeFormDefault="unqualified"
10
+               elementFormDefault="unqualified" targetNamespace="http://ws.handling.interfaces.dddsample.citerus.se/">
11
+      <xs:element name="submitReport" type="tns:submitReport"/>
12
+      <xs:element name="submitReportResponse" type="tns:submitReportResponse"/>
13
+      <xs:complexType name="submitReport">
14
+        <xs:sequence>
15
+          <xs:element minOccurs="0" name="arg0" type="tns:handlingReport"/>
16
+        </xs:sequence>
17
+      </xs:complexType>
18
+      <xs:complexType name="handlingReport">
19
+        <xs:sequence>
20
+          <xs:element name="completionTime" type="xs:dateTime"/>
21
+          <xs:element maxOccurs="unbounded" name="trackingIds" type="xs:string"/>
22
+          <xs:element name="type" type="xs:string"/>
23
+          <xs:element name="unLocode" type="xs:string"/>
24
+          <xs:element minOccurs="0" name="voyageNumber" type="xs:string"/>
25
+        </xs:sequence>
26
+      </xs:complexType>
27
+      <xs:complexType name="submitReportResponse">
28
+        <xs:sequence/>
29
+      </xs:complexType>
30
+      <xs:element name="HandlingReportErrors" type="tns:HandlingReportErrors"/>
31
+      <xs:complexType name="HandlingReportErrors">
32
+        <xs:sequence/>
33
+      </xs:complexType>
34
+    </xs:schema>
35
+  </wsdl:types>
36
+  <wsdl:message name="HandlingReportErrors">
37
+    <wsdl:part name="HandlingReportErrors" element="tns:HandlingReportErrors">
38
+    </wsdl:part>
39
+  </wsdl:message>
40
+  <wsdl:message name="submitReport">
41
+    <wsdl:part name="parameters" element="tns:submitReport">
42
+    </wsdl:part>
43
+  </wsdl:message>
44
+  <wsdl:message name="submitReportResponse">
45
+    <wsdl:part name="parameters" element="tns:submitReportResponse">
46
+    </wsdl:part>
47
+  </wsdl:message>
48
+  <wsdl:portType name="HandlingReportService">
49
+    <wsdl:operation name="submitReport">
50
+      <wsdl:input name="submitReport" message="tns:submitReport">
51
+      </wsdl:input>
52
+      <wsdl:output name="submitReportResponse" message="tns:submitReportResponse">
53
+      </wsdl:output>
54
+      <wsdl:fault name="HandlingReportErrors" message="tns:HandlingReportErrors">
55
+      </wsdl:fault>
56
+    </wsdl:operation>
57
+  </wsdl:portType>
58
+  <wsdl:binding name="HandlingReportServiceServiceSoapBinding" type="tns:HandlingReportService">
59
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
60
+    <wsdl:operation name="submitReport">
61
+      <soap:operation soapAction="" style="document"/>
62
+      <wsdl:input name="submitReport">
63
+        <soap:body use="literal"/>
64
+      </wsdl:input>
65
+      <wsdl:output name="submitReportResponse">
66
+        <soap:body use="literal"/>
67
+      </wsdl:output>
68
+      <wsdl:fault name="HandlingReportErrors">
69
+        <soap:fault name="HandlingReportErrors" use="literal"/>
70
+      </wsdl:fault>
71
+    </wsdl:operation>
72
+  </wsdl:binding>
73
+  <wsdl:service name="HandlingReportServiceService">
74
+    <wsdl:port name="HandlingReportServicePort" binding="tns:HandlingReportServiceServiceSoapBinding">
75
+      <soap:address location="http://localhost:9090/HandlingReportServicePort"/>
76
+    </wsdl:port>
77
+  </wsdl:service>
78
+</wsdl:definitions>

+ 1
- 1
dddsample/tracking/core/src/main/resources/contexts/context-interfaces-webservice.xml Целия файл

@@ -13,7 +13,7 @@
13 13
 
14 14
   <jaxws:endpoint id="jax-ws.http" implementor="#handlingReportService" address="/RegisterEvent"/>
15 15
 
16
-  <bean id="handlingReportService" class="se.citerus.dddsample.tracking.core.interfaces.handling.ws.HandlingReportServiceImpl">
16
+  <bean id="handlingReportService" class="se.citerus.dddsample.tracking.core.interfaces.handling.ws.HandlingReportWebService">
17 17
     <property name="handlingEventService" ref="handlingEventServiceImpl"/>
18 18
   </bean>
19 19