summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-08-17 06:34:57 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-08-17 06:34:57 +0000
commit417155109a8817c1ac9dbac34e6539a3f336fc8f (patch)
treeb3c4d45d359147943cc8e47009319a9f8744829d /java/sca/modules
parent1390d26e0674ee489a93d0734fd60c9bac2757c5 (diff)
Added support for partnerLinkType/role/portType elements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@686586 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java b/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
index c34a8626f7..13203d4adc 100644
--- a/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
+++ b/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
@@ -85,7 +85,6 @@ public class BPELExtensionHandler implements ExtensionSerializer, ExtensionDeser
public ExtensibilityElement unmarshall(Class theClass, QName elementType,
Element theElement, Definition def, ExtensionRegistry extReg)
throws WSDLException {
- // System.out.println("BPELExtensionHandler unmarshall called");
// Check that this elementType really is a partnerLinkType element
if( !elementType.getLocalPart().equals(localName) ) return null;
@@ -93,15 +92,24 @@ public class BPELExtensionHandler implements ExtensionSerializer, ExtensionDeser
theExtension.setElementType(elementType);
theExtension.setName( theElement.getAttribute("name") );
- //Fetch the child "role" elements
+ // Fetch the child "role" elements
NodeList theRoles = theElement.getElementsByTagNameNS("*", roleName);
for ( int i=0; i < theRoles.getLength(); i++ ) {
if( i > 1 ) break;
Element roleNode = (Element)theRoles.item(i);
String roleName = roleNode.getAttribute("name");
String portType = roleNode.getAttribute("portType");
- // The PortType attribute is a QName in prefix:localName format - convert to a QName
- QName rolePortType = getQNameValue( def, portType );
+ if (portType == null || portType.length() == 0) {
+ // Fetch the child "portType" element
+ NodeList portTypesNodes = roleNode.getElementsByTagNameNS("*", "portType");
+ for (int p = 0; p < portTypesNodes.getLength(); p++) {
+ Element portTypeNode = (Element)portTypesNodes.item(p);
+ portType = portTypeNode.getAttribute("name");
+ break;
+ }
+ }
+ // The PortType attribute is a QName in prefix:localName format - convert to a QName
+ QName rolePortType = getQNameValue( def, portType );
theExtension.setRole( i, roleName, rolePortType );
} // end for
return theExtension;