gdaniels 02/03/24 20:44:02
Modified: java/src/org/apache/axis Constants.java MessageContext.java
java/src/org/apache/axis/description ParameterDesc.java
ServiceDesc.java
java/src/org/apache/axis/encoding
DeserializationContextImpl.java
DeserializerImpl.java
java/src/org/apache/axis/encoding/ser ArrayDeserializer.java
java/src/org/apache/axis/handlers/soap SOAPService.java
java/src/org/apache/axis/message BodyBuilder.java
EnvelopeBuilder.java MessageElement.java
SOAPEnvelope.java SOAPHeader.java
java/src/org/apache/axis/providers/java JavaProvider.java
java/src/org/apache/axis/utils resources.properties
Added: java/src/org/apache/axis/soap SOAP11Constants.java
SOAP12Constants.java SOAPConstants.java
Log:
* Start work on making the engine SOAP 1.2 and SOAP 1.1 compliant.
Introduce the SOAPConstants interface (org.apache.axis.soap.SOAPConstants)
which keeps track of the namespaces/qnames/etc associated with a particular
SOAP version. The MessageContext will always be associated with one of
these (default is 1.1). Now as we parse the envelope we note the SOAP
version in the MessageContext, so that we'll process things correctly.
The SOAPEnvelope also keeps a reference to its SOAPConstants for speedy
lookup.
* Automatically reply in the correct SOAP version to match the request
* Make Constants.getValue() a little more comprehensible/fast by
directly passing in the arrays to search, instead of doing an internal
lookup.
* Add allowedMethods to ServiceDesc
* Add a message to the IllegalArgumentException thrown in ParameterDesc
The variable SOAP version stuff needs some more fleshing out, but this
gets us some of the way there. Now that the MessageContext has a switch
for SOAP version (i.e. "if mc.getSOAPConstants() == SOAPConstants.
SOAP_11_CONSTANTS") we can do version-specific processing easily. Need to
think about + discuss the scope of our plans for this stuff (do we want to
allow version-specific services, or even version-specific server
configurations, etc).
Revision Changes Path
1.57 +11 -21 xml-axis/java/src/org/apache/axis/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Constants.java 13 Mar 2002 15:20:01 -0000 1.56
+++ Constants.java 25 Mar 2002 04:44:01 -0000 1.57
@@ -139,37 +139,27 @@
}
/**
- * getValue
- * This utility routine returns the value of the attribute represented by the
qname
- * namespaceURI:localPart. If the namespaceURI is one of the current known
namespaces
- * (like URI_CURRENT_SCHEMA_XSD), then all of the known qnames for this item
are
- * searched.
- * @param attributes are the attributes to search
- * @param namespaceURI is the current known namespace for the attribute name
+ * This utility routine returns the value of an attribute which might
+ * be in one of several namespaces.
+ *
+ * @param attributes the attributes to search
+ * @param search an array of namespace URI strings to search
* @param localPart is the local part of the attribute name
* @return the value of the attribute or null
*/
- public static String getValue(Attributes attributes, String namespaceURI,
String localPart) {
- if (attributes == null || namespaceURI == null || localPart == null)
+ public static String getValue(Attributes attributes,
+ String [] search,
+ String localPart) {
+ if (attributes == null || search == null || localPart == null)
return null;
- String[] search = null;
- if (namespaceURI.equals(URI_CURRENT_SOAP_ENC))
- search = URIS_SOAP_ENC;
- else if (namespaceURI.equals(URI_CURRENT_SOAP_ENV))
- search = URIS_SOAP_ENV;
- else if (namespaceURI.equals(URI_CURRENT_SCHEMA_XSD))
- search = URIS_SCHEMA_XSD;
- else if (namespaceURI.equals(URI_CURRENT_SCHEMA_XSI))
- search = URIS_SCHEMA_XSI;
- else
- search = new String[] {namespaceURI};
- // Now look for an attribute value
+
for (int i=0; i < search.length; i++) {
String value = attributes.getValue(search[i], localPart);
if (value != null) {
return value;
}
}
+
return null;
}
1.86 +16 -0 xml-axis/java/src/org/apache/axis/MessageContext.java
Index: MessageContext.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- MessageContext.java 21 Mar 2002 16:07:43 -0000 1.85
+++ MessageContext.java 25 Mar 2002 04:44:01 -0000 1.86
@@ -63,6 +63,8 @@
import org.apache.axis.utils.LockableHashtable;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ServiceDesc;
+import org.apache.axis.soap.SOAPConstants;
+import org.apache.axis.soap.SOAP11Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -177,6 +179,9 @@
private String SOAPActionURI = null;
private String encodingStyle = Constants.URI_CURRENT_SOAP_ENC;
+ /** Our SOAP namespaces and such - defaults to SOAP 1.1 */
+ private SOAPConstants soapConstants = new SOAP11Constants();
+
/**
* Are we using SOAP encoding? Default is true for RPC services,
* should be set to false for document/literal.
@@ -300,6 +305,17 @@
public void setTransportName(String transportName)
{
this.transportName = transportName;
+ }
+
+ /**
+ * SOAP constants
+ */
+ public SOAPConstants getSOAPConstants() {
+ return soapConstants;
+ }
+
+ public void setSOAPConstants(SOAPConstants soapConstants) {
+ this.soapConstants = soapConstants;
}
/**
1.3 +3 -2 xml-axis/java/src/org/apache/axis/description/ParameterDesc.java
Index: ParameterDesc.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/description/ParameterDesc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParameterDesc.java 23 Mar 2002 02:18:18 -0000 1.2
+++ ParameterDesc.java 25 Mar 2002 04:44:01 -0000 1.3
@@ -55,6 +55,7 @@
package org.apache.axis.description;
import org.apache.axis.wsdl.toJava.TypeEntry;
+import org.apache.axis.utils.JavaUtils;
import javax.xml.rpc.namespace.QName;
import java.util.Vector;
@@ -117,8 +118,8 @@
return "in";
}
- // FIXME - needs message
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException(
+ JavaUtils.getMessage("badParameterMode", Byte.toString(mode)));
}
public QName getQName() {
1.5 +70 -52 xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
Index: ServiceDesc.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ServiceDesc.java 23 Mar 2002 15:54:24 -0000 1.4
+++ ServiceDesc.java 25 Mar 2002 04:44:01 -0000 1.5
@@ -81,58 +81,9 @@
/** This becomes true once we've added some operations */
private boolean hasOperationData = false;
- /**
- * Fill in what we can of the service description by introspecting a
- * Java class. Only do this if we haven't already been filled in.
- */
- public void loadServiceDescByIntrospection(Class jc, TypeMapping tm)
- {
- if (hasOperationData)
- return;
-
- ArrayList allowedMethods = null;
- Method [] methods = jc.getDeclaredMethods();
-
- for (int i = 0; i < methods.length; i++) {
- String methodName = methods[i].getName();
-
- // Skip it if it's not allowed
- // FIXME : Should NEVER allow java.lang methods to be
- // called directly, right?
- if ((allowedMethods != null) &&
- !allowedMethods.contains(methodName))
- continue;
-
- // Make an OperationDesc for each method
- Method method = methods[i];
- OperationDesc operation = new OperationDesc();
- operation.setName(methodName);
- Class [] paramTypes = method.getParameterTypes();
- String [] paramNames =
- JavaUtils.getParameterNamesFromDebugInfo(method);
- for (int k = 0; k < paramTypes.length; k++) {
- Class type = paramTypes[k];
- ParameterDesc paramDesc = new ParameterDesc();
- if (paramNames != null) {
- paramDesc.setName(paramNames[k+1]);
- } else {
- paramDesc.setName("in" + k);
- }
- Class heldClass = JavaUtils.getHolderValueType(type);
- if (heldClass != null) {
- paramDesc.setMode(ParameterDesc.INOUT);
- paramDesc.setTypeQName(tm.getTypeQName(heldClass));
- } else {
- paramDesc.setMode(ParameterDesc.IN);
- paramDesc.setTypeQName(tm.getTypeQName(type));
- }
- operation.addParameter(paramDesc);
- }
- addOperationDesc(operation);
- }
-
- hasOperationData = true;
- }
+ /** List of allowed methods */
+ /** null allows everything, an empty ArrayList allows nothing */
+ private ArrayList allowedMethods = null;
/** Style */
private int style = STYLE_RPC;
@@ -164,6 +115,12 @@
private HashMap name2OperationsMap = null;
private HashMap qname2OperationMap = null;
+ /**
+ * Default constructor
+ */
+ public ServiceDesc() {
+ }
+
public int getStyle() {
return style;
}
@@ -194,6 +151,14 @@
this.wsdlFileName = wsdlFileName;
}
+ public ArrayList getAllowedMethods() {
+ return allowedMethods;
+ }
+
+ public void setAllowedMethods(ArrayList allowedMethods) {
+ this.allowedMethods = allowedMethods;
+ }
+
public void addOperationDesc(OperationDesc operation)
{
operations.add(operation);
@@ -278,5 +243,58 @@
}
return (OperationDesc)qname2OperationMap.get(qname);
+ }
+
+ /**
+ * Fill in what we can of the service description by introspecting a
+ * Java class. Only do this if we haven't already been filled in.
+ */
+ public void loadServiceDescByIntrospection(Class jc, TypeMapping tm)
+ {
+ if (hasOperationData)
+ return;
+
+ Method [] methods = jc.getDeclaredMethods();
+
+ for (int i = 0; i < methods.length; i++) {
+ String methodName = methods[i].getName();
+
+ // Skip it if it's not allowed
+ // FIXME : This should, if allowedMethods is null, search up the
+ // inheritance/interface tree until we get to stop
+ // classes?
+ if ((allowedMethods != null) &&
+ !allowedMethods.contains(methodName))
+ continue;
+
+ // Make an OperationDesc for each method
+ Method method = methods[i];
+ OperationDesc operation = new OperationDesc();
+ operation.setName(methodName);
+ Class [] paramTypes = method.getParameterTypes();
+ String [] paramNames =
+ JavaUtils.getParameterNamesFromDebugInfo(method);
+ for (int k = 0; k < paramTypes.length; k++) {
+ Class type = paramTypes[k];
+ ParameterDesc paramDesc = new ParameterDesc();
+ if (paramNames != null) {
+ paramDesc.setName(paramNames[k+1]);
+ } else {
+ paramDesc.setName("in" + k);
+ }
+ Class heldClass = JavaUtils.getHolderValueType(type);
+ if (heldClass != null) {
+ paramDesc.setMode(ParameterDesc.INOUT);
+ paramDesc.setTypeQName(tm.getTypeQName(heldClass));
+ } else {
+ paramDesc.setMode(ParameterDesc.IN);
+ paramDesc.setTypeQName(tm.getTypeQName(type));
+ }
+ operation.addParameter(paramDesc);
+ }
+ addOperationDesc(operation);
+ }
+
+ hasOperationData = true;
}
}
1.19 +6 -3
xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java
Index: DeserializationContextImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DeserializationContextImpl.java 21 Mar 2002 17:21:12 -0000 1.18
+++ DeserializationContextImpl.java 25 Mar 2002 04:44:01 -0000 1.19
@@ -156,7 +156,8 @@
public DeserializationContextImpl(InputSource is, MessageContext ctx,
String messageType)
{
- EnvelopeBuilder builder = new EnvelopeBuilder(messageType);
+ EnvelopeBuilder builder = new EnvelopeBuilder(messageType,
+ ctx.getSOAPConstants());
msgContext = ctx;
@@ -316,7 +317,8 @@
QName typeQName = null;
// Check for type
- String type = Constants.getValue(attrs, Constants.URI_CURRENT_SCHEMA_XSI,
"type");
+ String type = Constants.getValue(attrs, Constants.URIS_SCHEMA_XSI,
+ "type");
if (type != null) {
// Return the type attribute value converted to a QName
return getQNameFromString(type);
@@ -381,7 +383,8 @@
if (attrs == null) {
return false;
}
- String nil = Constants.getValue(attrs, Constants.URI_CURRENT_SCHEMA_XSI,
"nil");
+ String nil = Constants.getValue(attrs, Constants.URIS_SCHEMA_XSI,
+ "nil");
return (nil != null && nil.equals("true"));
}
1.7 +3 -1 xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java
Index: DeserializerImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializerImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DeserializerImpl.java 14 Mar 2002 04:20:52 -0000 1.6
+++ DeserializerImpl.java 25 Mar 2002 04:44:01 -0000 1.7
@@ -320,7 +320,9 @@
{
// If the xsi:nil attribute, set the value to null and return since
// there is nothing to deserialize.
- String nil = Constants.getValue(attributes,
Constants.URI_CURRENT_SCHEMA_XSI, "nil");
+ String nil = Constants.getValue(attributes,
+ Constants.URIS_SCHEMA_XSI,
+ "nil");
if (nil != null && nil.equals("true")) {
value = null;
isNil = true;
1.9 +3 -3
xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
Index: ArrayDeserializer.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ArrayDeserializer.java 6 Mar 2002 19:35:49 -0000 1.8
+++ ArrayDeserializer.java 25 Mar 2002 04:44:02 -0000 1.9
@@ -173,7 +173,7 @@
// Now get the arrayType value
QName arrayTypeValue = context.getQNameFromString(
Constants.getValue(attributes,
- Constants.URI_CURRENT_SOAP_ENC,
+ Constants.URIS_SOAP_ENC,
Constants.ATTR_ARRAY_TYPE));
// The first part of the arrayType expression is
@@ -316,7 +316,7 @@
// If soapenc:offset specified, set the current index accordingly
String offset = Constants.getValue(attributes,
- Constants.URI_CURRENT_SOAP_ENC,
+ Constants.URIS_SOAP_ENC,
Constants.ATTR_OFFSET);
if (offset != null) {
int leftBracketIndex = offset.lastIndexOf('[');
@@ -373,7 +373,7 @@
if (attributes != null) {
String pos =
Constants.getValue(attributes,
- Constants.URI_CURRENT_SOAP_ENC,
+ Constants.URIS_SOAP_ENC,
Constants.ATTR_POSITION);
if (pos != null) {
int leftBracketIndex = pos.lastIndexOf('[');
1.53 +5 -9 xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
Index: SOAPService.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- SOAPService.java 22 Mar 2002 16:08:32 -0000 1.52
+++ SOAPService.java 25 Mar 2002 04:44:02 -0000 1.53
@@ -120,7 +120,7 @@
* Our ServiceDescription. Holds pretty much all the interesting
* metadata about this service.
*/
- private ServiceDesc serviceDescription = null;
+ private ServiceDesc serviceDescription = new ServiceDesc();
/**
* SOAPRequestHandler is used to inject SOAP semantics just before
@@ -255,18 +255,10 @@
}
public int getStyle() {
- if (serviceDescription == null) {
- serviceDescription = new ServiceDesc();
- }
-
return serviceDescription.getStyle();
}
public void setStyle(int style) {
- if (serviceDescription == null) {
- serviceDescription = new ServiceDesc();
- }
-
serviceDescription.setStyle(style);
}
@@ -275,6 +267,10 @@
}
public void setServiceDescription(ServiceDesc serviceDescription) {
+ if (serviceDescription == null) {
+ // FIXME: Throw NPE?
+ return;
+ }
this.serviceDescription = serviceDescription;
}
1.24 +1 -1 xml-axis/java/src/org/apache/axis/message/BodyBuilder.java
Index: BodyBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/BodyBuilder.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- BodyBuilder.java 5 Mar 2002 14:02:13 -0000 1.23
+++ BodyBuilder.java 25 Mar 2002 04:44:02 -0000 1.24
@@ -127,7 +127,7 @@
* b) have a non-RPC service
*/
if (localName.equals(Constants.ELEM_FAULT) &&
- namespace.equals(Constants.URI_SOAP_ENV)) {
+ namespace.equals(msgContext.getSOAPConstants().getEnvelopeURI())) {
element = new SOAPFaultElement(namespace, localName, prefix,
attributes, context);
handler = new SOAPFaultBuilder((SOAPFaultElement)element,
1.14 +25 -15 xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java
Index: EnvelopeBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- EnvelopeBuilder.java 7 Nov 2001 19:00:42 -0000 1.13
+++ EnvelopeBuilder.java 25 Mar 2002 04:44:02 -0000 1.14
@@ -60,6 +60,9 @@
*/
import org.apache.axis.Constants;
+import org.apache.axis.soap.SOAPConstants;
+import org.apache.axis.soap.SOAP11Constants;
+import org.apache.axis.soap.SOAP12Constants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.utils.JavaUtils;
import org.xml.sax.Attributes;
@@ -71,18 +74,14 @@
{
private MessageElement element;
private SOAPEnvelope envelope;
-
+ private SOAPConstants soapConstants = SOAPConstants.SOAP11_CONSTANTS;
+
private boolean gotHeader = false;
private boolean gotBody = false;
-
- private static final QName headerQName = new QName(Constants.URI_SOAP_ENV,
- Constants.ELEM_HEADER);
- private static final QName bodyQName = new QName(Constants.URI_SOAP_ENV,
- Constants.ELEM_BODY);
-
- public EnvelopeBuilder(String messageType)
+
+ public EnvelopeBuilder(String messageType, SOAPConstants soapConstants)
{
- envelope = new SOAPEnvelope(false);
+ envelope = new SOAPEnvelope(false, soapConstants);
envelope.setMessageType(messageType);
myElement = envelope;
}
@@ -104,14 +103,25 @@
DeserializationContext context)
throws SAXException
{
- if (!namespace.equals(Constants.URI_SOAP_ENV))
- throw new SAXException(
- JavaUtils.getMessage("badNamespace00", namespace));
-
if (!localName.equals(Constants.ELEM_ENVELOPE))
throw new SAXException(
JavaUtils.getMessage("badTag00", localName));
+ if (namespace.equals(Constants.URI_SOAP_ENV)) {
+ // SOAP 1.1
+ soapConstants = SOAPConstants.SOAP11_CONSTANTS;
+ } else if (namespace.equals(Constants.URI_SOAP12_ENV)) {
+ // SOAP 1.2
+ soapConstants = SOAPConstants.SOAP12_CONSTANTS;
+ } else {
+ throw new SAXException(
+ JavaUtils.getMessage("badNamespace00", namespace));
+ }
+
+ // Indicate what version of SOAP we're using to anyone else involved
+ // in processing this message.
+ context.getMessageContext().setSOAPConstants(soapConstants);
+
String prefix = "";
int idx = qName.indexOf(":");
if (idx > 0)
@@ -131,7 +141,7 @@
throws SAXException
{
QName thisQName = new QName(namespace, localName);
- if (thisQName.equals(headerQName)) {
+ if (thisQName.equals(soapConstants.getHeaderQName())) {
if (gotHeader)
throw new SAXException(JavaUtils.getMessage("only1Header00"));
@@ -139,7 +149,7 @@
return new HeaderBuilder(envelope);
}
- if (thisQName.equals(bodyQName)) {
+ if (thisQName.equals(soapConstants.getBodyQName())) {
if (gotBody)
throw new SAXException(JavaUtils.getMessage("only1Body00"));
1.89 +5 -2 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- MessageElement.java 15 Mar 2002 10:19:35 -0000 1.88
+++ MessageElement.java 25 Mar 2002 04:44:02 -0000 1.89
@@ -57,6 +57,7 @@
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
+import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.SerializationContext;
@@ -619,15 +620,17 @@
* whatever encoding style is in scope....
*/
if (encodingStyle != null) {
+ SOAPConstants soapConstants = context.getMessageContext().
+ getSOAPConstants();
if (parent == null) {
// don't emit an encoding style if its "" (literal)
if (!encodingStyle.equals("")) {
- setAttribute(Constants.URI_CURRENT_SOAP_ENV,
+ setAttribute(soapConstants.getEnvelopeURI(),
Constants.ATTR_ENCODING_STYLE,
encodingStyle);
}
} else if (!encodingStyle.equals(parent.getEncodingStyle())) {
- setAttribute(Constants.URI_CURRENT_SOAP_ENV,
+ setAttribute(soapConstants.getEnvelopeURI(),
Constants.ATTR_ENCODING_STYLE,
encodingStyle);
}
1.59 +17 -8 xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
Index: SOAPEnvelope.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- SOAPEnvelope.java 25 Feb 2002 17:38:16 -0000 1.58
+++ SOAPEnvelope.java 25 Mar 2002 04:44:02 -0000 1.59
@@ -58,6 +58,7 @@
import org.apache.axis.Constants;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
+import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.configuration.NullProvider;
import org.apache.axis.client.AxisClient;
import org.apache.axis.encoding.DeserializationContext;
@@ -87,6 +88,7 @@
public Vector headers = new Vector();
public Vector bodyElements = new Vector();
public Vector trailers = new Vector();
+ private SOAPConstants soapConstants;
// This is a hint to any service description to tell it what
// "type" of message we are. This might be "request", "response",
@@ -98,16 +100,23 @@
public SOAPEnvelope()
{
- this(true);
+ this(true, SOAPConstants.SOAP11_CONSTANTS);
}
-
- public SOAPEnvelope(boolean registerPrefixes)
+
+ public SOAPEnvelope(SOAPConstants soapConstants)
+ {
+ this(true, soapConstants);
+ }
+
+ public SOAPEnvelope(boolean registerPrefixes, SOAPConstants soapConstants)
{
+ this.soapConstants = soapConstants;
+
if (registerPrefixes) {
if (namespaces == null)
namespaces = new ArrayList();
-
- namespaces.add(new Mapping(Constants.URI_SOAP_ENV,
+
+ namespaces.add(new Mapping(soapConstants.getEnvelopeURI(),
Constants.NSPREFIX_SOAP_ENV));
namespaces.add(new Mapping(Constants.URI_CURRENT_SCHEMA_XSD,
Constants.NSPREFIX_SCHEMA_XSD));
@@ -392,7 +401,7 @@
Enumeration enum;
- context.startElement(new QName(Constants.URI_SOAP_ENV,
+ context.startElement(new QName(soapConstants.getEnvelopeURI(),
Constants.ELEM_ENVELOPE), attributes);
if (log.isDebugEnabled())
@@ -401,7 +410,7 @@
if (!headers.isEmpty()) {
// Output <SOAP-ENV:Header>
- context.startElement(new QName(Constants.URI_SOAP_ENV,
+ context.startElement(new QName(soapConstants.getEnvelopeURI(),
Constants.ELEM_HEADER), null);
enum = headers.elements();
while (enum.hasMoreElements()) {
@@ -421,7 +430,7 @@
}
// Output <SOAP-ENV:Body>
- context.startElement(new QName(Constants.URI_SOAP_ENV,
+ context.startElement(new QName(soapConstants.getEnvelopeURI(),
Constants.ELEM_BODY), null);
enum = bodyElements.elements();
while (enum.hasMoreElements()) {
1.36 +12 -2 xml-axis/java/src/org/apache/axis/message/SOAPHeader.java
Index: SOAPHeader.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeader.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- SOAPHeader.java 14 Mar 2002 17:26:26 -0000 1.35
+++ SOAPHeader.java 25 Mar 2002 04:44:02 -0000 1.36
@@ -55,6 +55,7 @@
package org.apache.axis.message;
import org.apache.axis.Constants;
+import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.SerializationContext;
import org.w3c.dom.Element;
@@ -104,12 +105,15 @@
Attributes attributes, DeserializationContext context) {
super(namespace, localPart, prefix, attributes, context);
+ SOAPConstants soapConstants = context.getMessageContext().
+ getSOAPConstants();
+
// Check for mustUnderstand
- String val = attributes.getValue(Constants.URI_SOAP_ENV,
+ String val = attributes.getValue(soapConstants.getEnvelopeURI(),
Constants.ATTR_MUST_UNDERSTAND);
mustUnderstand = ((val != null) && val.equals("1")) ? true : false;
- actor = attributes.getValue(Constants.URI_SOAP_ENV,
+ actor = attributes.getValue(soapConstants.getEnvelopeURI(),
Constants.ATTR_ACTOR);
processed = false;
@@ -119,6 +123,9 @@
public void setMustUnderstand(boolean b) {
mustUnderstand = b ;
String val = b ? "1" : "0";
+
+ // Instead of doing this can we hang out until serialization time
+ // and do it there, so that we can then resolve SOAP version?
setAttribute(Constants.URI_SOAP_ENV,
Constants.ATTR_MUST_UNDERSTAND,
val);
@@ -127,6 +134,9 @@
public String getActor() { return( actor ); }
public void setActor(String a) {
actor = a ;
+
+ // Instead of doing this can we hang out until serialization time
+ // and do it there, so that we can then resolve SOAP version?
setAttribute(Constants.URI_SOAP_ENV, Constants.ATTR_ACTOR, a);
}
1.45 +2 -1
xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
Index: JavaProvider.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- JavaProvider.java 15 Mar 2002 05:07:10 -0000 1.44
+++ JavaProvider.java 25 Mar 2002 04:44:02 -0000 1.45
@@ -242,7 +242,8 @@
SOAPEnvelope reqEnv = (SOAPEnvelope)reqMsg.getSOAPEnvelope();
Message resMsg = msgContext.getResponseMessage();
SOAPEnvelope resEnv = (resMsg == null) ?
- new SOAPEnvelope() :
+ new SOAPEnvelope(msgContext.
+ getSOAPConstants()) :
(SOAPEnvelope)resMsg.getSOAPEnvelope();
// get the response message again! It may have been explicitly set!
1.1 xml-axis/java/src/org/apache/axis/soap/SOAP11Constants.java
Index: SOAP11Constants.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.soap;
import org.apache.axis.Constants;
import javax.xml.rpc.namespace.QName;
/**
* SOAP 1.1 constants
*
* @author Glen Daniels ([EMAIL PROTECTED])
*/
public class SOAP11Constants implements SOAPConstants {
private static QName headerQName = new QName(Constants.URI_SOAP_ENV,
Constants.ELEM_HEADER);
private static QName bodyQName = new QName(Constants.URI_SOAP_ENV,
Constants.ELEM_BODY);
private static QName faultQName = new QName(Constants.URI_SOAP_ENV,
Constants.ELEM_FAULT);
public String getEnvelopeURI() {
return Constants.URI_SOAP_ENV;
}
public String getEncodingURI() {
return Constants.URI_SOAP_ENC;
}
public QName getHeaderQName() {
return headerQName;
}
public QName getBodyQName() {
return bodyQName;
}
public QName getFaultQName() {
return faultQName;
}
}
1.1 xml-axis/java/src/org/apache/axis/soap/SOAP12Constants.java
Index: SOAP12Constants.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.soap;
import org.apache.axis.Constants;
import javax.xml.rpc.namespace.QName;
/**
* SOAP 1.2 constants
*
* @author Glen Daniels ([EMAIL PROTECTED])
*/
public class SOAP12Constants implements SOAPConstants {
private static QName headerQName = new QName(Constants.URI_SOAP12_ENV,
Constants.ELEM_HEADER);
private static QName bodyQName = new QName(Constants.URI_SOAP12_ENV,
Constants.ELEM_BODY);
private static QName faultQName = new QName(Constants.URI_SOAP12_ENV,
Constants.ELEM_FAULT);
public String getEnvelopeURI() {
return Constants.URI_SOAP12_ENV;
}
public String getEncodingURI() {
return Constants.URI_SOAP12_ENC;
}
public QName getHeaderQName() {
return headerQName;
}
public QName getBodyQName() {
return bodyQName;
}
public QName getFaultQName() {
return faultQName;
}
}
1.1 xml-axis/java/src/org/apache/axis/soap/SOAPConstants.java
Index: SOAPConstants.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.axis.soap;
import javax.xml.rpc.namespace.QName;
/**
* An interface definining SOAP constants. This allows various parts of the
* engine to avoid hardcoding dependence on a particular SOAP version and its
* associated URIs, etc.
*
* This might be fleshed out later to encapsulate factories for behavioral
* objects which act differently depending on the SOAP version, but for now
* it just supplies common namespaces + QNames.
*
* @author Glen Daniels ([EMAIL PROTECTED])
*/
public interface SOAPConstants {
/** SOAP 1.1 constants - thread-safe and shared */
public SOAP11Constants SOAP11_CONSTANTS = new SOAP11Constants();
/** SOAP 1.2 constants - thread-safe and shared */
public SOAP12Constants SOAP12_CONSTANTS = new SOAP12Constants();
/**
* Obtain the envelope namespace for this version of SOAP
*/
public String getEnvelopeURI();
/**
* Obtain the encoding namespace for this version of SOAP
*/
public String getEncodingURI();
/**
* Obtain the QName for the Fault element
*/
public QName getFaultQName();
/**
* Obtain the QName for the Header element
*/
public QName getHeaderQName();
/**
* Obtain the QName for the Body element
*/
public QName getBodyQName();
}
1.85 +3 -1 xml-axis/java/src/org/apache/axis/utils/resources.properties
Index: resources.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- resources.properties 24 Mar 2002 18:51:29 -0000 1.84
+++ resources.properties 25 Mar 2002 04:44:02 -0000 1.85
@@ -721,7 +721,7 @@
# NOTE: in badMaxCache, do not translate "maxCached".
badMaxCached=maxCached value is bad: {0}
-
+
maxCached=ManagedMemoryDataSource.flushToDisk maximum cached {0}, total memory {1}.
diskCache=Disk cache file name "{0}".
resourceDeleted=Resource has been deleted.
@@ -791,5 +791,7 @@
optionFactory00=name of the JavaWriterFactory class for extending Java generation
functions
optionHelper00=emits separate Helper classes for meta data
+
+badParameterMode=Invalid parameter mode byte ({0}) passed to getModeAsString().
attach.bounday.mns=Marking streams not supported.