summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/interface-wsdl/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/interface-wsdl/src')
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java7
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java12
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java16
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java17
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java43
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java104
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java18
-rw-r--r--java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties3
8 files changed, 191 insertions, 29 deletions
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
index 8d571a4404..f5cf8b3dc8 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java
@@ -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 @@ import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLFactoryImpl;
*/
public class DefaultWSDLFactory extends WSDLFactoryImpl implements WSDLFactory {
- public DefaultWSDLFactory(FactoryExtensionPoint modelFactories) {
- super(modelFactories);
+ public DefaultWSDLFactory(ExtensionPointRegistry registry) {
+ super(registry);
}
}
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
index c0da060af2..90f846b2fc 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java
@@ -59,6 +59,18 @@ public interface WSDLInterface extends Interface, Base {
* @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();
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
index 883b6b1567..e73edb5276 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java
@@ -21,12 +21,16 @@ package org.apache.tuscany.sca.interfacedef.wsdl.impl;
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 @@ public abstract class WSDLFactoryImpl implements WSDLFactory {
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();
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
index e8379ee56b..95906f4a56 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java
@@ -32,9 +32,10 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
*/
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 @@ public class WSDLInterfaceImpl extends InterfaceImpl implements WSDLInterface {
return true;
}
-}
+ public WSDLInterface getCallbackInterface() {
+ return callbackInterface;
+ }
+
+ public void setCallbackInterface(WSDLInterface theInterface) {
+ callbackInterface = theInterface;
+ }
+
+} // end class WSDLInterfaceImpl
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
index abc1a00398..343703a6d1 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
@@ -32,7 +32,10 @@ import org.apache.tuscany.sca.core.FactoryExtensionPoint;
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 @@ import org.apache.tuscany.sca.xsd.XSDFactory;
* @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 class WSDLInterfaceIntrospectorImpl {
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 @@ public class WSDLInterfaceIntrospectorImpl {
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 {
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
index edc005e059..77565f0ae9 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
@@ -32,7 +32,10 @@ import org.apache.tuscany.sca.contribution.processor.ContributionResolveExceptio
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;
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 @@ public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfa
portType.toString(), e);
error("ContributionResolveException", wsdlFactory, ce);
//throw ce;
- }
+ } // end try
}
else {
warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
@@ -269,21 +281,99 @@ public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfa
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;
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
index e925e815fa..d7c933eecc 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
@@ -93,18 +93,19 @@ public class WSDLModelResolver implements ModelResolver {
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 @@ public class WSDLModelResolver implements ModelResolver {
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 @@ public class WSDLModelResolver implements ModelResolver {
* @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 @@ public class WSDLModelResolver implements ModelResolver {
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);
diff --git a/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties b/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
index 010da508e7..11756711be 100644
--- a/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
+++ b/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
@@ -22,4 +22,5 @@ ContributionReadException = ContributionReadException occured due to : {0}
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