1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.soap.addressing.version;
18
19 import java.net.URI;
20 import javax.xml.namespace.QName;
21
22 import org.springframework.util.Assert;
23 import org.springframework.ws.soap.SoapMessage;
24 import org.springframework.ws.soap.addressing.core.EndpointReference;
25 import org.springframework.ws.soap.addressing.core.MessageAddressingProperties;
26 import org.springframework.xml.namespace.QNameUtils;
27
28
29
30
31
32
33
34
35
36 public class Addressing200408 extends AbstractAddressingVersion {
37
38 private static final String NAMESPACE_URI = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
39
40 public void addAddressingHeaders(SoapMessage message, MessageAddressingProperties map) {
41 Assert.notNull(map.getAction(), "'Action' must not be null");
42 Assert.notNull(map.getTo(), "'Action' must not be null");
43 super.addAddressingHeaders(message, map);
44 }
45
46 protected final URI getAnonymous() {
47 return URI.create(NAMESPACE_URI + "/role/anonymous");
48 }
49
50 protected final String getInvalidAddressingHeaderFaultReason() {
51 return "A message information header is not valid and the message cannot be processed.";
52 }
53
54 protected final QName getInvalidAddressingHeaderFaultSubcode() {
55 return QNameUtils.createQName(NAMESPACE_URI, "InvalidMessageInformationHeader", getNamespacePrefix());
56 }
57
58 protected final String getMessageAddressingHeaderRequiredFaultReason() {
59 return "A required message information header, To, MessageID, or Action, is not present.";
60 }
61
62 protected final QName getMessageAddressingHeaderRequiredFaultSubcode() {
63 return QNameUtils.createQName(NAMESPACE_URI, "MessageInformationHeaderRequired", getNamespacePrefix());
64 }
65
66 protected final String getNamespaceUri() {
67 return NAMESPACE_URI;
68 }
69
70 protected final EndpointReference getDefaultReplyTo(EndpointReference from) {
71 return from;
72 }
73
74 protected final URI getNone() {
75 return null;
76 }
77
78 public String toString() {
79 return "Ws-Addressing August 2004";
80 }
81 }