airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1196275 - /incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
Date Tue, 01 Nov 2011 21:08:47 GMT
Author: lahiru
Date: Tue Nov  1 21:08:47 2011
New Revision: 1196275

URL: http://svn.apache.org/viewvc?rev=1196275&view=rev
Log:
fixing minor issue with multiple nodes.

Modified:
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java?rev=1196275&r1=1196274&r2=1196275&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
Tue Nov  1 21:08:47 2011
@@ -31,6 +31,7 @@ import javax.xml.stream.XMLStreamExcepti
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.airavata.commons.gfac.type.ActualParameter;
+import org.apache.airavata.commons.gfac.type.MappingFactory;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
 import org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
 import org.apache.airavata.core.gfac.context.invocation.impl.DefaultInvocationContext;
@@ -178,11 +179,23 @@ public class GFacMessageReciever impleme
 
 
             for (Parameter parameter : serviceDescriptionType.getInputParametersArray())
{
-                OMElement element = input.getFirstChildWithName(new QName(parameter.getParameterName()));
-
+                Iterator childrenWithLocalName = input.getChildrenWithLocalName(parameter.getParameterName());
+                OMElement element = (OMElement)childrenWithLocalName.next();
                 if (element == null) {
                     throw new Exception("Parameter is not found in the message");
                 }
+                //todo this implementation doesn't work when there are n number of nodes
connecting .. need to fix
+//                String xmlContent = "";
+//                if(!element.getChildElements().hasNext()){
+//                    xmlContent = "<type:GFacParameter xsi:type=\"type:" + MappingFactory.getActualParameterType(parameter.getParameterType().getType())
+//                        +"\" xmlns:type=\"http://schemas.airavata.apache.org/gfac/type\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" + element.getText() + "</type:GFacParameter>";
+//                }else{
+//                    xmlContent = "<type:GFacParameter xsi:type=\"type:" + MappingFactory.getActualParameterType(parameter.getParameterType().getType())
+//                            +"\" xmlns:type=\"http://schemas.airavata.apache.org/gfac/type\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" + element.toStringWithConsume()
+ "</type:GFacParameter>";
+//                }
+//                System.out.println(xmlContent);
+//                inputParam.add(parameter.getParameterName(),ActualParameter.fromXML(xmlContent));
+
                 ActualParameter actualParameter = new ActualParameter();
                 if("String".equals(parameter.getParameterType().getName())){
                                  ((StringParameterType)actualParameter.getType()).setValue(element.getText());
@@ -209,7 +222,6 @@ public class GFacMessageReciever impleme
                 }else if("FileArray".equals(parameter.getParameterType().getName())){
                     //todo ((DoubleParameterType)actualParameter.getType()).setValue(new
Double(element.getText()));
                 }
-//                inputParam.add(parameter.getParameterName(),ActualParameter.fromParameterXml(element.toStringWithConsume()));
                 inputParam.add(parameter.getParameterName(),actualParameter);
             }
 



Mime
View raw message