antelder 2002/06/25 01:38:58
Modified: java/src/org/apache/wsif/providers/jms
WSIFOperation_Jms.java
Log:
Fix native JMS provider to recognize JMS properties in the input message parts
Revision Changes Path
1.8 +32 -38
xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java
Index: WSIFOperation_Jms.java
===================================================================
RCS file:
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- WSIFOperation_Jms.java 24 Jun 2002 13:11:19 -0000 1.7
+++ WSIFOperation_Jms.java 25 Jun 2002 08:38:58 -0000 1.8
@@ -114,7 +114,7 @@
// input message
protected String fieldInputMessageName;
protected HashMap fieldInputJmsPropertyValues;
- protected JMSProperty fieldInputProperty;
+ protected HashMap fieldInputJmsProperties;
protected JMSInput fieldInput;
// output message
@@ -407,32 +407,11 @@
// properties from the context
setDestinationContext( jmsDest );
- if (fieldInputProperty != null) {
- String messageQName = fieldInputProperty.getName();
-
- javax.wsdl.Message contextMessage = null;
- //?? if (messageQName != null)
- //?? contextMessage =
fieldJmsPort.getDefinition().getMessage(messageQName);
-
- // Currently, message references only supported if it is the input
WSIFMessage
- if (contextMessage != null) {
- //Iterator is either the parts of the referenced message or the
parts indicated in jms:Property
- // Since cannot reference external message (other than input), the
iterator must come from the parts
- // indicated in jms:property
- /*
- Iterator i = contextMessage.getParts().keySet().iterator();
- if (fieldInputProperty.getParts() != null &&
!fieldInputProperty.getParts().isEmpty())
- i = fieldInputProperty.getParts().iterator();
- */
- String partName = fieldInputProperty.getPart();
- jmsDest.setProperty(partName, input.getObjectPart(partName));
- }
- }
-
/**
* set the parts onto the message
*/
+/* TODO - I don't know what this code was trying to do???
WSIFMessage message = input;
if (fieldInput != null && !fieldInput.getParts().isEmpty()) {
message = createInputMessage();
@@ -442,6 +421,20 @@
message.setObjectPart(partName, input.getObjectPart(partName));
}
};
+*/
+ // extract the JMS properties from the input message
+ String partName;
+ WSIFMessage message = createInputMessage();
+ for (Iterator i = input.getPartNames(); i.hasNext(); ) {
+ partName = (String)i.next();
+ if ( fieldInputJmsProperties.containsKey( partName ) ) {
+ jmsDest.setProperty(
+ (String)fieldInputJmsProperties.get( partName ),
+ input.getObjectPart(partName) );
+ } else {
+ message.setObjectPart(partName, input.getObjectPart(partName));
+ }
+ }
Service serviceModel = null;
for (Iterator i =
@@ -586,20 +579,21 @@
// Jms extensions on Input
//
if (fieldBindingOperation.getBindingInput() != null) {
- Iterator inputIterator =
-
fieldBindingOperation.getBindingInput().getExtensibilityElements().iterator();
- fieldInputJmsPropertyValues = new HashMap();
- while (inputIterator.hasNext()) {
- ExtensibilityElement ele = (ExtensibilityElement)
inputIterator.next();
- if (ele instanceof JMSInput) {
- fieldInput = (JMSInput) ele;
- } else if (ele instanceof JMSProperty) {
- fieldInputProperty = (JMSProperty) ele;
- } else if (ele instanceof JMSPropertyValue) {
- fieldInputJmsPropertyValues.put(((JMSPropertyValue)
ele).getName(), ele);
- }
- }
-
+ Iterator inputIterator =
+
fieldBindingOperation.getBindingInput().getExtensibilityElements().iterator();
+ fieldInputJmsProperties = new HashMap();
+ fieldInputJmsPropertyValues = new HashMap();
+ while (inputIterator.hasNext()) {
+ ExtensibilityElement ele = (ExtensibilityElement)
inputIterator.next();
+ if (ele instanceof JMSInput) {
+ fieldInput = (JMSInput) ele;
+ } else if (ele instanceof JMSProperty) {
+ fieldInputJmsProperties.put(
+ ((JMSProperty)ele).getPart(), ((JMSProperty)ele).getName()
);
+ } else if (ele instanceof JMSPropertyValue) {
+
fieldInputJmsPropertyValues.put(((JMSPropertyValue)ele).getName(), ele);
+ }
+ }
}
// output message parts
@@ -750,7 +744,7 @@
buff += " JmsMessageType:" + getJMSMessageType();
buff += " inputMessageName:" + fieldInputMessageName;
buff += " InputJmsPropertyValues:" + fieldInputJmsPropertyValues;
- buff += " InputProperty:" + fieldInputProperty;
+ buff += " InputProperty:" + fieldInputJmsProperties;
buff += " Input:" + fieldInput;
buff += " outputMessageName:" + fieldOutputMessageName;
buff += " OutputProperty:" + fieldOutputProperty;