You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/03/15 23:42:07 UTC
svn commit: r518795 - in /webservices/axis2/trunk/java/modules:
addressing/src/org/apache/axis2/addressing/
addressing/src/org/apache/axis2/addressing/i18n/
kernel/src/org/apache/axis2/addressing/
Author: pradine
Date: Thu Mar 15 15:42:07 2007
New Revision: 518795
URL: http://svn.apache.org/viewvc?view=rev&rev=518795
Log:
Add support for the ws-addressing spec defined fault, DestinationUnreachable.
Modified:
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/resource.properties
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java?view=diff&rev=518795&r1=518794&r2=518795
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java Thu Mar 15 15:42:07 2007
@@ -109,6 +109,12 @@
} else {
result = AddressingMessages.getMessage("addressingHeaderRequired");
}
+ }else if(AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE.equals(faultCodeLocalName)){
+ if(faultDetail!=null){
+ result = AddressingMessages.getMessage("specificDestinationUnreachable", faultDetail);
+ }else{
+ result = AddressingMessages.getMessage("destinationUnreachable");
+ }
} else if (AddressingConstants.FAULT_ACTION_NOT_SUPPORTED.equals(faultCodeLocalName)) {
if (faultDetail != null) {
result = AddressingMessages.getMessage("specificActionNotRecognised", faultDetail);
@@ -274,6 +280,27 @@
}
}
+ // wsa:DestinationUnreachable [Reason] the string: "No route can be determined to reach [destination]"
+ public static void triggerDestinationUnreachableFault(MessageContext messageContext, String address) throws AxisFault {
+ if(log.isDebugEnabled()){
+ log.debug("triggerDestinationUnreachableFault: messageContext: "+messageContext+
+ " address: "+address);
+ }
+ String namespace =
+ (String) messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+ if (Submission.WSA_NAMESPACE.equals(namespace)){
+ triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_IRI, address,
+ AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE, null,
+ AddressingMessages.getMessage(
+ "spec.submission.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON"));
+ }else{
+ triggerAddressingFault(messageContext, Final.FAULT_HEADER_PROB_IRI, null,
+ AddressingConstants.FAULT_ADDRESSING_DESTINATION_UNREACHABLE, null,
+ AddressingMessages.getMessage(
+ "spec.final.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON"));
+ }
+ }
+
// wsa:ActionNotSupported [Reason] the string: "The [action] cannot be processed at the receiver"
public static void triggerActionNotSupportedFault(MessageContext messageContext,
String problemAction) throws AxisFault {
@@ -352,6 +379,12 @@
if (faultInfo != null) {
String faultyHeaderQName = (String) faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
String faultyAction = (String) faultInfo.get(Final.FAULT_PROBLEM_ACTION_NAME);
+ String faultyAddress = (String) faultInfo.get(Final.FAULT_HEADER_PROB_IRI);
+ if(faultyAddress!=null && !"".equals(faultyAddress)){
+ problemDetail = messageContext.getEnvelope().getOMFactory().createOMElement(
+ Final.FAULT_HEADER_PROB_IRI, addressingNamespaceObject);
+ problemDetail.setText(faultyAddress);
+ }
if (faultyAction != null && !"".equals(faultyAction)) {
problemDetail = messageContext.getEnvelope().getOMFactory().createOMElement(
Final.FAULT_PROBLEM_ACTION_NAME, addressingNamespaceObject);
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/resource.properties?view=diff&rev=518795&r1=518794&r2=518795
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/addressing/i18n/resource.properties Thu Mar 15 15:42:07 2007
@@ -29,6 +29,8 @@
onlyNonAnonSupported=A WS-Addressing header contained an anonymous [address] which is not supported by the server.
specificAddressingHeaderRequired=The {0} header is required when WS-Addressing is in use but was not sent.
addressingHeaderRequired=A WS-Addressing header which is required when WS-Addressing is in use was not sent.
+specificDestinationUnreachable=The destination represented by the WS-Addressing To EPR with address {0} cannot be reached.
+destinationUnreachable=The destination represented by the WS-Addressing To EPR cannot be reached.
specificActionNotRecognised=The server did not recognise the action which it received: {0}
actionNotRecognised=The server did not recognise the action which it received.
@@ -36,6 +38,8 @@
spec.FAULT_ACTION_NOT_SUPPORTED_REASON=The [action] cannot be processed at the receiver.
spec.final.FAULT_INVALID_HEADER_REASON=A header representing a Message Addressing Property is not valid and the message cannot be processed
spec.final.FAULT_ADDRESSING_HEADER_REQUIRED_REASON=A required header representing a Message Addressing Property is not present
+spec.final.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON=No route can be determined to reach [destination]
+spec.submission.FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON=No route can be determined to reach the destination role defined by the WS-Addressing To.
spec.submission.FAULT_INVALID_HEADER_REASON=A message information header is not valid and the message cannot be processed. The validity failure can be either structural or semantic, e.g. a [destination] that is not a URI or a [relationship] to a [message id] that was never issued.
spec.submission.FAULT_ADDRESSING_HEADER_REQUIRED_REASON=A required message information header, To, MessageID, or Action, is not present.
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java?view=diff&rev=518795&r1=518794&r2=518795
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java Thu Mar 15 15:42:07 2007
@@ -106,7 +106,9 @@
public static final String FAULT_ACTION_NOT_SUPPORTED = "ActionNotSupported";
public static final String FAULT_ACTION_NOT_SUPPORTED_REASON =
"The [action] cannot be processed at the receiver.";
-
+ public static final String FAULT_ADDRESSING_DESTINATION_UNREACHABLE =
+ "DestinationUnreachable";
+
public interface Final {
// ====================== Addressing 1.0 Final Version Constants ====================
@@ -141,6 +143,7 @@
// fault information
public static final String FAULT_HEADER_PROB_HEADER_QNAME = "ProblemHeaderQName";
public static final String FAULT_HEADER_PROB_HEADER = "ProblemHeader";
+ public static final String FAULT_HEADER_PROB_IRI = "ProblemIRI";
public static final String FAULT_HEADER_DETAIL = "FaultDetail";
public static final String FAULT_INVALID_HEADER = "InvalidAddressingHeader";
public static final String FAULT_INVALID_HEADER_REASON =
@@ -149,6 +152,8 @@
"MessageAddressingHeaderRequired";
public static final String FAULT_ADDRESSING_HEADER_REQUIRED_REASON =
"A required header representing a Message Addressing Property is not present";
+ public static final String FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON =
+ "No route can be determined to reach [destination]";
public static final String FAULT_INVALID_CARDINALITY = "InvalidCardinality";
public static final String FAULT_ONLY_ANONYMOUS_ADDRESS_SUPPORTED =
"OnlyAnonymousAddressSupported";
@@ -187,6 +192,8 @@
"MessageInformationHeaderRequired";
public static final String FAULT_ADDRESSING_HEADER_REQUIRED_REASON =
"A required message information header, To, MessageID, or Action, is not present.";
+ public static final String FAULT_ADDRESSING_DESTINATION_UNREACHABLE_REASON =
+ "No route can be determined to reach the destination role defined by the WS-Addressing To.";
public static final QName WSAW_USING_ADDRESSING =
new QName(WSA_NAMESPACE, USING_ADDRESSING);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org