You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2009/08/17 14:37:51 UTC

svn commit: r804954 - in /tuscany/java/sca/modules/interface-wsdl/src/main: java/org/apache/tuscany/sca/interfacedef/wsdl/ java/org/apache/tuscany/sca/interfacedef/wsdl/impl/ java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ resources/

Author: edwardsmj
Date: Mon Aug 17 12:37:50 2009
New Revision: 804954

URL: http://svn.apache.org/viewvc?rev=804954&view=rev
Log:
Changes to enable interface.wsdl to process WSDL portTypes which have @callback annotations, as required by BPEL callback testcases described in TUSCANY-3203

Modified:
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
    tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
    tuscany/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java Mon Aug 17 12:37:50 2009
@@ -18,8 +18,9 @@
  */
 package org.apache.tuscany.sca.interfacedef.wsdl;
 
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLFactoryImpl;
+import org.apache.tuscany.sca.monitor.Monitor;
 
 /**
  * A factory for the WSDL model.
@@ -28,8 +29,8 @@
  */
 public class DefaultWSDLFactory extends WSDLFactoryImpl implements WSDLFactory {
 
-    public DefaultWSDLFactory(FactoryExtensionPoint modelFactories) {
-        super(modelFactories);
+    public DefaultWSDLFactory(ExtensionPointRegistry registry) {
+        super(registry);
     }
 
 }

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java Mon Aug 17 12:37:50 2009
@@ -59,6 +59,18 @@
      * @param portType the WSDL interface portType
      */
     void setPortType(PortType portType);
+    
+    /**
+     * Gets the Interface of the Callback for this WSDL interface
+     * @return the WSDLInterface of the Callback, null if there is no Callback
+     */
+    WSDLInterface getCallbackInterface();
+    
+    /**
+     * Sets the interface of the Callback for this WSDL interface
+     * @param callback - the WSDLInterface of the Callback
+     */
+    void setCallbackInterface(WSDLInterface callback);
 
     WSDLDefinition getWsdlDefinition();
 

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java Mon Aug 17 12:37:50 2009
@@ -21,12 +21,16 @@
 import javax.wsdl.PortType;
 
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
 
 /**
  * A factory for the WSDL model.
@@ -37,9 +41,15 @@
     
     private WSDLInterfaceIntrospectorImpl introspector;
     
-    public WSDLFactoryImpl(FactoryExtensionPoint modelFactories) {
-        introspector = new WSDLInterfaceIntrospectorImpl(modelFactories);
-    }
+    public WSDLFactoryImpl(ExtensionPointRegistry registry) {
+        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+
+        Monitor monitor = monitorFactory.createMonitor();
+
+        introspector = new WSDLInterfaceIntrospectorImpl(modelFactories, this, monitor);
+    } // end constructor WSDLFactoryImpl(ExtensionPointRegistry registry)
 
     public WSDLInterface createWSDLInterface() {
         return new WSDLInterfaceImpl();

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java Mon Aug 17 12:37:50 2009
@@ -32,9 +32,10 @@
  */
 public class WSDLInterfaceImpl extends InterfaceImpl implements WSDLInterface {
 
-    private QName name;
-    private PortType portType;
-    private WSDLDefinition wsdlDefinition;
+    private QName 			name;
+    private PortType 		portType;
+    private WSDLInterface	callbackInterface = null;    
+    private WSDLDefinition 	wsdlDefinition;
 
     protected WSDLInterfaceImpl() {
         setRemotable(true);
@@ -112,4 +113,12 @@
         return true;
     }
 
-}
+	public WSDLInterface getCallbackInterface() {
+		return callbackInterface;
+	}
+
+	public void setCallbackInterface(WSDLInterface theInterface) {
+		callbackInterface = theInterface;	
+	}
+
+} // end class WSDLInterfaceImpl

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java Mon Aug 17 12:37:50 2009
@@ -32,7 +32,10 @@
 import org.apache.tuscany.sca.interfacedef.ConversationSequence;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLInterfaceProcessor;
+import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicyFactory;
 import org.apache.tuscany.sca.xsd.XSDFactory;
@@ -43,16 +46,22 @@
  * @version $Rev$ $Date$
  */
 public class WSDLInterfaceIntrospectorImpl {
-    private static final QName POLICY_REQUIRES = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "requires");
-    private static final QName POLICY_CONVERSATIONAL = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "conversational");
-    public static final QName POLICY_END_CONVERSATION = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "endsConversation");
+    private static final QName POLICY_REQUIRES 			= new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "requires");
+    private static final QName POLICY_CONVERSATIONAL 	= new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "conversational");
+    public  static final QName POLICY_END_CONVERSATION 	= new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "endsConversation");
     
+    private static final QName CALLBACK_ATTRIBUTE 		= new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "callback" );
+    
+    private WSDLFactory wsdlFactory;
     private XSDFactory xsdFactory;
     private PolicyFactory policyFactory;
+    private Monitor monitor;
     
-    public WSDLInterfaceIntrospectorImpl(FactoryExtensionPoint modelFactories) {
-        this.xsdFactory = modelFactories.getFactory(XSDFactory.class);;
-        this.policyFactory = modelFactories.getFactory(PolicyFactory.class);;
+    public WSDLInterfaceIntrospectorImpl(FactoryExtensionPoint modelFactories, WSDLFactory wsdlFactory, Monitor monitor) {
+        this.xsdFactory = modelFactories.getFactory(XSDFactory.class);
+        this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
+        this.wsdlFactory = wsdlFactory;
+        this.monitor = monitor;
     }
 
     // FIXME: Do we want to deal with document-literal wrapped style based on the JAX-WS Specification?
@@ -71,7 +80,9 @@
 
     public void introspectPortType(WSDLInterface wsdlInterface, PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver) throws InvalidWSDLException {
         processIntents(wsdlInterface, portType);
+        WSDLInterface callback = processCallbackAttribute( portType, resolver );
         wsdlInterface.setPortType(portType);
+        wsdlInterface.setCallbackInterface(callback);
         wsdlInterface.getOperations().addAll(introspectOperations(portType, wsdlDefinition, resolver));
         wsdlInterface.setConversational(isConversational(portType));
     }
@@ -84,6 +95,26 @@
         return op.getOperation();
     }
     
+    /**
+     * Process an extension @callback attribute on a WSDL portType declaration
+     * - the callback attribute must contain the QName of another portType
+     * @param portType the portType
+     * @return
+     */
+    private WSDLInterface processCallbackAttribute( PortType portType, ModelResolver resolver ) {
+        Object o =  portType.getExtensionAttribute(CALLBACK_ATTRIBUTE);
+        if(o != null && o instanceof QName) { 
+        	WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
+        	wsdlInterface.setUnresolved(true);
+        	wsdlInterface.setName( (QName)o );
+        	wsdlInterface = WSDLInterfaceProcessor.resolveWSDLInterface( wsdlInterface, resolver, monitor, wsdlFactory );
+        	
+        	return wsdlInterface;
+        } else {
+        	return null;
+        } // end if 
+    } // end method processCallbackAttribute
+    
     private void processIntents(WSDLInterface wsdlInterface, PortType portType) {
         Object o;
         try {

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java Mon Aug 17 12:37:50 2009
@@ -32,7 +32,10 @@
 import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
@@ -44,19 +47,28 @@
 import org.apache.tuscany.sca.monitor.Problem.Severity;
 
 /**
- *
+ * Handles a <interface.wsdl ... /> element in a SCDL file
  * @version $Rev$ $Date$
  */
 public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants {
 
     private WSDLFactory wsdlFactory;
     private Monitor monitor;
+    private InterfaceContractMapper interfaceContractMapper;
 
-    public WSDLInterfaceProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+//    public WSDLInterfaceProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+//        this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
+//        this.monitor = monitor;
+//    }
+    
+    public WSDLInterfaceProcessor(ExtensionPointRegistry registry, Monitor monitor) {
+        FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+        this.interfaceContractMapper =
+            registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(InterfaceContractMapper.class);
+        
         this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
         this.monitor = monitor;
     }
-    
     /**
      * Report a warning.
      * 
@@ -259,7 +271,7 @@
                         			                                                            portType.toString(), e);
                         	error("ContributionResolveException", wsdlFactory, ce);
                             //throw ce;
-                        }                        
+                        } // end try                      
                     }
                     else {
                     	warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
@@ -269,21 +281,99 @@
                 	ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " + 
                 			wsdlInterface.getName() );
                     error("ContributionResolveException", wsdlFactory, ce);
-                }// end if
+                } // end if
             } // end if
         } // end if
         return wsdlInterface;
     }
     
+    public static WSDLInterface resolveWSDLInterface( WSDLInterface wsdlInterface, ModelResolver resolver, 
+    		                                   Monitor monitor, WSDLFactory wsdlFactory) {
+        if (wsdlInterface != null && wsdlInterface.isUnresolved()) {
+
+            // Resolve the WSDL interface
+            wsdlInterface = resolver.resolveModel(WSDLInterface.class, wsdlInterface);
+            if (wsdlInterface.isUnresolved()) {
+
+                // If the WSDL interface has never been resolved yet, do it now
+                // First, resolve the WSDL definition for the given namespace
+                WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
+                wsdlDefinition.setUnresolved(true);
+                wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI());
+                WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
+                if (!resolved.isUnresolved()) {
+                    wsdlDefinition.setDefinition(resolved.getDefinition());
+                    wsdlDefinition.setLocation(resolved.getLocation());
+                    wsdlDefinition.setURI(resolved.getURI());
+                    wsdlDefinition.getImportedDefinitions().addAll(resolved.getImportedDefinitions());
+                    wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas());
+                    wsdlDefinition.setUnresolved(false);
+                    WSDLObject<PortType> portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName());
+                    if (portType != null) {                        
+                        // Introspect the WSDL portType and add the resulting
+                        // WSDLInterface to the resolver
+                        try {
+                            wsdlDefinition.setDefinition(portType.getDefinition());
+                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
+                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
+                            resolver.addModel(wsdlInterface);
+                        } catch (InvalidInterfaceException e) {
+                        	ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " + 
+                        			                                                            portType.toString(), e);
+                        	Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(), 
+                        			"interface-wsdlxml-validation-messages", "ContributionResolveException", 
+                        			wsdlFactory.getClass().getName(), ce.getMessage());
+                            //throw ce;
+                        } // end try                      
+                    }
+                    else {
+                    	Monitor.warning(monitor, WSDLInterfaceProcessor.class.getName(),
+                    			"interface-wsdlxml-validation-messages", "WsdlInterfaceDoesNotMatch", 
+                    			wsdlDefinition.getNamespace(), wsdlInterface.getName().toString() );
+                    } // end if
+                } else {
+                	// If we get here, the WSDLDefinition is unresolved...
+                	ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " + 
+                			wsdlInterface.getName() );
+                    Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(), 
+                			"interface-wsdlxml-validation-messages", "ContributionResolveException", 
+                			wsdlFactory.getClass().getName(), ce.getMessage());
+                } // end if
+            } // end if
+        } // end if
+        return wsdlInterface;    	
+    } // end method resolveWSDLInterface
+    
+    /**
+     * Resolve a WSDLInterfaceContract
+     */
     public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
         
         // Resolve the interface and callback interface
         WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver);
         wsdlInterfaceContract.setInterface(wsdlInterface);
         
+        // The forward interface (portType) may have a callback interface declared on it using an sca:callback attribute
+        WSDLInterface intrinsicWSDLCallbackInterface = wsdlInterface.getCallbackInterface();
+        
+        // There may be a callback interface explicitly declared on the <interface.wsdl .../> element
         WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver);
-        wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
-    }
+        if( intrinsicWSDLCallbackInterface != null ) {
+        	if( wsdlCallbackInterface != null ) {
+        		// If there is both a callback interface declared on the forward interface and also one declared on the
+        		// interface.wsdl element, then the two interfaces must match [ASM80011]
+        		if( !interfaceContractMapper.isEqual(intrinsicWSDLCallbackInterface, wsdlCallbackInterface) ) {
+                    Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(), 
+                			"interface-wsdlxml-validation-messages", "IncompatibleCallbacks", 
+                			intrinsicWSDLCallbackInterface.getName().toString(), 
+                			wsdlCallbackInterface.getName().toString() );
+        		} // end if
+        	} // end if
+        	wsdlInterfaceContract.setCallbackInterface(intrinsicWSDLCallbackInterface);
+        } else {
+        	wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
+        } // end if
+    } // end method resolve( WSDLInterfaceContract, ModelResolver)
     
     public QName getArtifactType() {
         return WSDLConstants.INTERFACE_WSDL_QNAME;

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java Mon Aug 17 12:37:50 2009
@@ -93,18 +93,19 @@
     public static final List<QName> XSD_QNAME_LIST =
         Arrays.asList(new QName[] {Q_ELEM_XSD_1999, Q_ELEM_XSD_2000, Q_ELEM_XSD_2001});
     
-    // ---- Policy WSDL Attachments
-    
+    // ---- SCA Policy WSDL Attachments    
     public static final QName Q_POLICY_ATTRIBUTE_EXTENSION = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "requires");
     public static final QName Q_POLICY_END_CONVERSATION_ATTRIBUTE_EXTENSION = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "endsConversation");
+    // ---- SCA Callback WSDL Extension
+    public static final QName Q_CALLBACK_ATTRIBUTE_EXTENSION = new QName("http://docs.oasis-open.org/ns/opencsa/sca/200903", "callback" );
     
-    // ---- Stuff added for BPEL extension elements ---  Mike Edwards 01/05/2008
+    // ---- BPEL extension elements ---  Mike Edwards 01/05/2008
     public static final String ELEM_PLINKTYPE = "partnerLinkType";
     public static final String NS_BPEL_1_1 = "http://schemas.xmlsoap.org/ws/2004/03/partner-link/";
     public static final QName BPEL_PLINKTYPE = new QName( NS_BPEL_1_1, ELEM_PLINKTYPE );
     public static final String NS_BPEL_2_0 = "http://docs.oasis-open.org/wsbpel/2.0/plnktype";
     public static final QName BPEL_PLINKTYPE_2_0 = new QName( NS_BPEL_2_0, ELEM_PLINKTYPE );
-    // ---- end of BPEL extension stuff
+    // ---- end of BPEL extension elements
 
     private Contribution contribution;
     private Map<String, List<WSDLDefinition>> map = new HashMap<String, List<WSDLDefinition>>();
@@ -136,6 +137,7 @@
         try {
             wsdlExtensionRegistry.registerExtensionAttributeType(PortType.class, Q_POLICY_ATTRIBUTE_EXTENSION, AttributeExtensible.LIST_OF_QNAMES_TYPE);
             wsdlExtensionRegistry.registerExtensionAttributeType(Operation.class, Q_POLICY_END_CONVERSATION_ATTRIBUTE_EXTENSION, AttributeExtensible.STRING_TYPE);
+            wsdlExtensionRegistry.registerExtensionAttributeType(PortType.class, Q_CALLBACK_ATTRIBUTE_EXTENSION, AttributeExtensible.QNAME_TYPE);
         } catch (NoSuchMethodError e) {
             // That method does not exist on older WSDL4J levels
         }
@@ -256,7 +258,8 @@
      * @param definitions A list of the WSDL definitions under the same target namespace
      * @return The aggregated WSDL definition
      */
-    private WSDLDefinition aggregate(List<WSDLDefinition> definitions) {
+    @SuppressWarnings("unchecked")
+	private WSDLDefinition aggregate(List<WSDLDefinition> definitions) {
         if (definitions == null || definitions.size() == 0) {
             return null;
         }
@@ -283,6 +286,11 @@
                 facade.addImport(imp);
                 aggregated.getXmlSchemas().addAll(d.getXmlSchemas());
                 aggregated.getImportedDefinitions().add(d);
+                // Deal with extensibility elements in the imported Definitions...
+                List<ExtensibilityElement> extElements = (List<ExtensibilityElement>) d.getDefinition().getExtensibilityElements();
+                for( ExtensibilityElement extElement : extElements ) {
+                	facade.addExtensibilityElement(extElement);
+                } // end for
             }
         }
         aggregated.setDefinition(facade);

Modified: tuscany/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties?rev=804954&r1=804953&r2=804954&view=diff
==============================================================================
--- tuscany/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties (original)
+++ tuscany/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties Mon Aug 17 12:37:50 2009
@@ -22,4 +22,5 @@
 ContributionResolveException = ContributionResolveException occured due to : {0}
 InvalidWSDLInterfaceAttr = Invalid WSDL interface attribute: {0}
 WsdlInterfaceDoesNotMatch = The WSDL referenced by the interface.wsdl interface as ({0}) cannot be found in this contribution or in any imports that this contribution makes
-InvalidRemotableValue = The interface.wsdl interface {0} element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: {1}.
\ No newline at end of file
+InvalidRemotableValue = The interface.wsdl interface {0} element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: {1}.
+IncompatibleCallbacks = The interface.wsdl element has a forward interface with a callback declared in the WSDL {0} and a callback interface also declared using the callbackInterface attribute {1} but the callback interfaces are not equal.
\ No newline at end of file