You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/02/24 18:05:38 UTC
svn commit: r380711 - in
/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice:
generator/ jaxrpc/ wsdl/
Author: cschoett
Date: Fri Feb 24 09:05:35 2006
New Revision: 380711
URL: http://svn.apache.org/viewcvs?rev=380711&view=rev
Log:
Nothing functional, just some java doc cleanup.
Modified:
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/generator/WebServiceControlGenerator.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/ControlWsdlLocator.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/DomUtils.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/Wsdl.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlComplexTypes.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFault.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFaultList.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameter.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameterList.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpReturnType.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOperation.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlTypes.java
beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlUtils.java
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/generator/WebServiceControlGenerator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/generator/WebServiceControlGenerator.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/generator/WebServiceControlGenerator.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/generator/WebServiceControlGenerator.java Fri Feb 24 09:05:35 2006
@@ -252,8 +252,8 @@
else javaReturnType = getClass(null, null, false);
MethodInfo m = new MethodInfo();
- m.setMethodName(operation.getOperationName().getLocalPart());
- m.setOperationName(operation.getOperationName().getLocalPart());
+ m.setMethodName(operation.getOperationQName().getLocalPart());
+ m.setOperationName(operation.getOperationQName().getLocalPart());
m.setReturnTypeName(JavaClassUtils.convertToReadableName(javaReturnType.getCanonicalName()));
for (WsdlOpParameter param : operation.getParameters()) {
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java Fri Feb 24 09:05:35 2006
@@ -96,7 +96,7 @@
void configure(WsdlOperation op, Method method, QName portType) {
_op = op;
- setOperationName(_op.getOperationName());
+ setOperationName(_op.getOperationQName());
setOperationStyle(_op.getSOAPBindingStyle(), _op.getSOAPParameterStyle(), _op.getSOAPBindingUse());
setSOAPAction(_op.getSOAPAction());
setCallParameters(method);
@@ -323,7 +323,7 @@
&& args[i] instanceof Holder) {
QName paramQName = param.getName();
- if (!param.isElementFormQualified()) {
+ if (!param.isNameElementFormQualified()) {
paramQName = new QName(paramQName.getLocalPart());
}
@@ -379,7 +379,7 @@
_op.getSOAPBindingStyle(), _op.getSOAPBindingUse());
QName paramName = opParam.getName();
- if (!opParam.isElementFormQualified()) {
+ if (!opParam.isNameElementFormQualified()) {
paramName = new QName(paramName.getLocalPart());
}
addParameter(paramName, javaType, registeredTypeQName, mode, opParam.isHeader());
@@ -409,11 +409,11 @@
WsdlOpFaultList faultList = _op.getFaults();
for (WsdlOpFault fault : faultList) {
QName faultName = fault.getName();
- if (!fault.isElementFormQualified()) {
+ if (!fault.isFaultNameElementFormQualified()) {
faultName = new QName(faultName.getLocalPart());
}
- addFault(faultName, fault.getXmlType(), fault.isComplextType(),
+ addFault(faultName, fault.getXmlType(), fault.isComplexType(),
_op.getSOAPBindingStyle(), _op.getSOAPBindingUse());
}
}
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/ControlWsdlLocator.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/ControlWsdlLocator.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/ControlWsdlLocator.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/ControlWsdlLocator.java Fri Feb 24 09:05:35 2006
@@ -32,12 +32,11 @@
import java.util.ArrayList;
/**
- * An implementation of WSDLLocator for Beehive controls. This WSDLLocator implementation
+ * Implementation of WSDLLocator for Beehive controls. This WSDLLocator implementation
* may open multiple input streams, its <tt>cleanup()</tt> method should always be called once
* the WSDL file has been parsed.
*/
-public final class ControlWsdlLocator implements WSDLLocator
-{
+public final class ControlWsdlLocator implements WSDLLocator {
private final String _wsdlName;
private final BeanContext _beanContext;
private ArrayList<InputStream> _openStreams = new ArrayList<InputStream>();
@@ -141,7 +140,6 @@
* @return null
*/
public InputSource getImportInputSource(String string, String string1) {
-
return null;
}
@@ -151,7 +149,6 @@
* @return null
*/
public String getLatestImportURI() {
-
return null;
}
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/DomUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/DomUtils.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/DomUtils.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/DomUtils.java Fri Feb 24 09:05:35 2006
@@ -17,7 +17,6 @@
*/
package org.apache.beehive.controls.system.webservice.wsdl;
-import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -26,7 +25,7 @@
import java.util.List;
/**
- * Some simple DOM utility methods.
+ * Some DOM utility methods.
*/
public final class DomUtils {
@@ -34,11 +33,11 @@
* <p>Returns the first child element with the given name. Returns
* <code>null</code> if not found.</p>
*
- * @param parent parent element
- * @param localName name of the child element
- * @return child element
+ * @param parent parent element
+ * @param localName name of the child element
+ * @return child element, null if not found.
*/
- static Element getChildElementByName(Element parent, String localName) {
+ protected static Element getChildElementByName(Element parent, String localName) {
NodeList children = parent.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
@@ -50,7 +49,6 @@
}
}
}
-
return null;
}
@@ -63,7 +61,7 @@
* @param localName Local name of the child element
* @return child elements
*/
- static List<Element> getChildElementsByName(Element parent, String localName) {
+ protected static List<Element> getChildElementsByName(Element parent, String localName) {
List<Element> elements = new ArrayList<Element>();
NodeList children = parent.getChildNodes();
@@ -77,25 +75,6 @@
}
}
}
-
return elements;
- }
-
- /**
- * <p>Retutns the value of the named attribute of the given
- * element. If there is no such attribute, returns null.</p>
- *
- * @param element element
- * @param name name
- * @return value
- */
- public static String getAttributeValue(Element element, String name) {
- Attr attribute = element.getAttributeNode(name);
- if (attribute == null) {
- return null;
- }
- else {
- return attribute.getValue();
- }
}
}
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/Wsdl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/Wsdl.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/Wsdl.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/Wsdl.java Fri Feb 24 09:05:35 2006
@@ -35,9 +35,9 @@
import java.util.List;
/**
+ * Wsdl abstraction.
*/
-public final class Wsdl implements java.io.Serializable
-{
+public final class Wsdl implements java.io.Serializable {
private Port _port;
private final Definition _wsdlDefinition;
private final Service _service;
@@ -62,7 +62,8 @@
if (serviceQName == null) {
_service = (Service) _wsdlDefinition.getServices().values().iterator().next();
- } else {
+ }
+ else {
_service = _wsdlDefinition.getService(serviceQName);
if (_service == null) {
throw new IllegalArgumentException("Service: " + serviceQName
@@ -72,7 +73,8 @@
if (portName == null) {
_port = (Port) _service.getPorts().values().iterator().next();
- } else {
+ }
+ else {
_port = _service.getPort(portName);
if (_port == null) {
throw new IllegalArgumentException("Port: " + portName
@@ -119,6 +121,7 @@
/**
* Get the WsdlComplexTypes instance of this wsdl. WsdlComplex types provides type information
* for named complextypes defined in the wsdl's <types> section.
+ *
* @return WsdlComplexTypes instance.
*/
public WsdlComplexTypes getComplexTypes() {
@@ -170,7 +173,7 @@
/**
* Get the name of the current port.
*
- * @return String.
+ * @return Name of the current port.
*/
public String getPortName() {
return _port.getName();
@@ -188,6 +191,11 @@
return b.getPortType().getQName();
}
+ /**
+ * Get the service endpoint.
+ *
+ * @return String containing the service endpoint.
+ */
public String getServiceEndpoint() {
return WsdlUtils.getSOAPAddress(_port);
}
@@ -195,7 +203,7 @@
/**
* Get the name of this service.
*
- * @return String.
+ * @return Service name.
*/
public String getServiceName() {
return _service.getQName().getLocalPart();
@@ -204,7 +212,7 @@
/**
* Get the target namespace for the WSDL.
*
- * @return String
+ * @return The targetNamespace
*/
public String getTargetNamespace() {
return _wsdlDefinition.getTargetNamespace();
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlComplexTypes.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlComplexTypes.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlComplexTypes.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlComplexTypes.java Fri Feb 24 09:05:35 2006
@@ -34,18 +34,19 @@
/**
* Create a new instance, parse the WSDL file for named complex types.
+ *
* @param wsdlTypes Namespace resolver.
*/
- WsdlComplexTypes(WsdlTypes wsdlTypes) {
+ protected WsdlComplexTypes(WsdlTypes wsdlTypes) {
List schemas = wsdlTypes.getSchemas();
for (Object o : schemas) {
ExtensibilityElement schema = (ExtensibilityElement) o;
Element schemaRoot = ((Schema) schema).getElement();
- List<Element> types = DomUtils.getChildElementsByName(schemaRoot, "complexType");
+ List<Element> types = DomUtils.getChildElementsByName(schemaRoot, WsdlUtils.COMPLEX_TYPE_NAME);
for (Element t : types) {
- String schemaTypeName = t.getAttribute("name");
+ String schemaTypeName = t.getAttribute(WsdlUtils.NAME_ATTR);
_complexTypes.put(schemaTypeName, new ComplexType(t, wsdlTypes));
}
}
@@ -53,6 +54,7 @@
/**
* Get the complex type specifed by complexTypeName.
+ *
* @param complexTypeName Name of complex type.
* @return ComplexType instance, null if complex type was not defined in the wsdl file.
*/
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFault.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFault.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFault.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFault.java Fri Feb 24 09:05:35 2006
@@ -3,26 +3,22 @@
import javax.xml.namespace.QName;
/**
- * Operation parameter abstraction.
+ * Wsdl operation fault abstraction.
*/
-public final class WsdlOpFault extends WsdlOpReturnType implements java.io.Serializable
-{
+public final class WsdlOpFault extends WsdlOpReturnType implements java.io.Serializable {
private final QName _name;
private final boolean _complexType;
private final boolean _elementFormQualified;
/**
- * Constructor used to create operation parameters whose types do not need to
- * be unwrapped (found in one of the types schemas). Typically used for RPC style
- * parameters but also may be used for DOCUMENT style in some cases (BARE parameter
- * style in use).
+ * Create a new WsdlOpFault instance.
*
- * @param name QName of the parameter.
- * @param xmlType XML type of the parameter.
- * @param wsdlTypes
+ * @param name QName of the parameter.
+ * @param xmlType XML type of the parameter.
+ * @param wsdlTypes Wsdl type information.
*/
- WsdlOpFault(String name, QName xmlType, boolean isComplex, WsdlTypes wsdlTypes) {
+ protected WsdlOpFault(String name, QName xmlType, boolean isComplex, WsdlTypes wsdlTypes) {
_name = wsdlTypes.getTypeQName(name);
_elementFormQualified = wsdlTypes.isElementFormQualified(_name.getNamespaceURI());
@@ -31,7 +27,7 @@
}
/**
- * Get the name of this parameter.
+ * Get the name of this fault.
*
* @return QName.
*/
@@ -44,7 +40,7 @@
*
* @return true if xmltype is a complex type.
*/
- public boolean isComplextType() {
+ public boolean isComplexType() {
return _complexType;
}
@@ -53,7 +49,7 @@
*
* @return true if it is.
*/
- public boolean isElementFormQualified() {
+ public boolean isFaultNameElementFormQualified() {
return _elementFormQualified;
}
}
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFaultList.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFaultList.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFaultList.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpFaultList.java Fri Feb 24 09:05:35 2006
@@ -29,34 +29,36 @@
import java.util.Map;
/**
+ * WsdlOpFaultList represents the list of parameters for a WSDL operaiton.
*/
-public final class WsdlOpFaultList extends ArrayList<WsdlOpFault>
-{
+public final class WsdlOpFaultList extends ArrayList<WsdlOpFault> {
private final WsdlTypes _wsdlTypes;
/**
* Constructor.
*
- * @param wsdlTypes
+ * @param wsdlTypes Type information from the WSDL.
*/
- WsdlOpFaultList(WsdlTypes wsdlTypes) {
+ protected WsdlOpFaultList(WsdlTypes wsdlTypes) {
_wsdlTypes = wsdlTypes;
}
/**
* Add a fault to this list.
*
- * @param fault
+ * @param fault Fault to add.
* @return true if this collection was modified as a result of this call.
*/
- boolean add(Fault fault) {
+ protected boolean add(Fault fault) {
return add(getFault(fault));
}
/**
- * @param fault
- * @return WsdlOpFault
+ * Create a WsdlOpFault from the Fault.
+ *
+ * @param fault Fault to process.
+ * @return WsdlOpFault Result of processing.
*/
private WsdlOpFault getFault(Fault fault) {
Message m = fault.getMessage();
@@ -71,7 +73,7 @@
QName type = faultPart.getTypeName();
if (type == null) {
type = faultPart.getElementName();
- Element schemaElement = _wsdlTypes.findSchemaElement(type);
+ Element schemaElement = _wsdlTypes.findNamedElement(type);
assert schemaElement.hasAttribute("type");
type = _wsdlTypes.getTypeQName(schemaElement.getAttribute("type"));
complexType = true;
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameter.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameter.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameter.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameter.java Fri Feb 24 09:05:35 2006
@@ -5,7 +5,7 @@
import javax.xml.namespace.QName;
/**
- * Operation parameter abstraction.
+ * WSDL operation parameter abstraction.
*/
public final class WsdlOpParameter extends WsdlOpReturnType implements java.io.Serializable {
@@ -84,7 +84,7 @@
}
// check to see if the xml type of this element is an array type
- Element t = wsdlTypes.findSchemaType(_xmlType);
+ Element t = wsdlTypes.findNamedType(_xmlType);
if (t != null && WsdlUtils.COMPLEX_TYPE_NAME.equals(t.getLocalName())) {
_itemXmlType = getArrayItemType(t, wsdlTypes);
_isArray = _itemXmlType != null;
@@ -110,9 +110,11 @@
}
/**
- * @return True if this parameter is.
+ * Is this paramter's name element form qualified?
+ *
+ * @return True if element form qualified.
*/
- public boolean isElementFormQualified() {
+ public boolean isNameElementFormQualified() {
return _elementFormQualified;
}
@@ -151,6 +153,7 @@
_name = wsdlTypes.getTypeQName(name);
_elementFormQualified = wsdlTypes.isElementFormQualified(_name.getNamespaceURI());
}
+
/**
* Does this element represent an array type?
*
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameterList.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameterList.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameterList.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpParameterList.java Fri Feb 24 09:05:35 2006
@@ -29,7 +29,7 @@
import java.util.List;
/**
- * This class represents the list of parameters for an operaiton.
+ * WsdlOpParameterList represents the list of parameters for an operaiton.
*/
public final class WsdlOpParameterList extends ArrayList<WsdlOpParameter>
{
@@ -49,7 +49,7 @@
* @param binding Binding for the operation.
* @param wsdlTypes Wsdl types.
*/
- WsdlOpParameterList(Operation op, Binding binding, WsdlTypes wsdlTypes) {
+ protected WsdlOpParameterList(Operation op, Binding binding, WsdlTypes wsdlTypes) {
_wsdlTypes = wsdlTypes;
_returnParam = null;
@@ -64,16 +64,16 @@
*
* @return QName of the XML type, null if not present.
*/
- WsdlOpReturnType getReturnType() {
+ protected WsdlOpReturnType getReturnType() {
return _returnParam;
}
/**
* Get the style (WRAPPED or BARE) of the parameters in this list.
*
- * @return WRAPPED or BARE enum type.
+ * @return WsdlOperation.SOAPParamaterStyle enumeration value.
*/
- WsdlOperation.SOAPParameterStyle getParameterStyle() {
+ protected WsdlOperation.SOAPParameterStyle getParameterStyle() {
return _parameterStyle;
}
@@ -84,7 +84,7 @@
* @param requestPart tue if this parameter is part of an reqest message.
* @return true if this collection was modified as a result of this call.
*/
- boolean add(Part p, boolean requestPart) {
+ protected boolean add(Part p, boolean requestPart) {
List<WsdlOpParameter> params = getParameter(p, requestPart);
for (WsdlOpParameter op : params) {
@@ -123,7 +123,7 @@
}
else {
params.add(new WsdlOpParameter(part.getName(), part.getTypeName(),
- _wsdlTypes.findSchemaType(part.getTypeName()), _wsdlTypes));
+ _wsdlTypes.findNamedType(part.getTypeName()), _wsdlTypes));
}
return params;
}
@@ -150,7 +150,7 @@
* type of the method is void.</li>
* </ol></ol>
*
- * @param responseParam
+ * @param responseParam Parameter to process.
*/
private void addOutputParameter(WsdlOpParameter responseParam) {
@@ -223,8 +223,7 @@
}
/**
- * Using the proper schema from the WSDL's types section, resolve a Part's element attribute
- * value to a concrete XML type.
+ * Resolve a Part's element attribute value to a concrete XML type.
*
* @param p A message part.
* @return A list of parameters resulting from the schema type -- typically the list will only
@@ -233,7 +232,7 @@
private List<WsdlOpParameter> resolvePartElement(Part p) {
ArrayList<WsdlOpParameter> resolvedParams = new ArrayList<WsdlOpParameter>();
- Element schemaElement = _wsdlTypes.findSchemaElement(p.getElementName());
+ Element schemaElement = _wsdlTypes.findNamedElement(p.getElementName());
if (schemaElement.hasAttribute(WsdlUtils.ELEMENT_TYPE_ATTR)) {
// this is a simple type
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpReturnType.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpReturnType.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpReturnType.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOpReturnType.java Fri Feb 24 09:05:35 2006
@@ -20,13 +20,14 @@
import javax.xml.namespace.QName;
/**
- * Represents the return value for an operation.
+ * Represents the return value for a WSDL operation.
*/
public class WsdlOpReturnType implements java.io.Serializable
{
protected QName _xmlType;
protected boolean _isArray;
- /* used for the xmlType of an Array's items */
+
+ // The xmlType of an array's items
protected QName _itemXmlType;
/**
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOperation.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOperation.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOperation.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlOperation.java Fri Feb 24 09:05:35 2006
@@ -29,7 +29,7 @@
import java.util.Map;
/**
- * WSDL Operation abstraction used by webservice control.
+ * WSDL operation abstraction.
*/
public final class WsdlOperation implements java.io.Serializable {
@@ -57,7 +57,7 @@
private final SOAPBindingStyle _bindingStyle;
private final SOAPBindingUse _bindingUse;
private final WsdlOpFaultList _faults;
- private final QName _operationName;
+ private final QName _operationQName;
private final WsdlOpParameterList _params;
private final SOAPParameterStyle _parameterStyle;
private final String _soapAction;
@@ -69,13 +69,13 @@
/**
* Create a new wsdl operation instance for the specified binding and operation.
*
- * @param binding Binding for the operation.
- * @param op The operation.
- * @param wsdlTypes
+ * @param binding Binding for the operation.
+ * @param op The operation.
+ * @param wsdlTypes WSDL type information.
*/
- WsdlOperation(Binding binding, Operation op, WsdlTypes wsdlTypes) {
+ protected WsdlOperation(Binding binding, Operation op, WsdlTypes wsdlTypes) {
- _operationName = new QName(wsdlTypes.getTargetNamespace(), op.getName());
+ _operationQName = new QName(wsdlTypes.getTargetNamespace(), op.getName());
_oneway = true;
String soapBindingStyle = WsdlUtils.getSOAPBindingStyle(binding);
@@ -120,8 +120,8 @@
*
* @return Operation QName.
*/
- public QName getOperationName() {
- return _operationName;
+ public QName getOperationQName() {
+ return _operationQName;
}
/**
@@ -170,7 +170,7 @@
}
/**
- * Get the XML return type for this operation.
+ * Get the return type for this operation.
*
* @return A WsdlOpReturnType instance, null if this operation does not have a return value.
*/
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlTypes.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlTypes.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlTypes.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlTypes.java Fri Feb 24 09:05:35 2006
@@ -28,29 +28,29 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
/**
+ * WsdlTypes provides utilities for getting information about the <types> section of the WSDL.
*/
public final class WsdlTypes implements Serializable {
private final String _targetNamespace;
- private final Types _wsdlTypes;
+ private final Types _types;
private HashSet<String> _elementFormQualifiedNamespaces;
private Map/*<String, String>*/ _prefixMappings;
private WsdlComplexTypes _namedComplexTypes;
/**
- * Create a new namespace resolver for the specified wsdl definition.
+ * Create a new for WsdlTypes instance for the specified WSDL definition.
*
- * @param wsdlDefinition
+ * @param wsdlDefinition The WSDL definition.
*/
protected WsdlTypes(Definition wsdlDefinition) {
- _wsdlTypes = wsdlDefinition.getTypes();
+ _types = wsdlDefinition.getTypes();
_targetNamespace = wsdlDefinition.getTargetNamespace();
_prefixMappings = wsdlDefinition.getNamespaces();
_elementFormQualifiedNamespaces = new HashSet<String>(getElementFormQualifiedNamespaces());
@@ -58,40 +58,40 @@
}
/**
- * Find the element in its schema from the types section of the WSDL.
+ * Find a named <element> in the types section of the WSDL.
*
* @param elementName Name of element to find.
* @return The element node.
* @throws IllegalArgumentException if element cannot be found in the schema.
*/
- protected Element findSchemaElement(QName elementName) {
+ protected Element findNamedElement(QName elementName) {
Schema s = getSchema(elementName.getNamespaceURI());
Element schemaRoot = s.getElement();
List<Element> elements = DomUtils.getChildElementsByName(schemaRoot, WsdlUtils.ELEMENT_NAME);
- Element schemaElement = null;
+ Element namedElement = null;
for (Element e : elements) {
String schemaElementName = e.getAttribute(WsdlUtils.NAME_ATTR);
if (elementName.getLocalPart().equals(schemaElementName)) {
- schemaElement = e;
+ namedElement = e;
break;
}
}
- if (schemaElement == null) {
+ if (namedElement == null) {
throw new IllegalArgumentException("Could not find element in schema!");
}
- return schemaElement;
+ return namedElement;
}
/**
- * Find a complex or simple type in the schema.
+ * Find a named <complexType> or <simpleType> in the types section of the WSDL.
*
- * @param typeName
+ * @param typeName Name of the type to find.
* @return null if type not found.
*/
- protected Element findSchemaType(QName typeName) {
+ protected Element findNamedType(QName typeName) {
Schema s = getSchema(typeName.getNamespaceURI());
if (s == null) {
@@ -103,18 +103,19 @@
List<Element> types = DomUtils.getChildElementsByName(schemaRoot, WsdlUtils.COMPLEX_TYPE_NAME);
types.addAll(DomUtils.getChildElementsByName(schemaRoot, WsdlUtils.SIMPLE_TYPE_NAME));
- Element schemaType = null;
+ Element namedType = null;
for (Element t : types) {
String schemaTypeName = t.getAttribute(WsdlUtils.NAME_ATTR);
if (typeName.getLocalPart().equals(schemaTypeName)) {
- schemaType = t;
+ namedType = t;
break;
}
}
- return schemaType;
+ return namedType;
}
/**
+ * Get the map of named complex types defined in the WSDL.
*
* @return Wsdl's named complex types.
*/
@@ -156,15 +157,17 @@
* @return A list of javax.wsdl.extension.schema.Schema elements.
*/
protected List getSchemas() {
- if (_wsdlTypes == null) {
+ if (_types == null) {
return Collections.EMPTY_LIST;
}
- return WsdlUtils.findExtensibilityElements(_wsdlTypes, WsdlUtils.SCHEMA_ELEMENT_NAME);
+ return WsdlUtils.findExtensibilityElements(_types, WsdlUtils.SCHEMA_ELEMENT_NAME);
}
/**
- * @param namespaceURI
- * @return true if element form is qualified
+ * Determine if the namespace URI is element form qualifed.
+ *
+ * @param namespaceURI Namespace URI string.
+ * @return true If element form is qualified.
*/
protected boolean isElementFormQualified(String namespaceURI) {
return _elementFormQualifiedNamespaces.contains(namespaceURI);
@@ -200,12 +203,12 @@
*/
private Schema getSchema(String targetNamespace) {
- if (_wsdlTypes == null) {
+ if (_types == null) {
return null;
}
List<ExtensibilityElement> schemas =
- WsdlUtils.findExtensibilityElements(_wsdlTypes, "schema");
+ WsdlUtils.findExtensibilityElements(_types, "schema");
for (ExtensibilityElement e : schemas) {
Element schemaRoot = ((Schema) e).getElement();
Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlUtils.java?rev=380711&r1=380710&r2=380711&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlUtils.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/wsdl/WsdlUtils.java Fri Feb 24 09:05:35 2006
@@ -17,6 +17,7 @@
import java.util.List;
/**
+ * Utilities for getting extensibility elements.
*/
final class WsdlUtils {
@@ -26,44 +27,44 @@
private static final String SOAP_BODY_ELEMENT_NAME = "body";
private static final String SOAP_HEADER_ELEMENT_NAME = "header";
private static final String SOAP_OPERATION_ELEMENT_NAME = "operation";
- static final String SCHEMA_ELEMENT_NAME = "schema";
// return values
- static final String SOAP_BINDING_DEFAULT = "document";
+ private static final String SOAP_BINDING_DEFAULT = "document";
// schema names
- static final String ELEMENT_FORM_DEFAULT_ATTR = "elementFormDefault";
- static final String TARGET_NAMESPACE_ATTR = "targetNamespace";
- static final String ELEMENT_FORM_QUALIFIED = "qualified";
- static final String ELEMENT_NAME = "element";
- static final String COMPLEX_TYPE_NAME = "complexType";
- static final String SEQUENCE_TAG_NAME = "sequence";
- static final String SIMPLE_TYPE_NAME = "simpleType";
- static final String NAME_ATTR = "name";
- static final String ELEMENT_TYPE_ATTR = "type";
- static final String ELEMENT_REF_ATTR = "ref";
- static final String MAXOCCURS_ATTR = "maxOccurs";
- static final String MINOCCURS_ATTR = "minOccurs";
+ protected static final String ELEMENT_FORM_DEFAULT_ATTR = "elementFormDefault";
+ protected static final String TARGET_NAMESPACE_ATTR = "targetNamespace";
+ protected static final String ELEMENT_FORM_QUALIFIED = "qualified";
+ protected static final String ELEMENT_NAME = "element";
+ protected static final String COMPLEX_TYPE_NAME = "complexType";
+ protected static final String SCHEMA_ELEMENT_NAME = "schema";
+ protected static final String SEQUENCE_TAG_NAME = "sequence";
+ protected static final String SIMPLE_TYPE_NAME = "simpleType";
+ protected static final String NAME_ATTR = "name";
+ protected static final String ELEMENT_TYPE_ATTR = "type";
+ protected static final String ELEMENT_REF_ATTR = "ref";
+ protected static final String MAXOCCURS_ATTR = "maxOccurs";
+ protected static final String MINOCCURS_ATTR = "minOccurs";
/**
* Get the SOAP address location for the specified port.
*
- * @param p Port.
- * @return String.
+ * @param p A WSDL Port instance.
+ * @return The SOAP address URI.
*/
- static String getSOAPAddress(Port p) {
+ protected static String getSOAPAddress(Port p) {
ExtensibilityElement e = findExtensibilityElement(p, SOAP_PORT_ADDRESS_NAME);
return ((SOAPAddress) e).getLocationURI();
}
/**
- * Get the SOAPBinding style for the specifed wsdl Port.
+ * Get the SOAPBinding style for the specifed WSDL Port.
*
- * @param binding WSDL binding instance.
- * @return String either 'document' or 'rpc', if not found in WSDL default to 'document'.
+ * @param binding A WSDL Binding instance.
+ * @return String either 'document' or 'rpc', if not found in WSDL defaults to 'document'.
*/
- static String getSOAPBindingStyle(Binding binding) {
+ protected static String getSOAPBindingStyle(Binding binding) {
String style = SOAP_BINDING_DEFAULT;
ExtensibilityElement soapBindingElem =
findExtensibilityElement(binding, SOAP_BINDING_ELEMENT_NAME);
@@ -75,14 +76,14 @@
}
/**
- * Get the Use type for the specified operation.
+ * Get the SOAP Use type for the specified operation.
*
- * @param binding The Binding for the operation.
+ * @param binding A WSDL Binding instance.
* @param operationName The name of the operation.
* @return Either 'literal' or 'encoded'.
* @throws RuntimeException If the use type cannot be determined.
*/
- static String getSOAPBindingUse(Binding binding, String operationName) {
+ protected static String getSOAPBindingUse(Binding binding, String operationName) {
BindingOperation bindingOperation = binding.getBindingOperation(operationName, null, null);
@@ -90,9 +91,7 @@
throw new IllegalArgumentException("Can not find operation: " + operationName);
}
- //
// first try getting the use setting from the input message
- //
BindingInput bindingInput = bindingOperation.getBindingInput();
if (bindingInput != null) {
ExtensibilityElement soapBodyElem =
@@ -100,9 +99,7 @@
return ((SOAPBody) soapBodyElem).getUse();
}
- //
// if there was no input message try getting the use from the output message
- //
BindingOutput bindingOutput = bindingOperation.getBindingOutput();
if (bindingOutput != null) {
ExtensibilityElement soapBodyElem =
@@ -116,10 +113,10 @@
/**
* Get the Soap Action URI from the operation's soap:operation extensiblity element.
*
- * @param operation Operation to the the action uri from.
- * @return Soap action uri as string, null if not defined.
+ * @param operation A WSDL Operation.
+ * @return Soap action URI as string, null if not defined.
*/
- static String getSOAPAction(BindingOperation operation) {
+ protected static String getSOAPAction(BindingOperation operation) {
ExtensibilityElement e = findExtensibilityElement(operation, SOAP_OPERATION_ELEMENT_NAME);
if (e != null) {
return ((SOAPOperation) e).getSoapActionURI();
@@ -128,15 +125,15 @@
}
/**
- * Does this parameter have a parameter style of WRAPPED ? It does if the <tt>name</tt> attribute of
- * the part is NOT the same as its operation name.
+ * Determine if this parameter has a parameter style of WRAPPED. It does if
+ * the <tt>name</tt> attribute of the part is NOT the same as its operation name.
*
* @param operationName Name of the part's operation.
* @param outputParam true if this is an output parameter.
* @param messagePartName Name of the message part.
* @return true if parameter style is wrapped.
*/
- static boolean isWrappedParameterStyle(String operationName, boolean outputParam, String messagePartName) {
+ protected static boolean isWrappedParameterStyle(String operationName, boolean outputParam, String messagePartName) {
if (outputParam) {
if (messagePartName.equals(operationName + "Response")) {
@@ -152,13 +149,13 @@
}
/**
- * Build a HashSet of soap header names for the specified operation and binding.
+ * Build a HashSet of SOAP header names for the specified operation and binding.
*
- * @param binding Binding of the operation.
+ * @param binding WSDL Binding instance.
* @param operationName Name of the operation.
* @return HashSet of soap header names, empty set if no headers present.
*/
- static HashSet<String> getSOAPHeaders(Binding binding, String operationName) {
+ protected static HashSet<String> getSOAPHeaders(Binding binding, String operationName) {
List<ExtensibilityElement> headers = new ArrayList<ExtensibilityElement>();
BindingOperation bindingOperation = binding.getBindingOperation(operationName, null, null);
@@ -188,12 +185,12 @@
* Find the specified extensibility element, if more than one with the specified name exists in the list,
* return the first one found.
*
- * @param extensibleElement
+ * @param extensibleElement WSDL type which extends ElementExtensible.
* @param elementType Name of the extensiblity element to find.
- * @return ExtensibilityElement
+ * @return ExtensibilityElement The ExtensiblityElement, if not found return null.
*/
- static ExtensibilityElement findExtensibilityElement(ElementExtensible extensibleElement,
- String elementType) {
+ protected static ExtensibilityElement findExtensibilityElement(ElementExtensible extensibleElement,
+ String elementType) {
List extensibilityElements = extensibleElement.getExtensibilityElements();
if (extensibilityElements != null) {
@@ -210,12 +207,12 @@
/**
* Find all of the extensibility elements with the specified name.
*
- * @param elementType
- * @param elementType Name of the extensiblity element to find.
+ * @param extensibleElement WSDL type which extends ElementExtensible.
+ * @param elementType Name of the extensiblity element to find.
* @return List of ExtensibilityElements, may be empty.
*/
- static List<ExtensibilityElement> findExtensibilityElements(ElementExtensible extensibleElement,
- String elementType) {
+ protected static List<ExtensibilityElement> findExtensibilityElements(ElementExtensible extensibleElement,
+ String elementType) {
ArrayList<ExtensibilityElement> elements = new ArrayList<ExtensibilityElement>();
List extensibilityElements = extensibleElement.getExtensibilityElements();
@@ -223,7 +220,6 @@
if (extensibilityElements != null) {
for (Object o : extensibilityElements) {
ExtensibilityElement element = (ExtensibilityElement) o;
-
if (element.getElementType().getLocalPart().equalsIgnoreCase(elementType)) {
elements.add(element);
}