You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/12/01 15:43:54 UTC
svn commit: r600141 [4/10] - in
/webservices/axis2/branches/java/jaxws21/modules: adb-codegen/
adb-codegen/src/org/apache/axis2/schema/
adb-codegen/src/org/apache/axis2/schema/template/
adb-codegen/src/org/apache/axis2/schema/util/ adb-codegen/src/org/...
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java Sat Dec 1 06:43:28 2007
@@ -144,7 +144,7 @@
}
if (msg == null) {
msg = "Exception occurred while trying to invoke service method " +
- method.getName();
+ (method != null ? method.getName() : "null");
}
if (cause instanceof AxisFault) {
log.debug(msg, cause);
@@ -156,7 +156,7 @@
throw AxisFault.makeFault(e);
} catch (Exception e) {
String msg = "Exception occurred while trying to invoke service method " +
- method.getName();
+ (method != null ? method.getName() : "null");
log.error(msg, e);
throw AxisFault.makeFault(e);
}
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java Sat Dec 1 06:43:28 2007
@@ -21,12 +21,14 @@
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.soap.SOAP11Constants;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.axis2.databinding.utils.PrintEvents;
+import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;
import org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl;
import org.custommonkey.xmlunit.XMLTestCase;
import org.w3c.dom.Document;
@@ -37,6 +39,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringReader;
@@ -188,6 +191,21 @@
public XMLStreamReader getPullParser(QName adbBeanQName) {
return new ADBXMLStreamReaderImpl(adbBeanQName, propertyList.toArray(), null);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter)
+ throws XMLStreamException, ADBException {
+ serialize(parentQName,factory,xmlWriter,false);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter,
+ boolean serializeType)
+ throws XMLStreamException, ADBException {
+ throw new UnsupportedOperationException("Un implemented method");
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ClientInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ClientInfo.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ClientInfo.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/ClientInfo.java Sat Dec 1 06:43:28 2007
@@ -26,6 +26,12 @@
package org.apache.axis2.databinding;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
/** ClientInfo bean class */
public class ClientInfo
@@ -117,6 +123,21 @@
}
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter)
+ throws XMLStreamException, ADBException {
+ serialize(parentQName,factory,xmlWriter,false);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter,
+ boolean serializeType)
+ throws XMLStreamException, ADBException {
+ throw new UnsupportedOperationException("Un implemented method");
+ }
/** Factory class that keeps the parse method */
public static class Factory {
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/CreateAccountRequest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/CreateAccountRequest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/CreateAccountRequest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/CreateAccountRequest.java Sat Dec 1 06:43:28 2007
@@ -26,6 +26,12 @@
package org.apache.axis2.databinding;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
/** CreateAccountRequest bean class */
public class CreateAccountRequest implements
@@ -98,6 +104,21 @@
.toArray());
}
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter)
+ throws XMLStreamException, ADBException {
+ serialize(parentQName,factory,xmlWriter,false);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter,
+ boolean serializeType)
+ throws XMLStreamException, ADBException {
+ throw new UnsupportedOperationException("Un implemented method");
+ }
/** Factory class that keeps the parse method */
public static class Factory {
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java Sat Dec 1 06:43:28 2007
@@ -80,41 +80,49 @@
public void testConvertToDateTime() {
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS Z");
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Calendar calendar;
+
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29");
System.out.println("String ==> " + "2007-02-15T14:54:29");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29.399");
System.out.println("String ==> " + "2007-02-15T14:54:29.399");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29+05:30");
System.out.println("String ==> " + "2007-02-15T14:54:29+05:30");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29.399+05:30");
System.out.println("String ==> " + "2007-02-15T14:54:29.399+05:30");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29Z");
System.out.println("String ==> " + "2007-02-15T14:54:29Z");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29.399Z");
System.out.println("String ==> " + "2007-02-15T14:54:29.399Z");
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
-
- calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29.399-05:30");
- System.out.println("String ==> " + "2007-02-15T14:54:29.399-05:30");
- System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
-
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
calendar = ConverterUtil.convertToDateTime("2006-12-11T23:57:16.625Z");
System.out.println("String ==> " + "2006-12-11T23:57:16.625Z");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
+
+ calendar = ConverterUtil.convertToDateTime("2007-02-15T14:54:29.399-05:30");
+ System.out.println("String ==> " + "2007-02-15T14:54:29.399-05:30");
+ System.out.println("calendar ==> " + simpleDateFormat.format(calendar.getTime()));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(calendar));
}
@@ -127,22 +135,26 @@
public void testConvertToDate() {
Date date;
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd Z");
-// date = ConverterUtil.convertToDate("2007-02-15");
-// System.out.println("String ==> " + "2007-02-15");
-// System.out.println("calendar ==> " + simpleDateFormat.format(date));
-//
-// date = ConverterUtil.convertToDate("2007-02-15Z");
-// System.out.println("String ==> " + "2007-02-15Z");
-// System.out.println("calendar ==> " + simpleDateFormat.format(date));
-//
-// date = ConverterUtil.convertToDate("2007-02-15+0530");
-// System.out.println("String ==> " + "2007-02-15+0530");
-// System.out.println("calendar ==> " + simpleDateFormat.format(date));
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-ddZ");
+ date = ConverterUtil.convertToDate("2007-02-15");
+ System.out.println("String ==> " + "2007-02-15");
+ System.out.println("calendar ==> " + simpleDateFormat.format(date));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(date));
+
+ date = ConverterUtil.convertToDate("2007-02-15Z");
+ System.out.println("String ==> " + "2007-02-15Z");
+ System.out.println("calendar ==> " + simpleDateFormat.format(date));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(date));
+
+ date = ConverterUtil.convertToDate("2007-02-15+05:30");
+ System.out.println("String ==> " + "2007-02-15+05:30");
+ System.out.println("calendar ==> " + simpleDateFormat.format(date));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(date));
date = ConverterUtil.convertToDate("2007-02-15-12:30");
System.out.println("String ==> " + "2007-02-15-12:30");
System.out.println("calendar ==> " + simpleDateFormat.format(date));
+ System.out.println("calendar ==> " + ConverterUtil.convertToString(date));
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/test/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderTest.java Sat Dec 1 06:43:28 2007
@@ -28,7 +28,9 @@
import org.apache.axiom.om.util.Base64;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axis2.databinding.ADBBean;
+import org.apache.axis2.databinding.ADBException;
import org.apache.axis2.databinding.utils.Constants;
+import org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter;
import org.apache.axis2.util.StreamWrapper;
import org.custommonkey.xmlunit.XMLTestCase;
import org.w3c.dom.Document;
@@ -308,6 +310,21 @@
public XMLStreamReader getPullParser(QName adbBeanQName) {
return new ADBXMLStreamReaderImpl(adbBeanQName, propertyList.toArray(), null);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter)
+ throws XMLStreamException, ADBException {
+ serialize(parentQName,factory,xmlWriter,false);
+ }
+
+ public void serialize(final QName parentQName,
+ final OMFactory factory,
+ MTOMAwareXMLStreamWriter xmlWriter,
+ boolean serializeType)
+ throws XMLStreamException, ADBException {
+ throw new UnsupportedOperationException("Un implemented method");
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/addressing/AddressingFaultsHelper.java Sat Dec 1 06:43:28 2007
@@ -138,10 +138,8 @@
// wsa:InvalidCardinality
public static void triggerInvalidCardinalityFault(MessageContext messageContext,
String incorrectHeaderName) throws AxisFault {
- if (log.isDebugEnabled()) {
- log.debug("triggerInvalidCardinalityFault: messageContext: " + messageContext +
- " incorrectHeaderName: " + incorrectHeaderName);
- }
+ log.warn("triggerInvalidCardinalityFault: messageContext: " + messageContext +
+ " incorrectHeaderName: " + incorrectHeaderName);
String namespace =
(String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
@@ -164,10 +162,8 @@
public static void triggerMissingAddressInEPRFault(MessageContext messageContext,
String incorrectHeaderName)
throws AxisFault {
- if (log.isDebugEnabled()) {
- log.debug("triggerMissingAddressInEPRFault: messageContext: " + messageContext +
+ log.warn("triggerMissingAddressInEPRFault: messageContext: " + messageContext +
" incorrectHeaderName: " + incorrectHeaderName);
- }
String namespace =
(String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
@@ -188,10 +184,8 @@
// wsa:DuplicateMessageID
// wsa:ActionMismatch
- public static void triggerActionMismatchFault(MessageContext messageContext) throws AxisFault {
- if (log.isDebugEnabled()) {
- log.debug("triggerActionMismatchFault: messageContext: " + messageContext);
- }
+ public static void triggerActionMismatchFault(MessageContext messageContext, String soapAction, String wsaAction) throws AxisFault {
+ log.warn("triggerActionMismatchFault: messageContext: " + messageContext+" soapAction="+soapAction+" wsaAction="+wsaAction);
String namespace =
(String)messageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
if (Submission.WSA_NAMESPACE.equals(namespace)) {
@@ -313,10 +307,8 @@
// wsa:ActionNotSupported [Reason] the string: "The [action] cannot be processed at the receiver"
public static void triggerActionNotSupportedFault(MessageContext messageContext,
String problemAction) throws AxisFault {
- if (log.isDebugEnabled()) {
- log.debug("triggerActionNotSupportedFault: messageContext: " + messageContext +
- " problemAction: " + problemAction);
- }
+ log.warn("triggerActionNotSupportedFault: messageContext: " + messageContext +
+ " problemAction: " + problemAction);
triggerAddressingFault(messageContext, Final.FAULT_PROBLEM_ACTION_NAME, problemAction,
AddressingConstants.FAULT_ACTION_NOT_SUPPORTED, null,
AddressingMessages.getMessage(
@@ -331,7 +323,7 @@
String faultSubcode, String faultReason)
throws AxisFault {
Map faultInformation =
- (Map)messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
+ (Map)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
if (faultInformation == null) {
faultInformation = new HashMap();
messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation);
@@ -383,7 +375,7 @@
public static OMElement getDetailElementForAddressingFault(MessageContext messageContext,
OMNamespace addressingNamespaceObject) {
- Map faultInfo = (Map)messageContext.getProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
+ Map faultInfo = (Map)messageContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
OMElement problemDetail = null;
if (faultInfo != null) {
String faultyHeaderQName = (String)faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Sat Dec 1 06:43:28 2007
@@ -19,21 +19,14 @@
package org.apache.axis2.handlers.addressing;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.soap.RolePlayer;
import org.apache.axiom.soap.SOAP12Constants;
import org.apache.axiom.soap.SOAPHeader;
import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.AddressingFaultsHelper;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.*;
import org.apache.axis2.client.Options;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.Parameter;
@@ -45,25 +38,31 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
public abstract class AddressingInHandler extends AbstractHandler implements AddressingConstants {
protected String addressingNamespace = Final.WSA_NAMESPACE; // defaulting to final version
protected String addressingVersion = null;
-
- public static final String DISABLE_REF_PARAMETER_EXTRACT = "disableRefParamExtract";
-
+
+ public static final String DISABLE_REF_PARAMETER_EXTRACT = "disableRefParamExtract";
+
private static final Log log = LogFactory.getLog(AddressingInHandler.class);
private boolean disableRefparamExtract = false;
-
+
public void init(HandlerDescription handlerdesc) {
- super.init(handlerdesc);
- disableRefparamExtract = JavaUtils.isTrueExplicitly(Utils.getParameterValue(handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT)));
- if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
- log.debug("AddressingInHandler.init disableRefparamExtract="+disableRefparamExtract);
- }
+ super.init(handlerdesc);
+ disableRefparamExtract = JavaUtils.isTrueExplicitly(
+ Utils.getParameterValue(handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT)));
+ if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+ log.debug("AddressingInHandler.init disableRefparamExtract=" + disableRefparamExtract);
+ }
}
-
+
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
//Determine if we want to ignore addressing headers.
Parameter disableParam = msgContext.getParameter(DISABLE_ADDRESSING_HANDLERS);
@@ -78,7 +77,8 @@
}
// if another handler has already processed the addressing headers, do not do anything here.
- if (msgContext.isPropertyTrue(IS_ADDR_INFO_ALREADY_PROCESSED)) {
+ if (JavaUtils.isTrueExplicitly(msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED),
+ false)) {
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(
"Another handler has processed the addressing headers. Nothing to do here.");
@@ -106,6 +106,8 @@
}
SOAPHeader header = msgContext.getEnvelope().getHeader();
+ RolePlayer rolePlayer = (RolePlayer) msgContext.getConfigurationContext()
+ .getAxisConfiguration().getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
// if there are not headers put a flag to disable addressing temporary
if (header == null) {
@@ -117,20 +119,18 @@
log.debug("Starting " + addressingVersion + " IN handler ...");
}
-
- ArrayList addressingHeaders;
- addressingHeaders = header.getHeaderBlocksWithNSURI(namespace);
- if (addressingHeaders != null && addressingHeaders.size() > 0) {
+ Iterator iterator = header.getHeadersToProcess(rolePlayer, namespace);
+ if (iterator.hasNext()) {
msgContext.setProperty(WS_ADDRESSING_VERSION, namespace);
msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug(addressingVersion +
- " Headers present in the SOAP message. Starting to process ...");
+ " Headers present in the SOAP message. Starting to process ...");
+ }
+ if (extractAddressingInformation(header, msgContext, iterator, namespace)) {
+ msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
}
-
- extractAddressingInformation(header, msgContext, addressingHeaders, namespace);
- msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
} else {
msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
@@ -140,100 +140,120 @@
return InvocationResponse.CONTINUE;
}
-
+
protected static final int TO_FLAG = 1, FROM_FLAG = 2, REPLYTO_FLAG = 3,
- FAULTO_FLAG = 4, MESSAGEID_FLAG = 6, ACTION_FLAG = 0;
- protected Options extractAddressingInformation(SOAPHeader header, MessageContext messageContext,
- ArrayList addressingHeaders, String namespace)
- throws AxisFault {
+ FAULTO_FLAG = 4, MESSAGEID_FLAG = 6, ACTION_FLAG = 0;
+ /**
+ * Pull addressing headers out from the SOAP message.
+ *
+ * @param header the header of the SOAP message
+ * @param messageContext the active MessageContext
+ * @param headers an Iterator over the addressing headers targeted to me
+ * @param namespace the addressing namespace
+ * @return true if addressing information was found
+ * @throws AxisFault if an error occurs
+ */
+ protected boolean extractAddressingInformation(SOAPHeader header, MessageContext messageContext,
+ Iterator headers, String namespace)
+ throws AxisFault {
Options messageContextOptions = messageContext.getOptions();
-
+
ArrayList duplicateHeaderNames = new ArrayList(1); // Normally will not be used for more than 1 header
ArrayList relatesToHeaders = null;
- SOAPHeaderBlock actionBlock = null, toBlock = null, messageIDBlock = null, replyToBlock = null, faultToBlock = null, fromBlock = null;
-
+ SOAPHeaderBlock actionBlock = null, toBlock = null, messageIDBlock = null, replyToBlock =
+ null, faultToBlock = null, fromBlock = null;
+
// Per the SOAP Binding spec "headers with an incorrect cardinality MUST NOT be used" So these variables
// are used to keep track of invalid cardinality headers so they are not deserialised.
boolean[] ignoreHeaders = new boolean[7];
boolean[] checkedHeaderNames = new boolean[7];
-
+
// First pass just check for duplicates
- for(int i=0;i<addressingHeaders.size();i++){
- SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeaders.get(i);
- if (messageContext.isSOAP11() || !SOAP12Constants.SOAP_ROLE_NONE.equals(soapHeaderBlock.getRole())) {
- String localName = soapHeaderBlock.getLocalName();
- if (WSA_ACTION.equals(localName)) {
- actionBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_ACTION, ACTION_FLAG,
- checkedHeaderNames, ignoreHeaders,
- duplicateHeaderNames);
- } else if (WSA_TO.equals(localName)) {
- toBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_TO, TO_FLAG, checkedHeaderNames, ignoreHeaders, duplicateHeaderNames);
- } else if (WSA_MESSAGE_ID.equals(localName)) {
- messageIDBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_MESSAGE_ID, MESSAGEID_FLAG,
- checkedHeaderNames, ignoreHeaders,
- duplicateHeaderNames);
- } else if (WSA_REPLY_TO.equals(localName)) {
- replyToBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_REPLY_TO, REPLYTO_FLAG,
- checkedHeaderNames, ignoreHeaders,
- duplicateHeaderNames);
- } else if (WSA_FAULT_TO.equals(localName)) {
- faultToBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_FAULT_TO,FAULTO_FLAG,
- checkedHeaderNames, ignoreHeaders,
- duplicateHeaderNames);
- } else if (WSA_FROM.equals(localName)) {
- fromBlock = soapHeaderBlock;
- checkDuplicateHeaders(WSA_FROM,FROM_FLAG,
- checkedHeaderNames, ignoreHeaders,
- duplicateHeaderNames);
- } else if(WSA_RELATES_TO.equals(localName)){
- if(relatesToHeaders == null){
- relatesToHeaders = new ArrayList(1);
- }
- relatesToHeaders.add(soapHeaderBlock);
- }
- }
+ while (headers.hasNext()) {
+ SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock)headers.next();
+ String localName = soapHeaderBlock.getLocalName();
+ if (WSA_ACTION.equals(localName)) {
+ actionBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_ACTION, ACTION_FLAG,
+ checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_TO.equals(localName)) {
+ toBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_TO, TO_FLAG, checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_MESSAGE_ID.equals(localName)) {
+ messageIDBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_MESSAGE_ID, MESSAGEID_FLAG,
+ checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_REPLY_TO.equals(localName)) {
+ replyToBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_REPLY_TO, REPLYTO_FLAG,
+ checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_FAULT_TO.equals(localName)) {
+ faultToBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_FAULT_TO, FAULTO_FLAG,
+ checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_FROM.equals(localName)) {
+ fromBlock = soapHeaderBlock;
+ checkDuplicateHeaders(WSA_FROM, FROM_FLAG,
+ checkedHeaderNames, ignoreHeaders,
+ duplicateHeaderNames);
+ } else if (WSA_RELATES_TO.equals(localName)) {
+ if (relatesToHeaders == null) {
+ relatesToHeaders = new ArrayList(1);
+ }
+ relatesToHeaders.add(soapHeaderBlock);
+ }
+ }
+
+ if (actionBlock == null && toBlock == null && messageIDBlock == null
+ && replyToBlock == null && faultToBlock == null
+ && fromBlock == null && relatesToHeaders == null) {
+ // All of the headers must have had the non local roles so further
+ // processing should be skipped.
+ return false;
}
- if (actionBlock!=null && !ignoreHeaders[ACTION_FLAG]) {
+ if (actionBlock != null && !ignoreHeaders[ACTION_FLAG]) {
extractActionInformation(actionBlock, messageContext);
}
- if (toBlock != null &&!ignoreHeaders[TO_FLAG]) {
+ if (toBlock != null && !ignoreHeaders[TO_FLAG]) {
extractToEPRInformation(toBlock,
messageContextOptions,
header,
namespace);
- }
- if (messageIDBlock!=null && !ignoreHeaders[MESSAGEID_FLAG]) {
+ }
+ if (messageIDBlock != null && !ignoreHeaders[MESSAGEID_FLAG]) {
extractMessageIDInformation(messageIDBlock, messageContext);
- }
- if (relatesToHeaders!=null) {
- for(int i=0;i<relatesToHeaders.size();i++){
- extractRelatesToInformation((SOAPHeaderBlock)relatesToHeaders.get(i), messageContextOptions);
- }
- }
- if (replyToBlock!=null && !ignoreHeaders[REPLYTO_FLAG]) {
+ }
+ if (relatesToHeaders != null) {
+ for (int i = 0; i < relatesToHeaders.size(); i++) {
+ extractRelatesToInformation((SOAPHeaderBlock) relatesToHeaders.get(i),
+ messageContextOptions);
+ }
+ }
+ if (replyToBlock != null && !ignoreHeaders[REPLYTO_FLAG]) {
extractReplyToEPRInformation(replyToBlock, namespace, messageContext);
}
- if (faultToBlock!=null && !ignoreHeaders[FAULTO_FLAG]) {
+ if (faultToBlock != null && !ignoreHeaders[FAULTO_FLAG]) {
extractFaultToEPRInformation(faultToBlock, namespace, messageContext);
}
- if (fromBlock!=null && !ignoreHeaders[FROM_FLAG]) {
+ if (fromBlock != null && !ignoreHeaders[FROM_FLAG]) {
extractFromEPRInformation(fromBlock, namespace, messageContext);
}
-
+
// Now that all the valid wsa headers have been read, throw an exception if there was an invalid cardinality
// This means that if for example there are multiple MessageIDs and a FaultTo, the FaultTo will be respected.
if (!duplicateHeaderNames.isEmpty()) {
// Simply choose the first problem header we came across as we can only fault for one of them.
AddressingFaultsHelper.triggerInvalidCardinalityFault(messageContext,
- (String) duplicateHeaderNames.get(0));
+ (String) duplicateHeaderNames
+ .get(0));
}
// check for the presence of madatory addressing headers
@@ -242,34 +262,67 @@
// provide default values for headers that have not been found.
setDefaults(checkedHeaderNames, messageContext);
- return messageContextOptions;
+ return true;
+ }
+
+ // Copied from SOAPHeaderImpl.java - some reconciliation probably a good idea....
+ protected boolean isInRole(SOAPHeaderBlock soapHeaderBlock,
+ RolePlayer rolePlayer,
+ boolean isSOAP11) {
+ String role = soapHeaderBlock.getRole();
+
+ // 1. If role is ultimatedest, go by what the rolePlayer says
+ if (role == null || role.equals("") ||
+ (!isSOAP11 &&
+ role.equals(SOAP12Constants.SOAP_ROLE_ULTIMATE_RECEIVER))) {
+ return (rolePlayer == null || rolePlayer.isUltimateDestination());
+ }
+
+ // 2. If role is next, always return true
+ if (role.equals(soapHeaderBlock.getVersion().getNextRoleURI())) return true;
+
+ // 3. If role is none, always return false
+ if (!isSOAP11 && role.equals(SOAP12Constants.SOAP_ROLE_NONE)) {
+ return false;
+ }
+
+ // 4. Return t/f depending on match
+ List roles = (rolePlayer == null) ? null : rolePlayer.getRoles();
+ if (roles != null) {
+ for (int i = 0; i < roles.size(); i++) {
+ String thisRole = (String) roles.get(i);
+ if (thisRole.equals(role)) return true;
+ }
+ }
+
+ return false;
}
protected abstract void checkForMandatoryHeaders(boolean[] alreadyFoundAddrHeader,
- MessageContext messageContext)
- throws AxisFault;
+ MessageContext messageContext)
+ throws AxisFault;
protected abstract void setDefaults(boolean[] alreadyFoundAddrHeader,
- MessageContext messageContext) throws AxisFault;
+ MessageContext messageContext) throws AxisFault;
private void checkDuplicateHeaders(String addressingHeaderName, int headerFlag,
- boolean[] checkedHeaderNames, boolean[] ignoreHeaders,
- ArrayList duplicateHeaderNames) {//throws AxisFault {
- // If the header name has been seen before then we should return true and add it to the list
- // of duplicate header names. Otherwise it is the first time we've seen the header so add it
- // to the checked liat and return false.
- ignoreHeaders[headerFlag] = checkedHeaderNames[headerFlag];
- if (ignoreHeaders[headerFlag]) {
- duplicateHeaderNames.add(addressingHeaderName);
- } else {
- checkedHeaderNames[headerFlag] = true;
- }
+ boolean[] checkedHeaderNames, boolean[] ignoreHeaders,
+ ArrayList duplicateHeaderNames) {//throws AxisFault {
+ // If the header name has been seen before then we should return true and add it to the list
+ // of duplicate header names. Otherwise it is the first time we've seen the header so add it
+ // to the checked liat and return false.
+ ignoreHeaders[headerFlag] = checkedHeaderNames[headerFlag];
+ if (ignoreHeaders[headerFlag]) {
+ duplicateHeaderNames.add(addressingHeaderName);
+ } else {
+ checkedHeaderNames[headerFlag] = true;
+ }
- if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
- log.trace("checkDuplicateHeaders: addressingHeaderName=" + addressingHeaderName
- + " isDuplicate=" + ignoreHeaders[headerFlag]);
- }
+ if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+ log.trace("checkDuplicateHeaders: addressingHeaderName=" + addressingHeaderName
+ + " isDuplicate=" + ignoreHeaders[headerFlag]);
+ }
}
protected abstract void extractToEprReferenceParameters(EndpointReference toEPR,
@@ -290,7 +343,7 @@
if (log.isTraceEnabled()) {
log.trace("extractRelatesToInformation: Extracted Relationship. Value=" + address +
- " RelationshipType=" + relationshipTypeString);
+ " RelationshipType=" + relationshipTypeString);
}
RelatesTo relatesTo = new RelatesTo(address, relationshipTypeString);
@@ -368,15 +421,15 @@
if (addressAttributes != null && addressAttributes.hasNext()) {
ArrayList attributes = new ArrayList();
while (addressAttributes.hasNext()) {
- OMAttribute attr = (OMAttribute)addressAttributes.next();
+ OMAttribute attr = (OMAttribute) addressAttributes.next();
attributes.add(attr);
}
epr.setAddressAttributes(attributes);
}
// check for reference parameters
- if(!disableRefparamExtract){
- extractToEprReferenceParameters(epr, header, namespace);
+ if (!disableRefparamExtract) {
+ extractToEprReferenceParameters(epr, header, namespace);
}
soapHeaderBlock.setProcessed();
@@ -397,7 +450,7 @@
if (log.isTraceEnabled()) {
log.trace("extractActionInformation: soapAction='" + soapAction + "' wsa:Action='" +
- wsaAction + "'");
+ wsaAction + "'");
}
// Need to validate that the content of the wsa:Action header is not null or whitespace
@@ -413,7 +466,7 @@
// check that soapAction==wsa:Action
if (soapAction != null && !"".equals(soapAction) && messageContext.isServerSide()) {
if (!soapAction.equals(wsaAction)) {
- AddressingFaultsHelper.triggerActionMismatchFault(messageContext);
+ AddressingFaultsHelper.triggerActionMismatchFault(messageContext, soapAction, wsaAction);
}
} else {
messageContextOptions.setAction(wsaAction);
@@ -442,10 +495,10 @@
/**
* Given the soap header block, this should extract the information within EPR.
*
- * @param headerBlock a SOAP header which is of type EndpointReference
- * @param epr the EndpointReference to fill in with the extracted data
+ * @param headerBlock a SOAP header which is of type EndpointReference
+ * @param epr the EndpointReference to fill in with the extracted data
* @param addressingNamespace the WSA namespace URI
- * @param messageContext the active MessageContext
+ * @param messageContext the active MessageContext
* @throws AxisFault if there is a problem
*/
private void extractEPRInformation(SOAPHeaderBlock headerBlock, EndpointReference epr,
@@ -469,7 +522,7 @@
if (actionAttributes != null && actionAttributes.hasNext()) {
ArrayList attributes = new ArrayList();
while (actionAttributes.hasNext()) {
- OMAttribute attr = (OMAttribute)actionAttributes.next();
+ OMAttribute attr = (OMAttribute) actionAttributes.next();
attributes.add(attr);
}
return attributes;
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Sat Dec 1 06:43:28 2007
@@ -434,16 +434,19 @@
*/
private void processToEPRReferenceInformation(Map referenceInformation, OMElement parent) {
if (referenceInformation != null && parent != null) {
+ if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+ log.trace("processToEPRReferenceInformation: " + referenceInformation);
+ }
Iterator iterator = referenceInformation.values().iterator();
while (iterator.hasNext()) {
OMElement omElement = (OMElement)iterator.next();
- parent.addChild(
- ElementHelper.importOMElement(omElement, parent.getOMFactory()));
+ OMElement newElement = ElementHelper.importOMElement(omElement, parent.getOMFactory());
if (isFinalAddressingNamespace) {
- omElement.addAttribute(Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE,
+ newElement.addAttribute(Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE,
Final.WSA_TYPE_ATTRIBUTE_VALUE,
addressingNamespaceObject);
}
+ parent.addChild(newElement);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/addressing/AddressingFaultsTest.java Sat Dec 1 06:43:28 2007
@@ -59,7 +59,7 @@
messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
AddressingConstants.Final.WSA_NAMESPACE);
try {
- AddressingFaultsHelper.triggerActionMismatchFault(messageContext);
+ AddressingFaultsHelper.triggerActionMismatchFault(messageContext, "soapAction", "wsaAction");
fail("Should have thrown exception");
} catch (AxisFault af) {
// Expected
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java Sat Dec 1 06:43:28 2007
@@ -20,16 +20,19 @@
package org.apache.axis2.handlers.addressing;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.RolePlayer;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
public class AddressingFinalInHandlerTest extends AddressingInHandlerTestBase {
@@ -52,7 +55,7 @@
public void testExtractAddressingInformationFromHeaders() {
try {
- Options options = extractAddressingInformationFromHeaders();
+ Options options = extractAddressingInformationFromHeaders(null);
assertNotNull(options);
assertNotNull(options.getTo());
@@ -72,6 +75,48 @@
fail(" An Exception has occured " + e.getMessage());
}
}
+
+ public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception{
+ testFileName = "soapmessage.customrole.xml";
+ Options options = extractAddressingInformationFromHeaders(new RolePlayer(){
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
+
+ assertNotNull(options);
+ assertNotNull(options.getTo());
+ assertEPRHasCorrectMetadata(options.getFrom());
+ assertEPRHasCorrectMetadata(options.getFaultTo());
+ assertEPRHasCorrectMetadata(options.getReplyTo());
+
+ }
+
+ public void testExtractAddressingInformationFromHeadersCustomRoleSOAP12() throws Exception{
+ testFileName = "soapmessage.customrole.soap12.xml";
+ Options options = extractAddressingInformationFromHeaders(new RolePlayer(){
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
+
+ assertNotNull(options);
+ assertNotNull(options.getTo());
+ assertEPRHasCorrectMetadata(options.getFrom());
+ assertEPRHasCorrectMetadata(options.getFaultTo());
+ assertEPRHasCorrectMetadata(options.getReplyTo());
+
+ }
public void testMessageWithOmittedAction() {
try {
@@ -187,9 +232,10 @@
}
}
- public void testDifferentSoapActionProcessing() {
+ public void testDifferentSoapActionProcessing() throws Exception{
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
mc.setServerSide(true);
try {
mc.setSoapAction("http://ws.apache.org/tests/differentAction");
@@ -199,16 +245,12 @@
catch (AxisFault af) {
//Test passed.
}
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
}
- public void testSameSoapAction() {
+ public void testSameSoapAction() throws Exception{
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
mc.setServerSide(true);
try {
mc.setSoapAction("http://ws.apache.org/tests/action");
@@ -219,17 +261,12 @@
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown while testing with a soapaction and ws-a action that are the same.");
}
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
}
- public void testEmptySoapAction() {
+ public void testEmptySoapAction() throws Exception{
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
-
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
try {
mc.setSoapAction("");
basicExtractAddressingInformationFromHeaders(testfile, mc);
@@ -239,17 +276,12 @@
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown while testing with an empty soapaction.");
}
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
}
- public void testNullSoapAction() {
+ public void testNullSoapAction() throws Exception{
String testfile = "valid-messages/" + versionDirectory + "/soapmessage.xml";
MessageContext mc = new MessageContext();
-
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
try {
mc.setSoapAction(null);
basicExtractAddressingInformationFromHeaders(testfile, mc);
@@ -258,11 +290,6 @@
af.printStackTrace();
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown while testing with a null soapaction.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInFaultHandlerTest.java Sat Dec 1 06:43:28 2007
@@ -27,6 +27,7 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.handlers.util.TestUtil;
@@ -84,6 +85,7 @@
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testfile);
SOAPEnvelope envelope = ((SOAPEnvelope)omBuilder.getDocumentElement());
MessageContext msgContext = new MessageContext();
+ msgContext.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
msgContext.setEnvelope(envelope);
AddressingFinalInHandler afih = new AddressingFinalInHandler();
afih.invoke(msgContext);
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java Sat Dec 1 06:43:28 2007
@@ -22,15 +22,20 @@
import junit.framework.TestCase;
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.RolePlayer;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.addressing.RelatesTo;
import org.apache.axis2.client.Options;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.handlers.util.TestUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,7 +50,7 @@
AddressingInHandler inHandler;
String addressingNamespace;
TestUtil testUtil = new TestUtil();
- private String testFileName = "soapmessage.xml";
+ String testFileName = "soapmessage.xml";
String versionDirectory;
@@ -67,17 +72,21 @@
throws Exception {
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testMessagePath);
SOAPHeader header = ((SOAPEnvelope)omBuilder.getDocumentElement()).getHeader();
- ArrayList addressingHeaderBlocks = header.getHeaderBlocksWithNSURI(addressingNamespace);
+ RolePlayer rolePlayer = (RolePlayer)mc.getConfigurationContext()
+ .getAxisConfiguration().getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
+ Iterator addressingHeaderBlocks = header.getHeadersToProcess(rolePlayer, addressingNamespace);
inHandler.extractAddressingInformation(header, mc, addressingHeaderBlocks,
addressingNamespace);
}
- protected Options extractAddressingInformationFromHeaders() {
- try {
+ protected Options extractAddressingInformationFromHeaders(RolePlayer rolePlayer) throws Exception{
String testfile = "valid-messages/" + versionDirectory + "/" + testFileName;
MessageContext mc = new MessageContext();
-
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
+ if(rolePlayer != null){
+ mc.getConfigurationContext().getAxisConfiguration().addParameter(Constants.SOAP_ROLE_PLAYER_PARAMETER, rolePlayer);
+ }
basicExtractAddressingInformationFromHeaders(testfile, mc);
Options options = mc.getOptions();
@@ -85,9 +94,7 @@
if (options == null) {
fail("Addressing Information Headers have not been retrieved properly");
}
- assertEquals("action header is not correct",
- options.getAction(),
- action);
+ assertEquals("action header is not correct", action, options.getAction());
assertActionHasExtensibilityAttribute(mc);
assertEquals("message id header is not correct",
options.getMessageId().trim(),
@@ -101,14 +108,6 @@
assertRelationships(options);
return options;
-
- } catch (Exception e) {
- e.printStackTrace();
- log.info(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
-
- return null;
}
private void testExtractAddressingInformationFromHeadersInvalidCardinality(String headerName) {
@@ -116,6 +115,7 @@
"/invalidCardinality" + headerName + "Message.xml";
try {
MessageContext mc = new MessageContext();
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
try {
basicExtractAddressingInformationFromHeaders(testfile, mc);
fail("An AxisFault should have been thrown due to 2 wsa:" + headerName +
@@ -171,6 +171,8 @@
"omitted-header-messages/" + versionDirectory + "/" + testName + "Message.xml";
MessageContext mc = new MessageContext();
+ ConfigurationContext cc = ConfigurationContextFactory.createDefaultConfigurationContext();
+ mc.setConfigurationContext(cc);
basicExtractAddressingInformationFromHeaders(testfile, mc);
return mc.getOptions();
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingSubmissionInHandlerTest.java Sat Dec 1 06:43:28 2007
@@ -19,6 +19,10 @@
package org.apache.axis2.handlers.addressing;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.axiom.soap.RolePlayer;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.addressing.EndpointReference;
@@ -44,15 +48,23 @@
secondRelationshipType = "axis2:some.custom.relationship";
}
- public void testExtractAddressingInformationFromHeaders() {
- try {
- Options options = extractAddressingInformationFromHeaders();
- // Cannot check refparams in 2004/08 case as they can't be extracted until later
- } catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
+ public void testExtractAddressingInformationFromHeaders() throws Exception{
+ extractAddressingInformationFromHeaders(null);
+ // Cannot check refparams in 2004/08 case as they can't be extracted until later
+ }
+
+ public void testExtractAddressingInformationFromHeadersCustomRole() throws Exception{
+ testFileName = "soapmessage.customrole.xml";
+ extractAddressingInformationFromHeaders(new RolePlayer(){
+ public List getRoles() {
+ ArrayList al = new ArrayList();
+ al.add("http://my/custom/role");
+ return al;
+ }
+ public boolean isUltimateDestination() {
+ return false;
+ }
+ });
}
public void testMessageWithOmittedAction() {
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingValidationHandlerTest.java Sat Dec 1 06:43:28 2007
@@ -23,6 +23,7 @@
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
@@ -48,7 +49,7 @@
String testfile = directory + "/" + versionDirectory + "/" + testName;
MessageContext mc = new MessageContext();
-
+ mc.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testfile);
mc.setEnvelope(omBuilder.getSOAPEnvelope());
Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java Sat Dec 1 06:43:28 2007
@@ -52,7 +52,7 @@
public DefaultContextManager() {
}
-
+
public String updateContext(AbstractContext context) throws ClusteringFault {
ContextClusteringCommand cmd =
ContextClusteringCommandFactory.getUpdateCommand(context,
@@ -161,15 +161,21 @@
configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
new Long(tts));
} catch (ClusteringFault clusteringFault) {
+ AckManager.removeMessage(cmd.getUniqueId());
throw new RuntimeException(clusteringFault);
}
}
};
processorThread.start();
} else {
- long tts = sender.sendToGroup(cmd);
- configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
- new Long(tts));
+ try {
+ long tts = sender.sendToGroup(cmd);
+ configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
+ new Long(tts));
+ } catch (ClusteringFault clusteringFault) {
+ AckManager.removeMessage(cmd.getUniqueId());
+ throw clusteringFault;
+ }
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java Sat Dec 1 06:43:28 2007
@@ -51,11 +51,21 @@
}
}
+ public static void removeMessage(String messageUniqueId){
+ messageAckTable.remove(messageUniqueId);
+ }
+
public static boolean isMessageAcknowledged(String messageUniqueId,
ChannelSender sender) throws ClusteringFault {
boolean isAcknowledged = false;
+ if(messageUniqueId == null){
+ return true;
+ }
MessageACK ack = (MessageACK) messageAckTable.get(messageUniqueId);
+ if(ack == null){ // If the message is not found, treat it as ACKed
+ return true;
+ }
// Check that all members in the memberList are same as the total member list,
// which will indicate that all members have ACKed the message
Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java Sat Dec 1 06:43:28 2007
@@ -29,14 +29,22 @@
import org.apache.axis2.clustering.context.commands.UpdateContextCommand;
import org.apache.axis2.clustering.control.AckCommand;
import org.apache.axis2.clustering.control.ControlCommand;
-import org.apache.axis2.clustering.control.GetStateResponseCommand;
import org.apache.axis2.clustering.control.GetConfigurationResponseCommand;
+import org.apache.axis2.clustering.control.GetStateResponseCommand;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.catalina.tribes.ByteMessage;
import org.apache.catalina.tribes.Member;
+import org.apache.catalina.tribes.io.XByteBuffer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
public class ChannelListener implements org.apache.catalina.tribes.ChannelListener {
private static final Log log = LogFactory.getLog(ChannelListener.class);
@@ -77,6 +85,29 @@
}
public void messageReceived(Serializable msg, Member sender) {
+ try {
+ AxisConfiguration configuration = configurationContext.getAxisConfiguration();
+ List classLoaders = new ArrayList();
+ classLoaders.add(configuration.getSystemClassLoader());
+ classLoaders.add(getClass().getClassLoader());
+ for (Iterator iter = configuration.getServiceGroups(); iter.hasNext();) {
+ AxisServiceGroup group = (AxisServiceGroup) iter.next();
+ classLoaders.add(group.getServiceGroupClassLoader());
+ }
+ for (Iterator iter = configuration.getModules().values().iterator(); iter.hasNext();) {
+ AxisModule module = (AxisModule) iter.next();
+ classLoaders.add(module.getModuleClassLoader());
+ }
+
+
+ byte[] message = ((ByteMessage) msg).getMessage();
+ msg = XByteBuffer.deserialize(message,
+ 0,
+ message.length,
+ (ClassLoader[])classLoaders.toArray(new ClassLoader[classLoaders.size()]));
+ } catch (Exception e) {
+ log.error(e);
+ }
// If the system has not still been intialized, reject all incoming messages, except the
// GetStateResponseCommand message
@@ -84,17 +115,22 @@
getPropertyNonReplicable(ClusteringConstants.CLUSTER_INITIALIZED) == null
&& !(msg instanceof GetStateResponseCommand) &&
!(msg instanceof GetConfigurationResponseCommand)) {
+
+ log.warn("Received message before cluster initialization has been completed");
return;
}
- log.debug("RECEIVED MESSAGE " + msg + " from " + TribesUtil.getHost(sender));
+ log.debug("Received message " + msg + " from " + TribesUtil.getHost(sender));
try {
- processMessage(msg,sender);
+ processMessage(msg, sender);
} catch (Exception e) {
log.error(e);
}
}
private void processMessage(Serializable msg, Member sender) throws ClusteringFault {
+ //TODO: Reject duplicates that can be received due to retransmissions
+ //TODO: ACK implosion?
+
if (msg instanceof ContextClusteringCommand && contextManager != null) {
ContextClusteringCommand ctxCmd = (ContextClusteringCommand) msg;
contextManager.process(ctxCmd);
@@ -114,6 +150,6 @@
} else if (msg instanceof ControlCommand && controlCommandProcessor != null) {
controlCommandProcessor.process((ControlCommand) msg,
sender);
- }
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java Sat Dec 1 06:43:28 2007
@@ -22,10 +22,17 @@
import org.apache.axis2.clustering.ClusteringCommand;
import org.apache.axis2.clustering.ClusteringFault;
import org.apache.axis2.clustering.MessageSender;
-import org.apache.catalina.tribes.*;
+import org.apache.catalina.tribes.ByteMessage;
+import org.apache.catalina.tribes.Channel;
+import org.apache.catalina.tribes.Member;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
+
public class ChannelSender implements MessageSender {
private Log log = LogFactory.getLog(ChannelSender.class);
@@ -39,19 +46,24 @@
// Keep retrying, since at the point of trying to send the msg, a member may leave the group
// causing a view change. All nodes in a view should get the msg
- //TODO: Sometimes Tribes ncorrectly detects that a member has left a group
+ //TODO: Sometimes Tribes incorrectly detects that a member has left a group
while (true) {
if (channel.getMembers().length > 0) {
try {
long start = System.currentTimeMillis();
- channel.send(channel.getMembers(), msg, Channel.SEND_OPTIONS_USE_ACK);
+ channel.send(channel.getMembers(), toByteMessage(msg), Channel.SEND_OPTIONS_USE_ACK);
timeToSend = System.currentTimeMillis() - start;
log.debug("Sent " + msg + " to group");
break;
- } catch (ChannelException e) {
+ } catch (NotSerializableException e) {
+ String message = "Could not send command message " + msg +
+ " to group since it is not serializable.";
+ log.error(message, e);
+ throw new ClusteringFault(message, e);
+ } catch (Exception e) {
String message = "Error sending command message : " + msg +
". Reason " + e.getMessage();
- log.warn(message);
+ log.warn(message, e);
}
} else {
break;
@@ -60,16 +72,25 @@
return timeToSend;
}
+ private ByteMessage toByteMessage(ClusteringCommand msg) throws IOException {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos);
+ out.writeObject(msg);
+ out.flush();
+ out.close();
+ return new ByteMessage(bos.toByteArray());
+ }
+
public void sendToSelf(ClusteringCommand msg) throws ClusteringFault {
if (channel == null) {
return;
}
try {
channel.send(new Member[]{channel.getLocalMember(true)},
- msg,
+ toByteMessage(msg),
Channel.SEND_OPTIONS_USE_ACK);
log.debug("Sent " + msg + " to self");
- } catch (ChannelException e) {
+ } catch (Exception e) {
throw new ClusteringFault(e);
}
}
@@ -79,14 +100,19 @@
try {
if (member.isReady()) {
long start = System.currentTimeMillis();
- channel.send(new Member[]{member}, cmd, Channel.SEND_OPTIONS_USE_ACK);
+ channel.send(new Member[]{member}, toByteMessage(cmd), Channel.SEND_OPTIONS_USE_ACK);
timeToSend = System.currentTimeMillis() - start;
log.debug("Sent " + cmd + " to " + TribesUtil.getHost(member));
}
- } catch (ChannelException e) {
+ } catch (NotSerializableException e) {
+ String message = "Could not send command message to " + TribesUtil.getHost(member) +
+ " since it is not serializable.";
+ log.error(message, e);
+ throw new ClusteringFault(message, e);
+ } catch (Exception e) {
String message = "Could not send message to " + TribesUtil.getHost(member) +
". Reason " + e.getMessage();
- log.warn(message);
+ log.warn(message, e);
}
return timeToSend;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java Sat Dec 1 06:43:28 2007
@@ -46,6 +46,7 @@
import org.apache.catalina.tribes.Member;
import org.apache.catalina.tribes.group.GroupChannel;
import org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor;
+import org.apache.catalina.tribes.transport.ReceiverBase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -132,6 +133,12 @@
controlCmdProcessor.setChannelSender(sender);
channel = new GroupChannel();
+
+ String localIP = System.getProperty("local.ip.address"); //TODO: Use ClusteringConstants.LOCAL_IP_ADDRESS
+ if (localIP != null) {
+ ReceiverBase receiver = (ReceiverBase) channel.getChannelReceiver();
+ receiver.setAddress(localIP);
+ }
// Set the domain for this Node
Parameter domainParam = getParameter(ClusteringConstants.DOMAIN);
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java Sat Dec 1 06:43:28 2007
@@ -40,7 +40,7 @@
System.out.println(CodegenMessages.getMessage("wsdl2code.arg"));
System.out.println(CodegenMessages.getMessage("wsdl2code.arg1"));
- for (int i = 2; i <= 37; i++) {
+ for (int i = 2; i <= 40; i++) {
System.out.println(" " + CodegenMessages.getMessage("wsdl2code.arg" + i));
}
System.exit(0);
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=600141&r1=600140&r2=600141&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Sat Dec 1 06:43:28 2007
@@ -292,33 +292,8 @@
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
-
- Document doc;
- try {
- doc = XMLUtils.newDocument(uri);
-
- // Set the URI of the base document for the Definition.
- // This identifies the origin of the Definition
- // Note that this is the URI of the base document, not the imports.
- Definition def = reader.readWSDL(getBaseURI(uri), doc);
- def.setDocumentBaseURI(getURI(uri));
-
- return def;
-
- } catch (ParserConfigurationException e) {
- throw new WSDLException(WSDLException.PARSER_ERROR,
- "Parser Configuration Error",
- e);
- } catch (SAXException e) {
- throw new WSDLException(WSDLException.PARSER_ERROR,
- "Parser SAX Error",
- e);
-
- } catch (IOException e) {
- throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e);
- } catch (URISyntaxException e) {
- throw new WSDLException(WSDLException.OTHER_ERROR, "URI Syntax Error", e);
- }
+ return reader.readWSDL(uri);
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org