summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;