Author: jonesde
Date: Thu Jul 26 05:56:00 2007
New Revision: 559799
URL:
http://svn.apache.org/viewvc?view=rev&rev=559799Log:
Small changes for better error handling
Modified:
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java?view=diff&rev=559799&r1=559798&r2=559799==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Thu Jul 26 05:56:00 2007
@@ -397,7 +397,7 @@
Element receiptlnElement = UtilXml.firstChildElement(ackDeliveryElement, "ns:RECEIPTLN");
Element docRefElement = UtilXml.firstChildElement(receiptlnElement, "os:DOCUMNTREF");
String docType = UtilXml.childElementValue(docRefElement, "of:DOCTYPE");
- if (docType.equalsIgnoreCase("PO")){
+ if ("PO".equals(docType)){
try {
serviceResult = dispatcher.runSync("receivePoAcknowledge", UtilMisc.toMap("document",doc));
} catch (GenericServiceException e) {
@@ -405,7 +405,7 @@
errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
Debug.logError(e, errMsg, module);
}
- } else if (docType.equalsIgnoreCase("RMA")) {
+ } else if ("RMA".equals(docType)) {
try {
serviceResult = dispatcher.runSync("receiveRmaAcknowledge", UtilMisc.toMap("document",doc));
} catch (GenericServiceException e) {
@@ -413,11 +413,13 @@
errorList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
Debug.logError(e, errMsg, module);
}
+ } else {
+ return ServiceUtil.returnError("For Acknowledge Delivery message could not determine if it is for a PO or RMA");
}
} else {
String errMsg = "Unknown Message Received";
Debug.logError(errMsg, module);
- ServiceUtil.returnError(errMsg);
+ return ServiceUtil.returnError(errMsg);
}
List errorMapList = FastList.newInstance();