From 417155109a8817c1ac9dbac34e6539a3f336fc8f Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 17 Aug 2008 06:34:57 +0000 Subject: Added support for partnerLinkType/role/portType elements. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@686586 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/interfacedef/wsdl/xml/BPELExtensionHandler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'java/sca/modules') 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; -- cgit v1.2.3