You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2008/01/07 18:36:43 UTC
svn commit: r609714 [3/8] - in /webservices/woden/branches/woden65: ./
ant-test/ src/org/apache/woden/ src/org/apache/woden/ant/
src/org/apache/woden/internal/ src/org/apache/woden/internal/resolver/
src/org/apache/woden/internal/util/dom/ src/org/apac...
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/util/om/OMUtils.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/util/om/OMUtils.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/util/om/OMUtils.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/util/om/OMUtils.java Mon Jan 7 09:36:13 2008
@@ -24,17 +24,11 @@
import java.net.URL;
import java.util.Iterator;
-import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.woden.ErrorReporter;
-import org.apache.woden.WSDLException;
-import org.apache.woden.internal.ErrorLocatorImpl;
-import org.apache.woden.internal.ErrorReporterImpl;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
import org.xml.sax.InputSource;
/**
@@ -48,21 +42,15 @@
* @return A StAXOMBuilder which could be used in obtaining the document object
* @throws IOException
*/
- public static StAXOMBuilder getOMBuilder(String strUri) throws IOException {
+ public static StAXOMBuilder getOMBuilder(String strUri) throws IOException, URISyntaxException, XMLStreamException {
StAXOMBuilder builder = null;
- try {
- URI uri = new URI(strUri);
- URL url = uri.toURL();
-
- InputStream in = url.openStream();
- builder = new StAXOMBuilder(in);
-// } catch (IOException e) {
-// e.printStackTrace();
- } catch (XMLStreamException e) {
- e.printStackTrace();
- } catch (URISyntaxException e) {
- e.printStackTrace();
- }
+
+ URI uri = new URI(strUri);
+ URL url = uri.toURL();
+
+ InputStream in = url.openStream();
+ builder = new StAXOMBuilder(in);
+
return builder;
}
@@ -73,7 +61,7 @@
* @return an OMElement representing the document just read
* @throws IOException
*/
- public static OMElement getElement(String uri) throws IOException {
+ public static OMElement getElement(String uri) throws IOException, URISyntaxException, XMLStreamException {
StAXOMBuilder builder = OMUtils.getOMBuilder(uri);
return builder == null ? null : builder.getDocumentElement();
}
@@ -119,93 +107,5 @@
return new InputSource(inputStream);
}
-
- /**
- * @param prefixedValue to which the QName is prefixed
- * @param contextEl Element in which the QName is sought for
- * @return The relevant QName for the prefix
- * @throws WSDLException
- */
- public static QName getQName(String prefixedValue,
- OMElement contextEl)
- throws WSDLException{
- int index = prefixedValue.indexOf(':');
- String prefix = (index != -1)
- ? prefixedValue.substring(0, index)
- : null;
- String localPart = prefixedValue.substring(index + 1);
- String namespaceURI;
-
- if (prefix != null){
- namespaceURI = contextEl.findNamespaceURI(prefix).getNamespaceURI();
- //TODO investigate changing the registration of namespaces and prefixes (i.e. namespace decls)
- //so it can happen within any WSDL element, not just Description (current behaviour is copied from WSDL4J)
- //registerUniquePrefix(prefix, namespaceURI, desc);
-
- //TODO when passing prefix to QName ctor, what if it was modified by
- //registerUniquePrefix because of a name clash (pass original or modification)?
- return new QName(namespaceURI, localPart, prefix);
- }
- else{
- //TODO use ErrorReporter here or in callers to report the problem
-
- String faultCode = WSDLException.NO_PREFIX_SPECIFIED;
-
- throw new WSDLException(faultCode,
- "Unable to determine " +
- "namespace of '" +
- prefixedValue + "'.");
- }
- }
-
- /**
- * @param el Element whose attrib is looked for
- * @param namespaceURI namespace URI of attribute to look for
- * @param localPart local part of attribute to look for
- * @return the attribute value
- */
- static public String getAttributeNS (OMElement el,
- String namespaceURI,
- String localPart) {
- String sRet = null;
- OMAttribute attr = el.getAttribute(new QName(namespaceURI, localPart));
- if (attr != null) {
- sRet = attr.getAttributeValue();
- }
- return sRet;
- }
-
-
- /*This is the same method taken from DOMUtils*/
- public static void registerUniquePrefix(String prefix, String namespaceURI, DescriptionElement desc)
- throws WSDLException {
- URI nsUri = desc.getNamespace(prefix);
- String tempNSUri = nsUri != null ? nsUri.toString() : null;
-
- if (tempNSUri != null && tempNSUri.equals(namespaceURI)){
- return;
- }
-
- while (tempNSUri != null && !tempNSUri.equals(namespaceURI)){
- prefix += "_";
- nsUri = desc.getNamespace(prefix);
- tempNSUri = nsUri != null ? nsUri.toString() : null;
- }
-
- URI uri = null;
- try {
- uri = new URI(namespaceURI);
- } catch (URISyntaxException e) {
- //TODO make sure custom err handler is used, if configured
- new ErrorReporterImpl().reportError(
- new ErrorLocatorImpl(), //TODO line&col nos.
- "WSDL506",
- new Object[] {namespaceURI},
- ErrorReporter.SEVERITY_ERROR,
- e);
- }
- desc.addNamespace(prefix, uri);
- }
-}
-
-
+
+}
\ No newline at end of file
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/BindingMessageReferenceImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/BindingMessageReferenceImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/BindingMessageReferenceImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/BindingMessageReferenceImpl.java Mon Jan 7 09:36:13 2008
@@ -16,19 +16,21 @@
*/
package org.apache.woden.internal.wsdl20;
-import org.apache.woden.types.NCName;
import javax.xml.namespace.QName;
+import org.apache.woden.types.NCName;
+import org.apache.woden.wsdl20.Binding;
import org.apache.woden.wsdl20.BindingMessageReference;
import org.apache.woden.wsdl20.BindingOperation;
-import org.apache.woden.wsdl20.Binding;
import org.apache.woden.wsdl20.InterfaceMessageReference;
import org.apache.woden.wsdl20.InterfaceOperation;
import org.apache.woden.wsdl20.enumeration.Direction;
-import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
-
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
import org.apache.woden.wsdl20.fragids.BindingMessageReferencePart;
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingOperationElement;
+import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
/**
* This class represents the BindingMessageReference component of the
* WSDL 2.0 Component model and the <input> and <output>
@@ -61,9 +63,6 @@
* The code in this method currently just supports the first type of "effective" message label,
* where the message label property IS present in the binding msg reference.
*
- * TODO effective message label based on message exchange pattern placeholder message,
- * where the message label property IS NOT present in the binding message reference.
- *
*/
public InterfaceMessageReference getInterfaceMessageReference()
{
@@ -80,7 +79,7 @@
}
else
{
- //implement placeholder effective msg label, as per the todo comment above
+ //TODO implement placeholder effective msg label, as per Part 1 of spec section 2.10.3
}
//Now match the effective msg label against the msg label of an interface msg reference.
@@ -137,6 +136,43 @@
*/
public NCName getMessageLabel() {
return fMessageLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.BindingMessageReferenceElement#getInterfaceMessageReferenceElement()
+ */
+ public InterfaceMessageReferenceElement getInterfaceMessageReferenceElement() {
+ InterfaceMessageReferenceElement intMsgRef = null;
+ BindingOperationElement bindOp = (BindingOperationElement)getParentElement();
+ InterfaceOperationElement intOp = bindOp.getInterfaceOperationElement();
+ if(intOp != null)
+ {
+ //Determine the "effective" msg label for this binding msg ref.
+ NCName effectiveMsgLabel = null;
+ if(fMessageLabel != null)
+ {
+ effectiveMsgLabel = fMessageLabel;
+ }
+ else
+ {
+ //TODO: implement placeholder effective msg label, as per Part 1 of spec section 2.10.3
+ }
+
+ //Now match the effective msg label against the msg label of an interface msg reference.
+ if(effectiveMsgLabel != null)
+ {
+ InterfaceMessageReferenceElement[] intMsgRefs = intOp.getInterfaceMessageReferenceElements();
+ for(int i=0; i<intMsgRefs.length; i++)
+ {
+ if( effectiveMsgLabel.equals(intMsgRefs[i].getMessageLabel()) )
+ {
+ intMsgRef = intMsgRefs[i];
+ break;
+ }
+ }
+ }
+ }
+ return intMsgRef;
}
/*
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/ComponentModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/ComponentModelBuilder.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/ComponentModelBuilder.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/ComponentModelBuilder.java Mon Jan 7 09:36:13 2008
@@ -367,7 +367,7 @@
* Create a ComponentExtensions object for each registered extension
* namespace used within this operation by extension elements or attributes.
*/
- ExtensionRegistry er = fDesc.getWsdlContext().getExtensionRegistry();
+ ExtensionRegistry er = fDesc.getWsdlContext().extensionRegistry;
URI[] extNamespaces = er
.queryComponentExtensionNamespaces(InterfaceOperation.class);
@@ -386,12 +386,12 @@
* created, create one now.
*/
if (oper.getComponentExtensionsForNamespace(
- ComponentExtensions.URI_NS_EXTENSIONS) == null) {
+ ComponentExtensions.NS_URI_WSDL_EXTENSIONS) == null) {
ComponentExtensions compExt = createComponentExtensions(
InterfaceOperation.class, oper,
- ComponentExtensions.URI_NS_EXTENSIONS);
+ ComponentExtensions.NS_URI_WSDL_EXTENSIONS);
oper.setComponentExtensions(
- ComponentExtensions.URI_NS_EXTENSIONS, compExt);
+ ComponentExtensions.NS_URI_WSDL_EXTENSIONS, compExt);
}
/*
@@ -404,7 +404,7 @@
for(int i=0; i<style.length; i++)
{
URI temp = style[i];
- if(RPCConstants.URI_STYLE_RPC.equals(temp)) {
+ if(RPCConstants.STYLE_URI_RPC.equals(temp)) {
isRPCStyle = true;
break;
}
@@ -412,12 +412,12 @@
if(isRPCStyle) {
if (oper.getComponentExtensionsForNamespace(
- ComponentExtensions.URI_NS_RPC) == null) {
+ ComponentExtensions.NS_URI_RPC) == null) {
ComponentExtensions compExt = createComponentExtensions(
InterfaceOperation.class, oper,
- ComponentExtensions.URI_NS_RPC);
+ ComponentExtensions.NS_URI_RPC);
oper.setComponentExtensions(
- ComponentExtensions.URI_NS_RPC, compExt);
+ ComponentExtensions.NS_URI_RPC, compExt);
}
}
}
@@ -591,7 +591,7 @@
*/
private ComponentExtensions createComponentExtensions(Class parentClass,
WSDLElement parentElem, URI extNS) {
- ExtensionRegistry er = fDesc.getWsdlContext().getExtensionRegistry();
+ ExtensionRegistry er = fDesc.getWsdlContext().extensionRegistry;
ComponentExtensions compExt = null;
try {
compExt = er.createComponentExtension(parentClass, extNS);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/Constants.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/Constants.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/Constants.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/Constants.java Mon Jan 7 09:36:13 2008
@@ -29,14 +29,19 @@
*/
public class Constants
{
- // Namespace URIs.
- public static final String NS_URI_WSDL20 =
+ // Namespace Strings.
+ public static final String NS_STRING_WSDL20 =
"http://www.w3.org/ns/wsdl";
- public static final String NS_URI_XMLNS =
+ public static final String NS_STRING_XMLNS =
"http://www.w3.org/2000/xmlns/";
- public static final String NS_URI_XSI =
+ public static final String NS_STRING_XSI =
"http://www.w3.org/2001/XMLSchema-instance";
+ // Namespace URIs.
+ public static final URI NS_URI_WSDL20 = URI.create(NS_STRING_WSDL20);
+ public static final URI NS_URI_XMLNS = URI.create(NS_STRING_XMLNS);
+ public static final URI NS_URI_XSI = URI.create(NS_STRING_XSI);
+
// Top-level WSDL 2.0 element names.
public static final String ELEM_DESCRIPTION = "description";
public static final String ELEM_DOCUMENTATION = "documentation";
@@ -58,37 +63,37 @@
// Top-level WSDL 2.0 qualified element names.
public static final QName Q_ELEM_DESCRIPTION =
- new QName(NS_URI_WSDL20, ELEM_DESCRIPTION);
+ new QName(NS_STRING_WSDL20, ELEM_DESCRIPTION);
public static final QName Q_ELEM_DOCUMENTATION =
- new QName(NS_URI_WSDL20, ELEM_DOCUMENTATION);
+ new QName(NS_STRING_WSDL20, ELEM_DOCUMENTATION);
public static final QName Q_ELEM_IMPORT =
- new QName(NS_URI_WSDL20, ELEM_IMPORT);
+ new QName(NS_STRING_WSDL20, ELEM_IMPORT);
public static final QName Q_ELEM_INCLUDE =
- new QName(NS_URI_WSDL20, ELEM_INCLUDE);
+ new QName(NS_STRING_WSDL20, ELEM_INCLUDE);
public static final QName Q_ELEM_TYPES =
- new QName(NS_URI_WSDL20, ELEM_TYPES);
+ new QName(NS_STRING_WSDL20, ELEM_TYPES);
public static final QName Q_ELEM_INTERFACE =
- new QName(NS_URI_WSDL20, ELEM_INTERFACE);
+ new QName(NS_STRING_WSDL20, ELEM_INTERFACE);
public static final QName Q_ELEM_BINDING =
- new QName(NS_URI_WSDL20, ELEM_BINDING);
+ new QName(NS_STRING_WSDL20, ELEM_BINDING);
public static final QName Q_ELEM_SERVICE =
- new QName(NS_URI_WSDL20, ELEM_SERVICE);
+ new QName(NS_STRING_WSDL20, ELEM_SERVICE);
// Nested WSDL 2.0 qualified element names.
public static final QName Q_ELEM_FAULT =
- new QName(NS_URI_WSDL20, ELEM_FAULT);
+ new QName(NS_STRING_WSDL20, ELEM_FAULT);
public static final QName Q_ELEM_OPERATION =
- new QName(NS_URI_WSDL20, ELEM_OPERATION);
+ new QName(NS_STRING_WSDL20, ELEM_OPERATION);
public static final QName Q_ELEM_INPUT =
- new QName(NS_URI_WSDL20, ELEM_INPUT);
+ new QName(NS_STRING_WSDL20, ELEM_INPUT);
public static final QName Q_ELEM_OUTPUT =
- new QName(NS_URI_WSDL20, ELEM_OUTPUT);
+ new QName(NS_STRING_WSDL20, ELEM_OUTPUT);
public static final QName Q_ELEM_INFAULT =
- new QName(NS_URI_WSDL20, ELEM_INFAULT);
+ new QName(NS_STRING_WSDL20, ELEM_INFAULT);
public static final QName Q_ELEM_OUTFAULT =
- new QName(NS_URI_WSDL20, ELEM_OUTFAULT);
+ new QName(NS_STRING_WSDL20, ELEM_OUTFAULT);
public static final QName Q_ELEM_ENDPOINT =
- new QName(NS_URI_WSDL20, ELEM_ENDPOINT);
+ new QName(NS_STRING_WSDL20, ELEM_ENDPOINT);
// Attribute names.
public static final String ATTR_ID = "id";
@@ -141,64 +146,17 @@
"http://www.w3.org/2001/XMLSchema";
public static final String API_W3C_DOM =
"org.w3c.dom";
- public static final String API_W3C_XS =
- "http://www.w3.org/Submission/xmlschema-api/"; //XML Schema API implemented in Xerces
public static final String API_APACHE_WS_XS =
"org.apache.ws.commons.schema"; //Apache WS-Commons XmlSchema
- //TODO determine which lists are needed
- /*
- // Lists of native attribute names.
- public static final String[] PART_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_TYPE, ATTR_ELEMENT};
- public static final String[] BINDING_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_TYPE};
- public static final String[] BINDING_FAULT_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] BINDING_INPUT_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] BINDING_OPERATION_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] BINDING_OUTPUT_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] FAULT_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_MESSAGE};
- public static final String[] IMPORT_ATTR_NAMES =
- new String[]{ATTR_NAMESPACE, ATTR_LOCATION};
- public static final String[] INPUT_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_MESSAGE};
- public static final String[] MESSAGE_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] OPERATION_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_PARAMETER_ORDER};
- public static final String[] OUTPUT_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_MESSAGE};
- public static final String[] PORT_ATTR_NAMES =
- new String[]{ATTR_NAME, ATTR_BINDING};
- public static final String[] PORT_TYPE_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] SERVICE_ATTR_NAMES =
- new String[]{ATTR_NAME};
- public static final String[] TYPES_ATTR_NAMES =
- new String[]{};
- */
-
- //TODO determine if remaining constants are still required?
-
// Qualified attribute names.
public static final QName Q_ATTR_REQUIRED =
- new QName(NS_URI_WSDL20, ATTR_REQUIRED);
+ new QName(NS_STRING_WSDL20, ATTR_REQUIRED);
// XML Declaration string.
public static final String XML_DECL_DEFAULT = "UTF-8";
public static final String XML_DECL_START =
"<?xml version=\"1.0\" encoding=\"";
public static final String XML_DECL_END = "\"?>";
-
- // Feature names.
- // TODO org.apache and import optionality
- public static final String FEATURE_VERBOSE = "javax.wsdl.verbose";
- public static final String FEATURE_IMPORT_DOCUMENTS =
- "javax.wsdl.importDocuments";
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java Mon Jan 7 09:36:13 2008
@@ -405,33 +405,6 @@
return fTargetNamespace;
}
- public void addNamespace(String prefix, URI namespace)
- {
- String pfx = (prefix != null) ? prefix : "";
- if (namespace != null) {
- fNamespaces.put(pfx,namespace);
- } else {
- removeNamespace(pfx);
- }
- }
-
- public void removeNamespace(String prefix)
- {
- String pfx = (prefix != null) ? prefix : "";
- fNamespaces.remove(pfx);
- }
-
- public URI getNamespace(String prefix)
- {
- String pfx = (prefix != null) ? prefix : "";
- return (URI) fNamespaces.get(pfx);
- }
-
- public Map getNamespaces()
- {
- return fNamespaces;
- }
-
public ImportElement[] getImportElements()
{
ImportElement[] array = new ImportElement[fImportElements.size()];
@@ -522,20 +495,6 @@
return service;
}
- /*JKctx
- public void setExtensionRegistry(ExtensionRegistry extReg)
- {
- //method has been deprecated, to be removed pre or post M8
- fExtReg = extReg;
- }
-
- public ExtensionRegistry getExtensionRegistry()
- {
- //method has been deprecated, to be removed pre or post M8
- return fExtReg;
- }
- */
-
/*
* @see org.apache.woden.wsdl20.xml.DescriptionElement#toComponent()
*/
@@ -557,16 +516,14 @@
return fWsdlContext;
}
- //TODO make this package private (several tests use it, these must chg to correct API pgm model)
- public void addElementDeclaration(ElementDeclaration elDec)
+ void addElementDeclaration(ElementDeclaration elDec)
{
if(elDec != null) {
fAllElementDeclarations.add(elDec);
}
}
- //TODO make this package private (one test uses it, this must chg to correct API pgm model)
- public void addTypeDefinition(TypeDefinition typeDef)
+ void addTypeDefinition(TypeDefinition typeDef)
{
if(typeDef != null) {
fAllTypeDefinitions.add(typeDef);
@@ -578,6 +535,21 @@
//TODO consider moving the builder logic inside this class, maybe as an inner class.
fComponentsInitialized = true;
new ComponentModelBuilder(this);
+
+ //Ensure the top-level components (Interface, Binding, Service) refer to this object
+ //for their containing Description. The implementation of the following 3 methods
+ //will initialize this reference.
+ getInterfaces();
+ getBindings();
+ getServices();
+ }
+
+ /* This package private method is called if something in the Element model changes that necessitates
+ * a rebuild of the Component model. For example, if a schema is added to TypesElement the
+ * ElementDeclaration and TypeDefinition components need to be rebuilt.
+ */
+ void resetComponentsInitialized() {
+ fComponentsInitialized = false;
}
/*
@@ -651,20 +623,17 @@
return getTargetNamespaceAndPrefix(parent);
}
- //we have a description element
- String[] namespace = new String[] {"",""};
- URI tns = ((DescriptionElement) wElem).getTargetNamespace();
+ //We have a description element
+ DescriptionElement desc = ((DescriptionElement) wElem);
+
+ //Find its target name and prefix.
+ String[] namespace = new String[] {"", ""};
+ URI tns = desc.getTargetNamespace();
if (tns != null) {
namespace[0] = tns.toString();
- Set nsDecls = ((DescriptionElement) wElem).getNamespaces().entrySet();
- if(nsDecls != null) {
- Iterator i = nsDecls.iterator();
- while(i.hasNext()) {
- Map.Entry entry = (Map.Entry)i.next();
- if(tns.equals(entry.getValue())) {
- namespace[1] = (String)entry.getKey();
- }
- }
+ String prefix = desc.getNamespacePrefix(tns);
+ if(prefix != null) {
+ namespace[1] = prefix;
}
}
return namespace;
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java Mon Jan 7 09:36:13 2008
@@ -19,6 +19,7 @@
import javax.xml.namespace.QName;
import org.apache.woden.types.NCName;
+import org.apache.woden.types.QNameTokenUnion;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.ElementDeclaration;
import org.apache.woden.wsdl20.Interface;
@@ -47,8 +48,7 @@
private NCName fName = null;
//XML Element model data
- private String fElementAttr = null; //value of the 'element' attribute info item
- private QName fElementName = null; //present if 'element' value is of type xs:QName
+ private QNameTokenUnion fElement = null;
/* ************************************************************
* InterfaceFault methods (i.e. WSDL Component model)
@@ -72,26 +72,16 @@
* @see org.apache.woden.wsdl20.InterfaceFault#getMessageContentModel()
*/
public String getMessageContentModel() {
+ String model = Constants.NMTOKEN_OTHER;;
- //this property is derived from the 'element' attribute info item
- String messageContentModel = null;
-
- if(fElementName != null) {
- //the 'element' attribute contains an xs:QName
- messageContentModel = Constants.NMTOKEN_ELEMENT;
- }
- else if(Constants.NMTOKEN_ANY.equals(fElementAttr) ||
- Constants.NMTOKEN_NONE.equals(fElementAttr) ||
- Constants.NMTOKEN_OTHER.equals(fElementAttr) ) {
- messageContentModel = fElementAttr;
- }
- else {
- //'element' does not contain #any, #none, #other or an xs:QNname
- //so it defaults to #other
- messageContentModel = Constants.NMTOKEN_OTHER;
+ if (fElement != null) {
+ if (fElement.isQName()) {
+ model = Constants.NMTOKEN_ELEMENT;
+ } else if(fElement.isToken()) {
+ model = fElement.getToken();
+ }
}
-
- return messageContentModel;
+ return model;
}
/*
@@ -99,9 +89,14 @@
*/
public ElementDeclaration getElementDeclaration()
{
- Interface interfac = (Interface)getParent();
- Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
- return desc.getElementDeclaration(fElementName);
+ ElementDeclaration elemDecl = null;
+
+ if(fElement != null && fElement.isQName()) {
+ Interface interfac = (Interface)getParent();
+ Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
+ elemDecl = desc.getElementDeclaration(fElement.getQName());
+ }
+ return elemDecl;
}
/*
@@ -126,30 +121,32 @@
/*
* @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setElementName(QName)
*/
- public void setElementName(QName qname)
+ public void setElement(QNameTokenUnion qnameTokenUnion)
{
- fElementName = qname;
+ fElement = qnameTokenUnion;
}
/*
* @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElementName()
*/
- public QName getElementName()
+ public QNameTokenUnion getElement()
{
- return fElementName;
+ return fElement;
}
/*
* @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElement()
*/
- public XmlSchemaElement getElement()
+ public XmlSchemaElement getXmlSchemaElement()
{
XmlSchemaElement xse = null;
- InterfaceElement interfac = (InterfaceElement)getParentElement();
- DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
- TypesElement types = desc.getTypesElement();
- if(types != null) {
- xse = ((TypesImpl)types).getElementDeclaration(fElementName);
+ if (fElement != null && fElement.isQName()) {
+ InterfaceElement interfac = (InterfaceElement)getParentElement();
+ DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
+ TypesElement types = desc.getTypesElement();
+ if(types != null) {
+ xse = ((TypesImpl)types).getElementDeclaration(fElement.getQName());
+ }
}
return xse;
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/InterfaceMessageReferenceImpl.java Mon Jan 7 09:36:13 2008
@@ -16,15 +16,16 @@
*/
package org.apache.woden.internal.wsdl20;
-import javax.xml.namespace.QName;
-
import org.apache.woden.types.NCName;
+import org.apache.woden.types.QNameTokenUnion;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.ElementDeclaration;
import org.apache.woden.wsdl20.Interface;
import org.apache.woden.wsdl20.InterfaceMessageReference;
import org.apache.woden.wsdl20.InterfaceOperation;
import org.apache.woden.wsdl20.enumeration.Direction;
+import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
+import org.apache.woden.wsdl20.fragids.InterfaceMessageReferencePart;
import org.apache.woden.wsdl20.xml.DescriptionElement;
import org.apache.woden.wsdl20.xml.InterfaceElement;
import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
@@ -32,9 +33,6 @@
import org.apache.woden.wsdl20.xml.TypesElement;
import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.woden.wsdl20.fragids.FragmentIdentifier;
-import org.apache.woden.wsdl20.fragids.InterfaceMessageReferencePart;
-
/**
* This class represents the <input> and <output>
* child elements of interface operation.
@@ -48,11 +46,7 @@
//WSDL Component model data
private NCName fMessageLabel = null;
private Direction fDirection = null;
- private String fMessageContentModel = null;
-
- //XML Element model data
- private QName fElementName = null;
-
+ private QNameTokenUnion fElement = null;
/* ************************************************************
* InterfaceMessageReference methods (the WSDL Component model)
@@ -76,10 +70,18 @@
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.InterfaceMessageReference#getMessageContentModel()
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getMessageContentModel()
*/
public String getMessageContentModel() {
- return fMessageContentModel;
+ String model = Constants.NMTOKEN_OTHER;;
+
+ if (fElement != null) {
+ if (fElement.isQName()) {
+ model = Constants.NMTOKEN_ELEMENT;
+ } else if(fElement.isToken()) {
+ model = fElement.getToken();
+ }
+ }
+ return model;
}
/* (non-Javadoc)
@@ -87,10 +89,14 @@
*/
public ElementDeclaration getElementDeclaration()
{
- InterfaceOperation oper = (InterfaceOperation)getParent();
- Interface interfac = (Interface)oper.getParent();
- Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
- ElementDeclaration elemDecl = desc.getElementDeclaration(fElementName);
+ ElementDeclaration elemDecl = null;
+
+ if(fElement != null && fElement.isQName()) {
+ InterfaceOperation oper = (InterfaceOperation)getParent();
+ Interface interfac = (Interface)oper.getParent();
+ Description desc = ((InterfaceImpl)interfac).getDescriptionComponent();
+ elemDecl = desc.getElementDeclaration(fElement.getQName());
+ }
return elemDecl;
}
@@ -113,40 +119,32 @@
}
/* (non-Javadoc)
- * @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setMessageContentModel(java.lang.String)
- */
- public void setMessageContentModel(String nmToken) {
- fMessageContentModel = nmToken;
- }
-
- /* (non-Javadoc)
* @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#setElementName(javax.xml.namespace.QName)
*/
- public void setElementName(QName element) {
- fElementName = element;
+ public void setElement(QNameTokenUnion element) {
+ fElement = element;
}
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElementName()
*/
- public QName getElementName() {
- return fElementName;
+ public QNameTokenUnion getElement() {
+ return fElement;
}
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement#getElement()
*/
- public XmlSchemaElement getElement()
+ public XmlSchemaElement getXmlSchemaElement()
{
XmlSchemaElement xse = null;
- if(Constants.NMTOKEN_ELEMENT.equals(fMessageContentModel))
- {
+ if(fElement != null && fElement.isQName()) {
InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
TypesElement types = desc.getTypesElement();
if(types != null) {
- xse = ((TypesImpl)types).getElementDeclaration(fElementName);
+ xse = ((TypesImpl)types).getElementDeclaration(fElement.getQName());
}
}
return xse;
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/TypesImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/TypesImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/TypesImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/TypesImpl.java Mon Jan 7 09:36:13 2008
@@ -72,6 +72,8 @@
{
if(schema != null) {
fSchemas.add(schema);
+ //reset flag so ComponentModelBuilder will rebuild the ElementDeclarations and TypeDefinitions
+ ((DescriptionImpl)getParentElement()).resetComponentsInitialized();
}
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/WSDLElementImpl.java Mon Jan 7 09:36:13 2008
@@ -16,6 +16,10 @@
*/
package org.apache.woden.internal.wsdl20;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
import java.net.URI;
import javax.xml.namespace.QName;
@@ -23,6 +27,7 @@
import org.apache.woden.internal.WSDLContext;
import org.apache.woden.internal.wsdl20.extensions.AttributeExtensibleImpl;
import org.apache.woden.internal.wsdl20.extensions.ElementExtensibleImpl;
+import org.apache.woden.types.NamespaceDeclaration;
import org.apache.woden.wsdl20.extensions.ExtensionElement;
import org.apache.woden.wsdl20.xml.NestedElement;
import org.apache.woden.wsdl20.xml.WSDLElement;
@@ -40,6 +45,8 @@
{
private AttributeExtensibleImpl fAttrExt = new AttributeExtensibleImpl();
private ElementExtensibleImpl fElemExt = new ElementExtensibleImpl();
+ private Map namespaceToPrefixMap = new HashMap();
+ private Map prefixToNamespaceMap = new HashMap();
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.extensions.AttributeExtensible#setExtensionAttribute(javax.xml.namespace.QName, org.apache.woden.xml.XMLAttr)
@@ -135,5 +142,76 @@
//This is not a nested element, so the WSDL context is in this element, at the top of the tree.
//This element will override the getWsdlContext() method defined in WSDLElementImpl.
return ((WSDLElementImpl)wElem).getWsdlContext();
+ }
+
+ public void addNamespace(String prefix, URI namespace) {
+ prefix = (prefix != null) ? prefix : "";
+ if (namespace == null) {
+ removeNamespace(prefix);
+ } else {
+ namespaceToPrefixMap.put(namespace, prefix);
+ prefixToNamespaceMap.put(prefix, namespace);
+ }
+ }
+
+ public URI removeNamespace(String prefix) {
+ prefix = (prefix != null) ? prefix : "";
+ URI namespaceURI = (URI)prefixToNamespaceMap.remove(prefix);
+ namespaceToPrefixMap.remove(namespaceURI);
+ return namespaceURI;
+ }
+
+ public String getNamespacePrefix(URI namespace) {
+ //See if the prefix is local.
+ String prefix = (String)namespaceToPrefixMap.get(namespace);
+ if (prefix == null && this instanceof NestedElement) { //If not call parents to find prefix if I'm nested.
+ return ((NestedElement)this).getParentElement().getNamespacePrefix(namespace);
+ } else { //Otherwise return the found prefix or null.
+ return prefix;
+ }
+ }
+
+ public URI getNamespaceURI(String prefix) {
+ //See if the prefix is local.
+ URI namespace = (URI)prefixToNamespaceMap.get(prefix);
+ if (namespace == null && this instanceof NestedElement) { //If not call parents to find prefix if I'm nested.
+ return ((NestedElement)this).getParentElement().getNamespaceURI(prefix);
+ } else { //Otherwise return the found namespace or null.
+ return namespace;
+ }
+ }
+
+ public NamespaceDeclaration[] getInScopeNamespaces() {
+ ArrayList namespaces = addInScopeNamespaces(new ArrayList());
+ return (NamespaceDeclaration[])namespaces.toArray(new NamespaceDeclaration[namespaces.size()]);
+ }
+
+ private ArrayList addInScopeNamespaces(ArrayList namespaces) {
+ //Add my namespaces.
+ Iterator it = namespaceToPrefixMap.keySet().iterator();
+ while(it.hasNext()){
+ URI namespace = (URI)it.next();
+ namespaces.add(new NamespaceDeclaration((String)namespaceToPrefixMap.get(namespace), namespace));
+ }
+ //Add my parent namespaces if I'm a child.
+ if (this instanceof NestedElement) {
+ return ((WSDLElementImpl)((NestedElement)this).getParentElement()).addInScopeNamespaces(namespaces);
+ } else {
+ return namespaces;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.wsdl20.xml.WSDLElement#getLocalNamespaceDeclarations()
+ */
+ public NamespaceDeclaration[] getDeclaredNamespaces() {
+ ArrayList namespaces = new ArrayList();
+ Iterator it = namespaceToPrefixMap.keySet().iterator();
+ while(it.hasNext()){
+ URI namespace = (URI)it.next();
+ namespaces.add(new NamespaceDeclaration((String)namespaceToPrefixMap.get(namespace), namespace));
+ }
+ return (NamespaceDeclaration[])namespaces.toArray(new NamespaceDeclaration[namespaces.size()]);
}
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/ExtensionConstants.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/ExtensionConstants.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/ExtensionConstants.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/ExtensionConstants.java Mon Jan 7 09:36:13 2008
@@ -16,6 +16,8 @@
*/
package org.apache.woden.internal.wsdl20.extensions;
+import java.net.URI;
+
import javax.xml.namespace.QName;
/**
@@ -25,10 +27,14 @@
*/
public class ExtensionConstants {
- // Namespace URI
+ // Namespace String
- public static final String NS_URI_WSDL_EXTENSIONS = "http://www.w3.org/ns/wsdl-extensions";
+ public static final String NS_STRING_WSDL_EXTENSIONS = "http://www.w3.org/ns/wsdl-extensions";
+ // Namespace URI
+
+ public static final URI NS_URI_WSDL_EXTENSIONS = URI.create(NS_STRING_WSDL_EXTENSIONS);
+
// Attribute name
public static final String ATTR_SAFE = "safe";
@@ -40,6 +46,6 @@
// Qualified attribute name
public static final QName Q_ATTR_SAFE = new QName(
- NS_URI_WSDL_EXTENSIONS, ATTR_SAFE, PFX_WSDL_EXTENSIONS);
+ NS_STRING_WSDL_EXTENSIONS, ATTR_SAFE, PFX_WSDL_EXTENSIONS);
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java Mon Jan 7 09:36:13 2008
@@ -16,8 +16,12 @@
*/
package org.apache.woden.internal.wsdl20.extensions;
+import java.util.Enumeration;
+import java.util.StringTokenizer;
+
import org.apache.woden.ErrorReporter;
-import org.apache.woden.internal.WSDLContext;
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.util.PropertyUtils;
import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingFaultExtensionsImpl;
import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensionsImpl;
@@ -55,6 +59,7 @@
import org.apache.woden.wsdl20.Endpoint;
import org.apache.woden.wsdl20.InterfaceOperation;
import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistrar;
import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
import org.apache.woden.wsdl20.xml.BindingElement;
import org.apache.woden.wsdl20.xml.BindingFaultElement;
@@ -80,12 +85,9 @@
*/
public class PopulatedExtensionRegistry extends ExtensionRegistry {
- final private WSDLContext fWsdlContext;
-
- public PopulatedExtensionRegistry(WSDLContext wsdlContext) {
+ public PopulatedExtensionRegistry(ErrorReporter errorReporter) throws WSDLException {
- super(wsdlContext.errorReporter);
- fWsdlContext = wsdlContext;
+ super(errorReporter);
// ------------ Default type for unregistered extension attributes
// ------------
@@ -105,7 +107,7 @@
// ------------ WSDL Component Extensions ------------
registerComponentExtension(InterfaceOperation.class,
- ComponentExtensions.URI_NS_EXTENSIONS,
+ ComponentExtensions.NS_URI_WSDL_EXTENSIONS,
InterfaceOperationExtensionsImpl.class);
// ------------ RPC extension attributes ------------
@@ -115,7 +117,7 @@
// ------------ RPC Component Extensions ------------
registerComponentExtension(InterfaceOperation.class,
- ComponentExtensions.URI_NS_RPC,
+ ComponentExtensions.NS_URI_RPC,
RPCInterfaceOperationExtensionsImpl.class);
// ------------ SOAP extension attributes ------------
@@ -197,27 +199,27 @@
// ------------ SOAP Component Extensions ------------
registerComponentExtension(Binding.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPBindingExtensionsImpl.class);
registerComponentExtension(BindingFault.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPBindingFaultExtensionsImpl.class);
registerComponentExtension(BindingOperation.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPBindingOperationExtensionsImpl.class);
registerComponentExtension(BindingMessageReference.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPBindingMessageReferenceExtensionsImpl.class);
registerComponentExtension(BindingFaultReference.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPBindingFaultReferenceExtensionsImpl.class);
registerComponentExtension(Endpoint.class,
- ComponentExtensions.URI_NS_SOAP,
+ ComponentExtensions.NS_URI_SOAP,
SOAPEndpointExtensionsImpl.class);
// ------------ HTTP extension attributes ------------
@@ -301,29 +303,79 @@
// ------------ HTTP Component Extensions ------------
registerComponentExtension(Binding.class,
- ComponentExtensions.URI_NS_HTTP,
+ ComponentExtensions.NS_URI_HTTP,
HTTPBindingExtensionsImpl.class);
registerComponentExtension(BindingFault.class,
- ComponentExtensions.URI_NS_HTTP,
+ ComponentExtensions.NS_URI_HTTP,
HTTPBindingFaultExtensionsImpl.class);
registerComponentExtension(BindingOperation.class,
- ComponentExtensions.URI_NS_HTTP,
+ ComponentExtensions.NS_URI_HTTP,
HTTPBindingOperationExtensionsImpl.class);
registerComponentExtension(BindingMessageReference.class,
- ComponentExtensions.URI_NS_HTTP,
+ ComponentExtensions.NS_URI_HTTP,
HTTPBindingMessageReferenceExtensionsImpl.class);
registerComponentExtension(Endpoint.class,
- ComponentExtensions.URI_NS_HTTP,
+ ComponentExtensions.NS_URI_HTTP,
HTTPEndpointExtensionsImpl.class);
-
+
+ //Register other, user-defined WSDL extensions.
+ registerExtensions();
}
- public ErrorReporter getErrorReporter()
- {
- return fWsdlContext.errorReporter;
+ /*
+ * Registers WSDL extensions with this extension registry,
+ * via the ExtensionRegistrar callback interface.
+ *
+ */
+ private void registerExtensions() throws WSDLException {
+ Enumeration registrarNames = getRegistrarNames();
+ if (registrarNames != null) {
+ while (registrarNames.hasMoreElements()) {
+ String extensionRegistrarClassName = ((String)registrarNames.nextElement()).trim();
+ try {
+ Class clazz = Class.forName(extensionRegistrarClassName);
+ ExtensionRegistrar registrar = (ExtensionRegistrar)clazz.newInstance();
+ registrar.registerExtensions(this);
+ } catch (ClassNotFoundException cnfe) {
+ ErrorReporter er = getErrorReporter();
+ er.reportError(
+ null,
+ "WSDL020",
+ new Object[] {extensionRegistrarClassName},
+ ErrorReporter.SEVERITY_ERROR,
+ cnfe);
+ } catch (ClassCastException cce) {
+ getErrorReporter().reportError(
+ null,
+ "WSDL021",
+ new Object[] {extensionRegistrarClassName},
+ ErrorReporter.SEVERITY_ERROR,
+ cce);
+ } catch (Exception e) {
+ getErrorReporter().reportError(
+ null,
+ "WSDL022",
+ new Object[] {extensionRegistrarClassName},
+ ErrorReporter.SEVERITY_ERROR,
+ e);
+ }
+ }
+ }
}
+
+ /*
+ * Returns an Enumeration of ExtensionRegistrar class names.
+ * The <code>REGISTRAR_PROPERTY</code> property contains a comma-separated list of
+ * ExtensionRegistrar class names.
+ * @return an Enumeration of ExtensionRegistrar class names.
+ */
+ private Enumeration getRegistrarNames() {
+ String registrarNames = PropertyUtils.findProperty(ExtensionRegistry.REGISTRAR_PROPERTY);
+ return registrarNames == null ? null : new StringTokenizer(registrarNames, ",");
+ }
+
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -249,8 +249,7 @@
.getInterfaceOperation();
if (intOper != null) {
InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
- .getComponentExtensionsForNamespace(URI
- .create(ExtensionConstants.NS_URI_WSDL_EXTENSIONS));
+ .getComponentExtensionsForNamespace(ExtensionConstants.NS_URI_WSDL_EXTENSIONS);
if (intOperExts != null && intOperExts.isSafety()) {
return HTTPConstants.METHOD_GET;
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java Mon Jan 7 09:36:13 2008
@@ -25,10 +25,11 @@
*/
public class HTTPConstants
{
- // Namespace URIs.
+ // Namespace Strings.
public static final String NS_STRING_HTTP =
"http://www.w3.org/ns/wsdl/http";
+ // Namespace URIs.
public static final URI NS_URI_HTTP = URI.create(NS_STRING_HTTP);
// Element names.
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java Mon Jan 7 09:36:13 2008
@@ -28,14 +28,18 @@
*/
public class RPCConstants {
- // Namespace URI
+ // Namespace String
- public static final String NS_URI_RPC = "http://www.w3.org/ns/wsdl/rpc";
+ public static final String NS_STRING_RPC = "http://www.w3.org/ns/wsdl/rpc";
+ // Namespace URI
+
+ public static final URI NS_URI_RPC = URI.create(NS_STRING_RPC);
+
// Style URI
- public static final String STYLE_URI_RPC = "http://www.w3.org/ns/wsdl/style/rpc";
- public static final URI URI_STYLE_RPC = URI.create("http://www.w3.org/ns/wsdl/style/rpc");
+ public static final String STYLE_STRING_RPC = "http://www.w3.org/ns/wsdl/style/rpc";
+ public static final URI STYLE_URI_RPC = URI.create("http://www.w3.org/ns/wsdl/style/rpc");
// Attribute name
@@ -48,6 +52,6 @@
// Qualified attribute name
public static final QName Q_ATTR_RPC_SIGNATURE = new QName(
- NS_URI_RPC, ATTR_SIGNATURE, PFX_RPC);
+ NS_STRING_RPC, ATTR_SIGNATURE, PFX_RPC);
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -91,8 +91,8 @@
return null;
}
- if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr qpsDef = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT);
@@ -114,8 +114,8 @@
return null;
}
- if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
BooleanAttr cookiesUsed = (BooleanAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_COOKIES);
@@ -137,8 +137,8 @@
return null;
}
- if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(getSoapVersion()) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr ceDef = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingFaultExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingFaultExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingFaultExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingFaultExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -147,15 +147,15 @@
{
Binding binding = (Binding) ((NestedComponent)fParent).getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr contEncoding = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING);
@@ -174,15 +174,15 @@
{
Binding binding = (Binding) ((NestedComponent)fParent).getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return new HTTPHeader[0];
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
ExtensionElement[] extEls = ((WSDLElement)fParent)
.getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -77,15 +77,15 @@
BindingOperation bindingOp = (BindingOperation) ((NestedComponent)fParent).getParent();
Binding binding = (Binding) bindingOp.getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr contEncoding = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING);
@@ -105,15 +105,15 @@
BindingOperation bindingOp = (BindingOperation) ((NestedComponent)fParent).getParent();
Binding binding = (Binding) bindingOp.getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return new HTTPHeader[0];
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
ExtensionElement[] extEls = ((WSDLElement)fParent)
.getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingOperationExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingOperationExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingOperationExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -84,15 +84,15 @@
Binding binding = (Binding) ((NestedComponent)fParent).getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr httpLoc = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
@@ -113,15 +113,15 @@
Binding binding = (Binding) ((NestedComponent)fParent).getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr separator = (StringAttr) ((WSDLElement) fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR);
@@ -142,15 +142,15 @@
Binding binding = (Binding) ((NestedComponent)fParent).getParent();
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr ceDef = (StringAttr) ((WSDLElement)fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPConstants.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPConstants.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPConstants.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPConstants.java Mon Jan 7 09:36:13 2008
@@ -16,6 +16,8 @@
*/
package org.apache.woden.internal.wsdl20.extensions.soap;
+import java.net.URI;
+
import javax.xml.namespace.QName;
/**
@@ -23,16 +25,23 @@
*/
public class SOAPConstants
{
- // Namespace URIs.
- public static final String NS_URI_SOAP =
+ // Namespace Strings.
+ public static final String NS_STRING_SOAP =
"http://www.w3.org/ns/wsdl/soap";
- // Protocol URIs.
- public static final String URI_SOAP12_HTTP =
+ // Namespace URIs.
+ public static final URI NS_URI_SOAP = URI.create(NS_STRING_SOAP);
+
+ // Protocol Strings.
+ public static final String PROTOCOL_STRING_SOAP12_HTTP =
"http://www.w3.org/2003/05/soap/bindings/HTTP/";
- public static final String URI_SOAP11_HTTP =
+ public static final String PROTOCOL_STRING_SOAP11_HTTP =
"http://www.w3.org/2006/01/soap11/bindings/HTTP/";
+ // Protocol URIs.
+ public static final URI PROTOCOL_URI_SOAP12_HTTP = URI.create(PROTOCOL_STRING_SOAP12_HTTP);
+ public static final URI PROTOCOL_URI_SOAP11_HTTP = URI.create(PROTOCOL_STRING_SOAP11_HTTP);
+
// Element names.
public static final String ELEM_MODULE = "module";
public static final String ELEM_HEADER = "header";
@@ -53,32 +62,32 @@
// Qualified element names.
public static final QName Q_ELEM_SOAP_MODULE =
- new QName(NS_URI_SOAP, ELEM_MODULE, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ELEM_MODULE, PFX_WSOAP);
public static final QName Q_ELEM_SOAP_HEADER =
- new QName(NS_URI_SOAP, ELEM_HEADER, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ELEM_HEADER, PFX_WSOAP);
// Qualified attribute names.
public static final QName Q_ATTR_SOAP_VERSION =
- new QName(NS_URI_SOAP, ATTR_VERSION, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_VERSION, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_PROTOCOL =
- new QName(NS_URI_SOAP, ATTR_PROTOCOL, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_PROTOCOL, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_MEPDEFAULT =
- new QName(NS_URI_SOAP, ATTR_MEPDEFAULT, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_MEPDEFAULT, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_CODE =
- new QName(NS_URI_SOAP, ATTR_CODE, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_CODE, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_SUBCODES =
- new QName(NS_URI_SOAP, ATTR_SUBCODES, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_SUBCODES, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_MEP =
- new QName(NS_URI_SOAP, ATTR_MEP, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_MEP, PFX_WSOAP);
public static final QName Q_ATTR_SOAP_ACTION =
- new QName(NS_URI_SOAP, ATTR_ACTION, PFX_WSOAP);
+ new QName(NS_STRING_SOAP, ATTR_ACTION, PFX_WSOAP);
}
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java Mon Jan 7 09:36:13 2008
@@ -56,15 +56,15 @@
}
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
HTTPAuthenticationSchemeAttr scheme = (HTTPAuthenticationSchemeAttr) ((WSDLElement) fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_SCHEME);
@@ -90,15 +90,15 @@
}
SOAPBindingExtensions soapBindExt = (SOAPBindingExtensions)binding
- .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+ .getComponentExtensionsForNamespace(ComponentExtensions.NS_URI_SOAP);
String version = soapBindExt.getSoapVersion();
URI protocol = soapBindExt.getSoapUnderlyingProtocol();
if(protocol == null) {
return null;
}
- if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP12_HTTP)) ||
- ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.URI_SOAP11_HTTP)) )
+ if( ("1.2".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP12_HTTP)) ||
+ ("1.1".equals(version) && protocol.toString().equals(SOAPConstants.PROTOCOL_STRING_SOAP11_HTTP)) )
{
StringAttr realm = (StringAttr) ((WSDLElement) fParent)
.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_REALM);
Modified: webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java?rev=609714&r1=609713&r2=609714&view=diff
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java (original)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidator.java Mon Jan 7 09:36:13 2008
@@ -35,6 +35,7 @@
import org.apache.woden.wsdl20.xml.ImportElement;
import org.apache.woden.wsdl20.xml.InterfaceElement;
import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
+import org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement;
import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
import org.apache.woden.wsdl20.xml.TypesElement;
@@ -179,7 +180,7 @@
for(int j = 0; j < numFaultElements; j++)
{
InterfaceFaultElement faultElement = faultElements[j];
- if(!testAssertionSchema1066(descElement, faultElement.getElementName(), errorReporter))
+ if(!testAssertionSchema1066(descElement, faultElement.getElement().getQName(), errorReporter))
isValid = false;
}
return isValid;
@@ -204,6 +205,9 @@
if(!validateInterfaceMessageReferences(descElement, interfaceOperation.getInterfaceMessageReferenceElements(), errorReporter))
isValid = false;
+
+ if(!validateInterfaceFaultReferences(descElement, interfaceOperation.getInterfaceFaultReferenceElements(), errorReporter))
+ isValid = false;
}
return isValid;
}
@@ -224,6 +228,30 @@
return isValid;
}
+ /**
+ * Validate the InterfaceFaultReference elements.
+ *
+ * @param descElement The root description element.
+ * @param faultReferences An array of interface fault reference elements.
+ * @param errorReporter An error reporter.
+ * @return True if the interface fault reference elements are all valid, false otherwise.
+ * @throws WSDLException
+ */
+ protected boolean validateInterfaceFaultReferences(DescriptionElement descElement, InterfaceFaultReferenceElement[] faultReferences, ErrorReporter errorReporter) throws WSDLException
+ {
+ boolean isValid = true;
+
+ int numFaultReferences = faultReferences.length;
+ for(int k = 0; k < numFaultReferences; k++)
+ {
+ InterfaceFaultReferenceElement faultReference = faultReferences[k];
+ if(!testAssertionQNameResolution1064ForInterfaceFaultReference(faultReference, errorReporter))
+ isValid = false;
+ }
+
+ return isValid;
+ }
+
/**
* Test assertion Description-1006. Tests whether the target namespace
* specified is an absolute IRI.
@@ -453,5 +481,32 @@
}
}
return true;
+ }
+
+ /**
+ * Test assertion QName-resolution-1064 for an InterfaceFaultReference element. \
+ * A Description component must not contain broken QName references.
+ *
+ * @param faultReference The interface fault reference to check for a broken reference.
+ * @param errorReporter An error reporter.
+ * @return True if the assertion passes, false otherwise.
+ * @throws WSDLException
+ */
+ protected boolean testAssertionQNameResolution1064ForInterfaceFaultReference(InterfaceFaultReferenceElement faultReference, ErrorReporter errorReporter) throws WSDLException
+ {
+ QName ref = faultReference.getRef();
+ if(ref != null)
+ {
+ InterfaceFaultElement fault = faultReference.getInterfaceFaultElement();
+ if(fault == null)
+ {
+ errorReporter.reportError(new ErrorLocatorImpl(),
+ "QName-resolution-1064",
+ new Object[]{ref.toString(), "interface fault reference", "interface fault"},
+ ErrorReporter.SEVERITY_ERROR);
+ return false;
+ }
+ }
+ return true;
}
}
Added: webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/DOMXMLElementEvaluator.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/DOMXMLElementEvaluator.java?rev=609714&view=auto
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/DOMXMLElementEvaluator.java (added)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/DOMXMLElementEvaluator.java Mon Jan 7 09:36:13 2008
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.xpointer;
+
+//Woden
+import org.apache.woden.XMLElement;
+import org.apache.woden.internal.DOMXMLElement;
+import org.apache.woden.ErrorReporter;
+
+//XPointer
+import org.apache.woden.xpointer.XPointer;
+
+//DOM
+import org.w3c.dom.Element;
+
+/**
+ * This class extends the XMLElementEvaluator to support the DOM implementation in XMLElement.
+ *
+ * @author Dan Harvey <da...@gmail.com>
+ *
+ */
+public class DOMXMLElementEvaluator extends XMLElementEvaluator {
+
+ /**
+ * Constructs a new DOMXMLElementEvaluator to evaluate a XPointer on a DOM Element.
+ *
+ * @param xpointer an XPointer to evaluate.
+ * @param element an DOM Element to be evaluated.
+ * @param errorReporter the Woden Error Reporter context object.
+ */
+ public DOMXMLElementEvaluator(XPointer xpointer, Element element, ErrorReporter errorReporter) {
+ super(xpointer, createXMLElement(element, errorReporter));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.internal.xpointer.XMLElementEvaluator#testElementShorthand(org.apache.woden.XMLElement, java.lang.String)
+ */
+ public boolean testElementShorthand(XMLElement element, String shorthand) {
+ //Simple http://www.w3.org/TR/xml-id/ support for now until we support full scheme based ID's.
+ Element domElement = (Element)element.getSource();
+ String attr = domElement.getAttributeNS("http://www.w3.org/XML/1998/namespace", "id");
+ return attr != null && attr.equals(shorthand);
+ }
+
+ /**
+ * Evaluates the XPointer on the root Element and returns the resulting Element or null.
+ *
+ * @return an Element from the resultant evaluation of the root Element or null if evaluation fails.
+ */
+ public Element evaluateElement(){
+ XMLElement element = evaluate();
+ if (element != null) return (Element)element.getSource();
+ return null;
+ }
+
+ //Private methods
+ private static XMLElement createXMLElement(Element element, ErrorReporter errorReporter) {
+ DOMXMLElement domXMLElement = new DOMXMLElement(errorReporter);
+ domXMLElement.setSource(element);
+ return domXMLElement;
+ }
+}
Propchange: webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/DOMXMLElementEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/OMXMLElementEvaluator.java
URL: http://svn.apache.org/viewvc/webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/OMXMLElementEvaluator.java?rev=609714&view=auto
==============================================================================
--- webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/OMXMLElementEvaluator.java (added)
+++ webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/OMXMLElementEvaluator.java Mon Jan 7 09:36:13 2008
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.xpointer;
+
+//Java
+import javax.xml.namespace.QName;
+
+//Woden
+import org.apache.woden.XMLElement;
+import org.apache.woden.internal.OMXMLElement;
+import org.apache.woden.ErrorReporter;
+
+//XPointer
+import org.apache.woden.xpointer.XPointer;
+
+//OM
+import org.apache.axiom.om.OMElement;
+
+/**
+ * This class extends XMLElementEvaluator to support the OM implementation in XMLElement
+ *
+ * @author Dan Harvey <da...@gmail.com>
+ *
+ */
+public class OMXMLElementEvaluator extends XMLElementEvaluator {
+
+ /**
+ * Constructs a new OMXMLElementEvaluator to evaluate a XPointer on a OM Element.
+ *
+ * @param xpointer an XPointer to evaluate.
+ * @param element an OMElement to be evaluated.
+ * @param errorReporter the Woden Error Reporter context object.
+ */
+ public OMXMLElementEvaluator(XPointer xpointer, OMElement element, ErrorReporter errorReporter) {
+ super(xpointer, createXMLElement(element, errorReporter));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.woden.internal.xpointer.XMLElementEvaluator#testElementShorthand(org.apache.woden.XMLElement, java.lang.String)
+ */
+ public boolean testElementShorthand(XMLElement element, String shorthand) {
+ // Simple http://www.w3.org/TR/xml-id/ support for now until we support full scheme based ID's.
+ OMElement omElement = (OMElement)element.getSource();
+ String attr = omElement.getAttributeValue(new QName("http://www.w3.org/XML/1998/namespace", "id"));
+ return attr != null && attr.equals(shorthand);
+ }
+
+ /**
+ * Evaluates the XPointer on the root Element and returns the resulting
+ * Element or null.
+ *
+ * @return an Element from the resultant evaluation of the root Element or
+ * null if evaluation fails.
+ */
+ public OMElement evaluateElement() {
+ XMLElement element = evaluate();
+ if (element != null) return (OMElement) element.getSource();
+ return null;
+ }
+
+ // Private methods
+ private static XMLElement createXMLElement(Object elem, ErrorReporter errorReporter) {
+ OMXMLElement omXMLElement = new OMXMLElement(errorReporter);
+ omXMLElement.setSource(elem);
+ return omXMLElement;
+
+ }
+}
Propchange: webservices/woden/branches/woden65/src/org/apache/woden/internal/xpointer/OMXMLElementEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org