You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2003/03/02 03:55:25 UTC
cvs commit: xml-axis/java/test/wsdl/soap12/additional Soap12AddTestRpcBindingImpl.java WhiteMesaSoap12AddTestSvcTestCase.java build.xml
gdaniels 2003/03/01 18:55:25
Modified: java/src/org/apache/axis Tag: gd-soapbuilders
MessageContext.java
java/src/org/apache/axis/description Tag: gd-soapbuilders
ServiceDesc.java
java/src/org/apache/axis/encoding/ser Tag: gd-soapbuilders
JAFDataHandlerDeserializer.java
java/src/org/apache/axis/message Tag: gd-soapbuilders
BodyBuilder.java Detail.java EnvelopeBuilder.java
HeaderBuilder.java MessageElement.java
RPCElement.java RPCHandler.java SOAPBody.java
SOAPBodyElement.java SOAPFault.java
SOAPHandler.java SOAPHeader.java
SOAPHeaderElement.java
java/src/org/apache/axis/providers/java Tag: gd-soapbuilders
RPCProvider.java
java/src/org/apache/axis/transport/http Tag: gd-soapbuilders
SimpleAxisWorker.java
java/src/org/apache/axis/types Tag: gd-soapbuilders
IDRefs.java NMTokens.java
java/src/org/apache/axis/wsdl/toJava Tag: gd-soapbuilders
Utils.java
java/test/wsdl/interop5/basetype Tag: gd-soapbuilders
BaseTypesInteropTestsTestCase.java
java/test/wsdl/soap12/additional Tag: gd-soapbuilders
Soap12AddTestRpcBindingImpl.java
WhiteMesaSoap12AddTestSvcTestCase.java build.xml
Log:
Putting SOAP 1.2 work on a branch so I can easily move it to my
home machine from my laptop. :)
Revision Changes Path
No revision
No revision
1.128.4.1 +8 -1 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.128
retrieving revision 1.128.4.1
diff -u -r1.128 -r1.128.4.1
--- MessageContext.java 10 Jan 2003 06:38:56 -0000 1.128
+++ MessageContext.java 2 Mar 2003 02:55:23 -0000 1.128.4.1
@@ -256,9 +256,11 @@
ServiceDesc desc = serviceHandler.getInitializedServiceDesc(this);
if (desc != null) {
- if (desc.getStyle() != Style.DOCUMENT) {
+ if (desc.getStyle() != null) {
possibleOperations = desc.getOperationsByQName(qname);
} else {
+ // SBFIX : What the hell is this?
+
// DOCUMENT Style
// Get all of the operations that have qname as
// a possible parameter QName
@@ -761,6 +763,11 @@
/** The directory where in coming attachments are created. */
public final static String ATTACHMENTS_DIR = "attachments.directory" ;
+
+ /** A boolean param, to control whether we accept missing parameters
+ * as nulls or refuse to acknowledge them.
+ */
+ public final static String ACCEPTMISSINGPARAMS = "acceptMissingParams";
/** The value of the property is used by service WSDL generation (aka ?WSDL)
* For the service's interface namespace if not set TRANS_URL property is used.
No revision
No revision
1.72.4.1 +1 -8 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.72
retrieving revision 1.72.4.1
diff -u -r1.72 -r1.72.4.1
--- ServiceDesc.java 19 Feb 2003 13:37:31 -0000 1.72
+++ ServiceDesc.java 2 Mar 2003 02:55:23 -0000 1.72.4.1
@@ -79,14 +79,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
+import java.util.*;
/**
No revision
No revision
1.18.4.1 +6 -1 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java
Index: JAFDataHandlerDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java,v
retrieving revision 1.18
retrieving revision 1.18.4.1
diff -u -r1.18 -r1.18.4.1
--- JAFDataHandlerDeserializer.java 20 Dec 2002 17:28:20 -0000 1.18
+++ JAFDataHandlerDeserializer.java 2 Mar 2003 02:55:23 -0000 1.18.4.1
@@ -62,6 +62,7 @@
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.Messages;
import org.apache.axis.soap.SOAPConstants;
+import org.apache.axis.AxisFault;
import org.apache.commons.logging.Log;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -84,7 +85,11 @@
if (!context.isDoneParsing()) {
if (myElement == null) {
- myElement = makeNewElement(namespace, localName, prefix, attributes, context);
+ try {
+ myElement = makeNewElement(namespace, localName, prefix, attributes, context);
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
context.pushNewElement(myElement);
}
}
No revision
No revision
1.56.4.1 +44 -10 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.56
retrieving revision 1.56.4.1
diff -u -r1.56 -r1.56.4.1
--- BodyBuilder.java 3 Feb 2003 03:46:22 -0000 1.56
+++ BodyBuilder.java 2 Mar 2003 02:55:23 -0000 1.56.4.1
@@ -111,8 +111,12 @@
if (!context.isDoneParsing()) {
if (!context.isProcessingRef()) {
if (myElement == null) {
- myElement = new SOAPBody(namespace, localName, prefix,
- attributes, context, envelope.getSOAPConstants());
+ try {
+ myElement = new SOAPBody(namespace, localName, prefix,
+ attributes, context, envelope.getSOAPConstants());
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
}
context.pushNewElement(myElement);
}
@@ -123,7 +127,8 @@
// FIX: do we need this method ?
public MessageElement makeNewElement(String namespace, String localName,
String prefix, Attributes attributes,
- DeserializationContext context) {
+ DeserializationContext context)
+ throws AxisFault {
SOAPConstants soapConstants = context.getMessageContext() == null ?
SOAPConstants.SOAP11_CONSTANTS :
context.getMessageContext().getSOAPConstants();
@@ -180,6 +185,9 @@
}
Style style = operations == null ? Style.RPC : operations[0].getStyle();
+ SOAPConstants soapConstants = context.getMessageContext() == null ?
+ SOAPConstants.SOAP11_CONSTANTS :
+ context.getMessageContext().getSOAPConstants();
/** Now we make a plain SOAPBodyElement IF we either:
* a) have an non-root element, or
@@ -187,8 +195,12 @@
*/
if (localName.equals(Constants.ELEM_FAULT) &&
namespace.equals(msgContext.getSOAPConstants().getEnvelopeURI())) {
- element = new SOAPFault(namespace, localName, prefix,
- attributes, context);
+ try {
+ element = new SOAPFault(namespace, localName, prefix,
+ attributes, context);
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
element.setEnvelope(context.getEnvelope());
handler = new SOAPFaultBuilder((SOAPFault)element,
context);
@@ -208,6 +220,27 @@
throw new SAXException(e);
}
+ // SBFIX : If we're here with no operations, we're going to have
+ // a dispatch problem. If SOAP12, fault.
+ /* We need to put something like this in, but this currently
+ breaks the soap12 deserialization test, since that's
+ deserializing with no OperationDescs. We should either
+ change the test or figure out a way to switch on/off
+ the idea of dispatching to an OperationDesc during
+ deserialization (MessageContext property, etc). --Glen
+
+ if (operations == null &&
+ (msgContext != null && !msgContext.isClient()) &&
+ soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
+ AxisFault fault =
+ new AxisFault(Constants.FAULT_SOAP12_SENDER,
+ "No such procedure", null, null);
+ fault.addFaultSubCode(
+ Constants.FAULT_SUBCODE_PROC_NOT_PRESENT);
+ throw new SAXException(fault);
+ }
+ */
+
// Only deserialize this way if there is a unique operation
// for this QName. If there are overloads,
// we'll need to start recording. If we're making a high-
@@ -224,16 +257,17 @@
}
}
- SOAPConstants soapConstants = context.getMessageContext() == null ?
- SOAPConstants.SOAP11_CONSTANTS :
- context.getMessageContext().getSOAPConstants();
if (element == null) {
if ((style == Style.RPC) &&
soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
throw new SAXException(Messages.getMessage("onlyOneBodyFor12"));
}
- element = new SOAPBodyElement(namespace, localName, prefix,
- attributes, context);
+ try {
+ element = new SOAPBodyElement(namespace, localName, prefix,
+ attributes, context);
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
if (element.getFixupDeserializer() != null)
handler = (SOAPHandler)element.getFixupDeserializer();
}
1.5.4.1 +3 -1 xml-axis/java/src/org/apache/axis/message/Detail.java
Index: Detail.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/Detail.java,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -r1.5 -r1.5.4.1
--- Detail.java 11 Dec 2002 22:38:20 -0000 1.5
+++ Detail.java 2 Mar 2003 02:55:23 -0000 1.5.4.1
@@ -72,7 +72,9 @@
public class Detail extends SOAPFault implements javax.xml.soap.Detail {
public Detail(String namespace, String localName, String prefix,
- Attributes attrs, DeserializationContext context) {
+ Attributes attrs, DeserializationContext context)
+ throws AxisFault
+ {
super(namespace, localName, prefix, attrs, context);
}
1.32.4.1 +9 -5 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.32
retrieving revision 1.32.4.1
diff -u -r1.32 -r1.32.4.1
--- EnvelopeBuilder.java 16 Jan 2003 23:47:28 -0000 1.32
+++ EnvelopeBuilder.java 2 Mar 2003 02:55:23 -0000 1.32.4.1
@@ -193,12 +193,16 @@
if (soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
throw new SAXException(Messages.getMessage("noElemAfterBody12"));
}
-
- MessageElement element = new MessageElement(namespace, localName, prefix,
- attributes, context);
- if (element.getFixupDeserializer() != null)
- return (SOAPHandler)element.getFixupDeserializer();
+ try {
+ MessageElement element = new MessageElement(namespace, localName, prefix,
+ attributes, context);
+
+ if (element.getFixupDeserializer() != null)
+ return (SOAPHandler)element.getFixupDeserializer();
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
return null;
}
1.22.4.1 +13 -5 xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java
Index: HeaderBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java,v
retrieving revision 1.22
retrieving revision 1.22.4.1
diff -u -r1.22 -r1.22.4.1
--- HeaderBuilder.java 16 Jan 2003 23:47:28 -0000 1.22
+++ HeaderBuilder.java 2 Mar 2003 02:55:23 -0000 1.22.4.1
@@ -103,9 +103,13 @@
if (!context.isDoneParsing()) {
if (myElement == null) {
- myElement = new SOAPHeader(namespace, localName, prefix,
- attributes, context,
- envelope.getSOAPConstants());
+ try {
+ myElement = new SOAPHeader(namespace, localName, prefix,
+ attributes, context,
+ envelope.getSOAPConstants());
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
envelope.setHeader((SOAPHeader)myElement);
}
context.pushNewElement(myElement);
@@ -119,8 +123,12 @@
DeserializationContext context)
throws SAXException
{
- header = new SOAPHeaderElement(namespace, localName, prefix,
- attributes, context);
+ try {
+ header = new SOAPHeaderElement(namespace, localName, prefix,
+ attributes, context);
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
SOAPHandler handler = new SOAPHandler();
handler.myElement = header;
1.145.2.1 +15 -0 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.145
retrieving revision 1.145.2.1
diff -u -r1.145 -r1.145.2.1
--- MessageElement.java 28 Feb 2003 05:39:46 -0000 1.145
+++ MessageElement.java 2 Mar 2003 02:55:23 -0000 1.145.2.1
@@ -57,6 +57,7 @@
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
+import org.apache.axis.AxisFault;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.DeserializationContextImpl;
@@ -81,6 +82,7 @@
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
+import javax.xml.rpc.encoding.TypeMapping;
import java.io.Reader;
import java.io.Serializable;
import java.io.StringReader;
@@ -197,6 +199,7 @@
public MessageElement(String namespace, String localPart, String prefix,
Attributes attributes, DeserializationContext context)
+ throws AxisFault
{
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage("newElem00", super.toString(),
@@ -258,6 +261,18 @@
// if no-encoding style was defined, we don't define as well
if (Constants.URI_SOAP12_NOENC.equals(encodingStyle))
encodingStyle = null;
+
+ if (encodingStyle != null &&
+ sc.equals(SOAPConstants.SOAP12_CONSTANTS)) {
+ TypeMapping tm = mc.getTypeMappingRegistry().
+ getTypeMapping(encodingStyle);
+ if (tm == null || (tm.equals(mc.getTypeMappingRegistry().getDefaultTypeMapping()))) {
+ AxisFault badEncodingFault = new AxisFault(
+ Constants.FAULT_SOAP12_DATAENCODINGUNKNOWN,
+ "bad encoding style", null, null);
+ throw badEncodingFault;
+ }
+ }
}
}
1.84.2.1 +35 -21 xml-axis/java/src/org/apache/axis/message/RPCElement.java
Index: RPCElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCElement.java,v
retrieving revision 1.84
retrieving revision 1.84.2.1
diff -u -r1.84 -r1.84.2.1
--- RPCElement.java 28 Feb 2003 16:21:57 -0000 1.84
+++ RPCElement.java 2 Mar 2003 02:55:23 -0000 1.84.2.1
@@ -106,7 +106,7 @@
if (service != null) {
ServiceDesc serviceDesc =
service.getInitializedServiceDesc(msgContext);
-
+
String lc = Utils.xmlNameToJava(name);
if (serviceDesc == null) {
AxisFault.makeFault(
@@ -154,7 +154,7 @@
public void deserialize() throws SAXException
{
needDeser = false;
-
+
MessageContext msgContext = context.getMessageContext();
// Figure out if we should be looking for out params or in params
@@ -173,6 +173,12 @@
SAXException savedException = null;
+ // By default, accept missing parameters as nulls, and
+ // allow the message context to override.
+ boolean acceptMissingParams = msgContext.isPropertyTrue(
+ MessageContext.ACCEPTMISSINGPARAMS,
+ true);
+
// We now have an array of all operations by this name. Try to
// find the right one. For each matching operation which has an
// equal number of "in" parameters, try deserializing. If we
@@ -187,11 +193,11 @@
// Make a quick check to determine if the operation
// could be a match.
- // 1) The element is the first param, DOCUMENT, (i.e.
+ // 1) The element is the first param, DOCUMENT, (i.e.
// don't know the operation name or the number
// of params, so try all operations).
// or (2) Style is literal
- // If the Style is LITERAL, the numParams may be inflated
+ // If the Style is LITERAL, the numParams may be inflated
// as in the following case:
// <getAttractions xmlns="urn:CityBBB">
// <attname>Christmas</attname>
@@ -199,17 +205,18 @@
// </getAttractions>
// for getAttractions(String[] attName)
// numParams will be 2 and and operation.getNumInParams=1
- // or (3) Number of expected params is
+ // or (3) Number of expected params is
// >= num params in message
if (operation.getStyle() == Style.DOCUMENT ||
operation.getStyle() == Style.WRAPPED ||
operation.getUse() == Use.LITERAL ||
- operation.getNumInParams() >= numParams) {
+ acceptMissingParams ? (operation.getNumInParams() >= numParams) :
+ (operation.getNumInParams() == numParams)) {
rpcHandler.setOperation(operation);
try {
// If no operation name and more than one
- // parameter is expected, don't
+ // parameter is expected, don't
// wrap the rpcHandler in an EnvelopeHandler.
if ((operation.getStyle() == Style.DOCUMENT) &&
operation.getNumInParams() > 0) {
@@ -231,7 +238,7 @@
context, rpcHandler);
}
- // Check if the RPCParam's value match the signature of the
+ // Check if the RPCParam's value match the signature of the
// param in the operation.
boolean match = true;
for ( int j = 0 ; j < params.size() && match ; j++ ) {
@@ -257,7 +264,7 @@
params = new Vector();
continue;
}
-
+
// Success!! This is the right one...
msgContext.setOperation(operation);
return;
@@ -276,6 +283,13 @@
}
}
+ // If we're SOAP 1.2, getting to this point means bad arguments.
+ if (!msgContext.isClient() && soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
+ AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER, "string", null, null);
+ fault.addFaultSubCode(Constants.FAULT_SUBCODE_BADARGS);
+ throw new SAXException(fault);
+ }
+
if (savedException != null) {
throw savedException;
} else if (!msgContext.isClient()) {
@@ -383,7 +397,7 @@
* @return true if the operation description indicates parameters/results
* are located in the soap header.
*/
- private boolean needHeaderProcessing(OperationDesc operation,
+ private boolean needHeaderProcessing(OperationDesc operation,
boolean isResponse) {
// Search parameters/return to see if any indicate
@@ -391,7 +405,7 @@
ArrayList paramDescs = operation.getParameters();
if (paramDescs != null) {
for (int j=0; j<paramDescs.size(); j++) {
- ParameterDesc paramDesc =
+ ParameterDesc paramDesc =
(ParameterDesc) paramDescs.get(j);
if ((!isResponse && paramDesc.isInHeader()) ||
(isResponse && paramDesc.isOutHeader())) {
@@ -399,11 +413,11 @@
}
}
}
- if (isResponse &&
+ if (isResponse &&
operation.getReturnParamDesc() != null &&
operation.getReturnParamDesc().isOutHeader()) {
return true;
- }
+ }
return false;
}
@@ -431,15 +445,15 @@
!(envelope instanceof SOAPEnvelope)) {
envelope = envelope.getParentElement();
}
- if (envelope == null)
+ if (envelope == null)
return;
-
+
// Find parameters that have instance
// data in the header.
ArrayList paramDescs = operation.getParameters();
if (paramDescs != null) {
for (int j=0; j<paramDescs.size(); j++) {
- ParameterDesc paramDesc =
+ ParameterDesc paramDesc =
(ParameterDesc) paramDescs.get(j);
if ((!isResponse && paramDesc.isInHeader()) ||
(isResponse && paramDesc.isOutHeader())) {
@@ -452,7 +466,7 @@
true);
// Publish each of the found elements to the
// handler. The pushElementHandler and
- // setCurElement calls are necessary to
+ // setCurElement calls are necessary to
// have the message element recognized as a
// child of the RPCElement.
while(headers != null &&
@@ -466,9 +480,9 @@
}
}
}
-
+
// Now do the same processing for the return parameter.
- if (isResponse &&
+ if (isResponse &&
operation.getReturnParamDesc() != null &&
operation.getReturnParamDesc().isOutHeader()) {
ParameterDesc paramDesc = operation.getReturnParamDesc();
@@ -482,10 +496,10 @@
headers.hasMoreElements()) {
context.pushElementHandler(handler);
context.setCurElement(null);
-
+
((MessageElement) headers.nextElement()).
publishToHandler((org.xml.sax.ContentHandler)context);
- }
+ }
}
} finally {
handler.setHeaderElement(false);
1.69.4.1 +9 -4 xml-axis/java/src/org/apache/axis/message/RPCHandler.java
Index: RPCHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
retrieving revision 1.69
retrieving revision 1.69.4.1
diff -u -r1.69 -r1.69.4.1
--- RPCHandler.java 20 Dec 2002 17:28:22 -0000 1.69
+++ RPCHandler.java 2 Mar 2003 02:55:23 -0000 1.69.4.1
@@ -61,6 +61,7 @@
*/
import org.apache.axis.Constants;
+import org.apache.axis.AxisFault;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
@@ -163,9 +164,13 @@
}
if (!context.isDoneParsing()) {
- context.pushNewElement(new MessageElement(namespace, localName,
- prefix, attributes,
- context));
+ try {
+ context.pushNewElement(new MessageElement(namespace, localName,
+ prefix, attributes,
+ context));
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
}
MessageElement curEl = context.getCurElement();
@@ -290,7 +295,7 @@
if(null != destClass && dser == null && destClass.isAssignableFrom( org.w3c.dom.Element.class )){
//If a DOM element is expected, as last resort always allow direct mapping
// of parameter's SOAP xml to a DOM element. Support of literal parms by default.
- dser = context.getDeserializer(destClass, Constants.SOAP_ELEMENT);
+ dser = context.getDeserializerForType(Constants.SOAP_ELEMENT);
}
if (dser == null) {
1.39.4.1 +1 -1 xml-axis/java/src/org/apache/axis/message/SOAPBody.java
Index: SOAPBody.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBody.java,v
retrieving revision 1.39
retrieving revision 1.39.4.1
diff -u -r1.39 -r1.39.4.1
--- SOAPBody.java 7 Feb 2003 18:01:20 -0000 1.39
+++ SOAPBody.java 2 Mar 2003 02:55:23 -0000 1.39.4.1
@@ -101,7 +101,7 @@
public SOAPBody(String namespace, String localPart, String prefix,
Attributes attributes, DeserializationContext context,
- SOAPConstants soapConsts) {
+ SOAPConstants soapConsts) throws AxisFault {
super(namespace, localPart, prefix, attributes, context);
soapConstants = soapConsts;
}
1.26.4.1 +2 -0 xml-axis/java/src/org/apache/axis/message/SOAPBodyElement.java
Index: SOAPBodyElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBodyElement.java,v
retrieving revision 1.26
retrieving revision 1.26.4.1
diff -u -r1.26 -r1.26.4.1
--- SOAPBodyElement.java 11 Dec 2002 22:38:20 -0000 1.26
+++ SOAPBodyElement.java 2 Mar 2003 02:55:23 -0000 1.26.4.1
@@ -55,6 +55,7 @@
package org.apache.axis.message;
import org.apache.axis.InternalException;
+import org.apache.axis.AxisFault;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.utils.Messages;
@@ -82,6 +83,7 @@
String prefix,
Attributes attributes,
DeserializationContext context)
+ throws AxisFault
{
super(namespace, localPart, prefix, attributes, context);
}
1.14.4.1 +1 -0 xml-axis/java/src/org/apache/axis/message/SOAPFault.java
Index: SOAPFault.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPFault.java,v
retrieving revision 1.14
retrieving revision 1.14.4.1
diff -u -r1.14 -r1.14.4.1
--- SOAPFault.java 24 Feb 2003 19:52:18 -0000 1.14
+++ SOAPFault.java 2 Mar 2003 02:55:23 -0000 1.14.4.1
@@ -84,6 +84,7 @@
public SOAPFault(String namespace, String localName, String prefix,
Attributes attrs, DeserializationContext context)
+ throws AxisFault
{
super(namespace, localName, prefix, attrs, context);
}
1.12.4.1 +7 -2 xml-axis/java/src/org/apache/axis/message/SOAPHandler.java
Index: SOAPHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHandler.java,v
retrieving revision 1.12
retrieving revision 1.12.4.1
diff -u -r1.12 -r1.12.4.1
--- SOAPHandler.java 16 Jan 2003 23:47:28 -0000 1.12
+++ SOAPHandler.java 2 Mar 2003 02:55:23 -0000 1.12.4.1
@@ -120,8 +120,12 @@
// By default, make a new element
if (!context.isDoneParsing() && !context.isProcessingRef()) {
if (myElement == null) {
- myElement = makeNewElement(namespace, localName, prefix,
- attributes, context);
+ try {
+ myElement = makeNewElement(namespace, localName, prefix,
+ attributes, context);
+ } catch (AxisFault axisFault) {
+ throw new SAXException(axisFault);
+ }
}
context.pushNewElement(myElement);
}
@@ -130,6 +134,7 @@
public MessageElement makeNewElement(String namespace, String localName,
String prefix, Attributes attributes,
DeserializationContext context)
+ throws AxisFault
{
return new MessageElement(namespace, localName,
prefix, attributes, context);
1.66.4.1 +2 -1 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.66
retrieving revision 1.66.4.1
diff -u -r1.66 -r1.66.4.1
--- SOAPHeader.java 24 Dec 2002 17:45:02 -0000 1.66
+++ SOAPHeader.java 2 Mar 2003 02:55:23 -0000 1.66.4.1
@@ -57,6 +57,7 @@
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
+import org.apache.axis.AxisFault;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.SerializationContext;
@@ -103,7 +104,7 @@
public SOAPHeader(String namespace, String localPart, String prefix,
Attributes attributes, DeserializationContext context,
- SOAPConstants soapConsts) {
+ SOAPConstants soapConsts) throws AxisFault {
super(namespace, localPart, prefix, attributes, context);
soapConstants = soapConsts;
}
1.20.4.1 +8 -2 xml-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java
Index: SOAPHeaderElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java,v
retrieving revision 1.20
retrieving revision 1.20.4.1
diff -u -r1.20 -r1.20.4.1
--- SOAPHeaderElement.java 7 Feb 2003 18:02:56 -0000 1.20
+++ SOAPHeaderElement.java 2 Mar 2003 02:55:23 -0000 1.20.4.1
@@ -55,6 +55,7 @@
package org.apache.axis.message;
import org.apache.axis.Constants;
+import org.apache.axis.AxisFault;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.soap.SOAPConstants;
@@ -147,8 +148,13 @@
super.detachNode();
}
- public SOAPHeaderElement(String namespace, String localPart, String prefix,
- Attributes attributes, DeserializationContext context) {
+ public SOAPHeaderElement(String namespace,
+ String localPart,
+ String prefix,
+ Attributes attributes,
+ DeserializationContext context)
+ throws AxisFault
+ {
super(namespace, localPart, prefix, attributes, context);
SOAPConstants soapConstants = context.getMessageContext() == null ?
No revision
No revision
1.103.4.1 +1 -1 xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java
Index: RPCProvider.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java,v
retrieving revision 1.103
retrieving revision 1.103.4.1
diff -u -r1.103 -r1.103.4.1
--- RPCProvider.java 20 Jan 2003 18:08:01 -0000 1.103
+++ RPCProvider.java 2 Mar 2003 02:55:24 -0000 1.103.4.1
@@ -333,7 +333,7 @@
if (!operation.isReturnHeader()) {
// For SOAP 1.2 rpc style, add a result
if (msgContext.getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS &&
- !(serviceDesc.getStyle().equals(Style.DOCUMENT))) {
+ (serviceDesc.getStyle().equals(Style.RPC))) {
RPCParam resultParam = new RPCParam(Constants.QNAME_RPC_RESULT, returnQName);
resultParam.setXSITypeGeneration(Boolean.FALSE);
resBody.addParam(resultParam);
No revision
No revision
1.21.4.1 +83 -51 xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisWorker.java
Index: SimpleAxisWorker.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisWorker.java,v
retrieving revision 1.21
retrieving revision 1.21.4.1
diff -u -r1.21 -r1.21.4.1
--- SimpleAxisWorker.java 11 Dec 2002 22:38:23 -0000 1.21
+++ SimpleAxisWorker.java 2 Mar 2003 02:55:24 -0000 1.21.4.1
@@ -71,7 +71,9 @@
import org.apache.commons.logging.Log;
import org.w3c.dom.Document;
+import javax.xml.namespace.QName;
import java.io.OutputStream;
+import java.io.ByteArrayInputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
@@ -92,6 +94,7 @@
// HTTP status codes
private static byte OK[] = ("200 " + Messages.getMessage("ok00")).getBytes();
private static byte UNAUTH[] = ("401 " + Messages.getMessage("unauth00")).getBytes();
+ private static byte SENDER[] = "400".getBytes();
private static byte ISE[] = ("500 " + Messages.getMessage("internalError01")).getBytes();
// HTTP prefix
@@ -111,12 +114,12 @@
private static byte SEPARATOR[] = "\r\n\r\n".getBytes();
// Tiddly little response
- private static final String responseStr =
- "<html><head><title>SimpleAxisServer</title></head>" +
- "<body><h1>SimpleAxisServer</h1>" +
- Messages.getMessage("reachedServer00") +
- "</html>";
- private static byte cannedHTMLResponse[] = responseStr.getBytes();
+// private static final String responseStr =
+// "<html><head><title>SimpleAxisServer</title></head>" +
+// "<body><h1>SimpleAxisServer</h1>" +
+// Messages.getMessage("reachedServer00") +
+// "</html>";
+// private static byte cannedHTMLResponse[] = responseStr.getBytes();
// ASCII character mapping to lower case
private static final byte[] toLower = new byte[256];
@@ -189,7 +192,7 @@
// create and initialize a message context
MessageContext msgContext = new MessageContext(engine);
- Message requestMsg;
+ Message requestMsg = null;
// Reusuable, buffered, content length controlled, InputStream
NonBlockingBufferedInputStream is =
@@ -234,6 +237,8 @@
// cookie for this session, if any
String cooky = null;
+ String methodName = null;
+
try {
// wipe cookies if we're doing sessions
if (server.isSessionUsed()) {
@@ -264,6 +269,10 @@
if ("wsdl".equalsIgnoreCase(params))
doWsdl = true;
+
+ if (params.startsWith("method=")) {
+ methodName = params.substring(7);
+ }
}
// Real and relative paths are the same for the
@@ -316,7 +325,21 @@
out.write(HTTP);
out.write(status);
- if (doWsdl) {
+ if (methodName != null) {
+ String body =
+ "<" + methodName + ">" +
+// args +
+ "</" + methodName + ">";
+ String msgtxt =
+ "<SOAP-ENV:Envelope" +
+ " xmlns:SOAP-ENV=\"" + Constants.URI_SOAP12_ENV + "\">" +
+ "<SOAP-ENV:Body>" + body + "</SOAP-ENV:Body>" +
+ "</SOAP-ENV:Envelope>";
+
+ ByteArrayInputStream istream =
+ new ByteArrayInputStream(msgtxt.getBytes());
+ requestMsg = new Message(istream);
+ } else if (doWsdl) {
engine.generateWSDL(msgContext);
Document doc = (Document) msgContext.getProperty("WSDL");
@@ -331,53 +354,55 @@
out.flush();
return;
}
- }
-
- StringBuffer sb = new StringBuffer();
- sb.append("<h2>And now... Some Services</h2>\n");
- Iterator i = engine.getConfig().getDeployedServices();
- out.write("<ul>\n".getBytes());
- while (i.hasNext()) {
- ServiceDesc sd = (ServiceDesc)i.next();
- sb.append("<li>\n");
- sb.append(sd.getName());
- sb.append(" <a href=\"../services/");
- sb.append(sd.getName());
- sb.append("?wsdl\"><i>(wsdl)</i></a></li>\n");
- ArrayList operations = sd.getOperations();
- if (!operations.isEmpty()) {
- sb.append("<ul>\n");
- for (Iterator it = operations.iterator(); it.hasNext();) {
- OperationDesc desc = (OperationDesc) it.next();
- sb.append("<li>" + desc.getName());
+ } else {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<h2>And now... Some Services</h2>\n");
+ Iterator i = engine.getConfig().getDeployedServices();
+ out.write("<ul>\n".getBytes());
+ while (i.hasNext()) {
+ ServiceDesc sd = (ServiceDesc)i.next();
+ sb.append("<li>\n");
+ sb.append(sd.getName());
+ sb.append(" <a href=\"../services/");
+ sb.append(sd.getName());
+ sb.append("?wsdl\"><i>(wsdl)</i></a></li>\n");
+ ArrayList operations = sd.getOperations();
+ if (!operations.isEmpty()) {
+ sb.append("<ul>\n");
+ for (Iterator it = operations.iterator(); it.hasNext();) {
+ OperationDesc desc = (OperationDesc) it.next();
+ sb.append("<li>" + desc.getName());
+ }
+ sb.append("</ul>\n");
}
- sb.append("</ul>\n");
}
- }
- sb.append("</ul>\n");
+ sb.append("</ul>\n");
- byte [] bytes = sb.toString().getBytes();
+ byte [] bytes = sb.toString().getBytes();
- out.write(HTML_MIME_STUFF);
- putInt(buf, out, bytes.length);
- out.write(SEPARATOR);
- out.write(bytes);
- out.flush();
- return;
- }
+ out.write(HTML_MIME_STUFF);
+ putInt(buf, out, bytes.length);
+ out.write(SEPARATOR);
+ out.write(bytes);
+ out.flush();
+ return;
+ }
+ } else {
- // this may be "" if either SOAPAction: "" or if no SOAPAction at all.
- // for now, do not complain if no SOAPAction at all
- String soapActionString = soapAction.toString();
- if (soapActionString != null) {
- msgContext.setUseSOAPAction(true);
- msgContext.setSOAPActionURI(soapActionString);
+ // this may be "" if either SOAPAction: "" or if no SOAPAction at all.
+ // for now, do not complain if no SOAPAction at all
+ String soapActionString = soapAction.toString();
+ if (soapActionString != null) {
+ msgContext.setUseSOAPAction(true);
+ msgContext.setSOAPActionURI(soapActionString);
+ }
+ requestMsg = new Message(is,
+ false,
+ contentType.toString(),
+ contentLocation.toString()
+ );
}
- requestMsg = new Message(is,
- false,
- contentType.toString(),
- contentLocation.toString()
- );
+
msgContext.setRequestMessage(requestMsg);
// set up session, if any
@@ -415,8 +440,10 @@
if (e instanceof AxisFault) {
af = (AxisFault) e;
log.debug(Messages.getMessage("serverFault00"), af);
-
- if ("Server.Unauthorized".equals(af.getFaultCode())) {
+ QName faultCode = af.getFaultCode();
+ if (Constants.FAULT_SOAP12_SENDER.equals(faultCode)) {
+ status = SENDER;
+ } else if ("Server.Unauthorized".equals(af.getFaultCode().getLocalPart())) {
status = UNAUTH; // SC_UNAUTHORIZED
} else {
status = ISE; // SC_INTERNAL_SERVER_ERROR
@@ -432,6 +459,7 @@
responseMsg = msgContext.getResponseMessage();
if (responseMsg == null) {
responseMsg = new Message(af);
+ responseMsg.setMessageContext(msgContext);
} else {
try {
SOAPEnvelope env = responseMsg.getSOAPEnvelope();
@@ -485,6 +513,10 @@
} catch (Exception e) {
}
}
+
+ }
+
+ protected void invokeMethodFromGet(String methodName, String args) throws Exception {
}
No revision
No revision
1.2.4.1 +14 -0 xml-axis/java/src/org/apache/axis/types/IDRefs.java
Index: IDRefs.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/types/IDRefs.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -r1.2 -r1.2.4.1
--- IDRefs.java 11 Dec 2002 22:38:25 -0000 1.2
+++ IDRefs.java 2 Mar 2003 02:55:24 -0000 1.2.4.1
@@ -73,11 +73,25 @@
* @exception IllegalArgumentException will be thrown if validation fails
*/
public IDRefs (String stValue) throws IllegalArgumentException {
+ setValue(stValue);
+ }
+
+ public void setValue(String stValue) {
StringTokenizer tokenizer = new StringTokenizer(stValue);
int count = tokenizer.countTokens();
idrefs = new IDRef[count];
for(int i=0;i<count;i++){
idrefs[i] = new IDRef(tokenizer.nextToken());
}
+ }
+
+ public String toString() {
+ String val = "";
+ for (int i = 0; i < idrefs.length; i++) {
+ IDRef ref = idrefs[i];
+ if (i > 0) val += " ";
+ val += ref.toString();
+ }
+ return val;
}
}
1.2.4.1 +14 -0 xml-axis/java/src/org/apache/axis/types/NMTokens.java
Index: NMTokens.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/types/NMTokens.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -r1.2 -r1.2.4.1
--- NMTokens.java 11 Dec 2002 22:38:25 -0000 1.2
+++ NMTokens.java 2 Mar 2003 02:55:24 -0000 1.2.4.1
@@ -72,11 +72,25 @@
* @exception IllegalArgumentException will be thrown if validation fails
*/
public NMTokens (String stValue) throws IllegalArgumentException {
+ setValue(stValue);
+ }
+
+ public void setValue(String stValue) {
StringTokenizer tokenizer = new StringTokenizer(stValue);
int count = tokenizer.countTokens();
tokens = new NMToken[count];
for(int i=0;i<count;i++){
tokens[i] = new NMToken(tokenizer.nextToken());
}
+ }
+
+ public String toString() {
+ String val = "";
+ for (int i = 0; i < tokens.length; i++) {
+ NMToken token = tokens[i];
+ if (i > 0) val += " ";
+ val += token.toString();
+ }
+ return val;
}
}
No revision
No revision
1.70.2.1 +6 -3 xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java
Index: Utils.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Utils.java,v
retrieving revision 1.70
retrieving revision 1.70.2.1
diff -u -r1.70 -r1.70.2.1
--- Utils.java 28 Feb 2003 00:32:22 -0000 1.70
+++ Utils.java 2 Mar 2003 02:55:24 -0000 1.70.2.1
@@ -378,9 +378,12 @@
* Prepend an underscore to the name
*/
public static String addUnderscore(String name) {
- if (name == null || name.equals(""))
- return name;
- return "_" + name;
+ return name;
+ /* Commenting out as the wsdl faults test breaks with this code --Glen
+ if (name == null || name.equals(""))
+ return name;
+ return "_" + name;
+ */
}
/**
No revision
No revision
1.2.4.1 +27 -8 xml-axis/java/test/wsdl/interop5/basetype/BaseTypesInteropTestsTestCase.java
Index: BaseTypesInteropTestsTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/interop5/basetype/BaseTypesInteropTestsTestCase.java,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -r1.2 -r1.2.4.1
--- BaseTypesInteropTestsTestCase.java 9 Jan 2003 13:50:01 -0000 1.2
+++ BaseTypesInteropTestsTestCase.java 2 Mar 2003 02:55:24 -0000 1.2.4.1
@@ -7,6 +7,11 @@
package test.wsdl.interop5.basetype;
+import org.apache.axis.types.NMToken;
+import org.apache.axis.types.NMTokens;
+import org.apache.axis.types.IDRef;
+import org.apache.axis.types.IDRefs;
+
import java.net.URL;
public class BaseTypesInteropTestsTestCase extends junit.framework.TestCase {
@@ -22,6 +27,12 @@
} // main
protected void setUp() throws Exception {
+ if (url == null) {
+ String urlStr = System.getProperty("testURL");
+ if (urlStr != null) {
+ url = new URL(urlStr);
+ }
+ }
if(url == null) {
url = new URL(new test.wsdl.interop5.basetype.BaseTypesInteropTestsLocator().getInteropTestsPortAddress());
}
@@ -278,8 +289,10 @@
// Test operation
org.apache.axis.types.NMToken value = null;
- value = binding.echoNMToken(new org.apache.axis.types.NMToken());
- // TBD - validate results
+ NMToken token = new NMToken();
+ token.setValue("eye_am_an_en_em_tokin");
+ value = binding.echoNMToken(token);
+ assertEquals(token, value);
}
public void test15InteropTestsPortEchoNMTokens() throws Exception {
@@ -296,8 +309,10 @@
// Test operation
org.apache.axis.types.NMTokens value = null;
- value = binding.echoNMTokens(new org.apache.axis.types.NMTokens());
- // TBD - validate results
+ NMTokens tokens = new NMTokens();
+ tokens.setValue("one two three");
+ value = binding.echoNMTokens(tokens);
+ assertEquals(tokens, value);
}
public void test16InteropTestsPortEchoName() throws Exception {
@@ -368,8 +383,10 @@
// Test operation
org.apache.axis.types.IDRef value = null;
- value = binding.echoIDREF(new org.apache.axis.types.IDRef());
- // TBD - validate results
+ IDRef ref = new IDRef();
+ ref.setValue("THX1138");
+ value = binding.echoIDREF(ref);
+ assertEquals(ref, value);
}
public void test20InteropTestsPortEchoIDREFS() throws Exception {
@@ -386,8 +403,10 @@
// Test operation
org.apache.axis.types.IDRefs value = null;
- value = binding.echoIDREFS(new org.apache.axis.types.IDRefs());
- // TBD - validate results
+ IDRefs refs = new IDRefs();
+ refs.setValue("THX1138 R2D2 C3P0");
+ value = binding.echoIDREFS(refs);
+ assertEquals(refs, value);
}
public void test21InteropTestsPortEchoEntity() throws Exception {
No revision
No revision
1.1.4.1 +1 -1 xml-axis/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java
Index: Soap12AddTestRpcBindingImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -r1.1 -r1.1.4.1
--- Soap12AddTestRpcBindingImpl.java 20 Jan 2003 01:58:31 -0000 1.1
+++ Soap12AddTestRpcBindingImpl.java 2 Mar 2003 02:55:24 -0000 1.1.4.1
@@ -18,7 +18,7 @@
// getTime is a notification style operation and is unsupported.
public java.lang.String echoString(java.lang.String inputString) throws java.rmi.RemoteException {
- return null;
+ return inputString;
}
public test.wsdl.soap12.additional.xsd.SOAPStructTypes echoSimpleTypesAsStructOfSchemaTypes(java.lang.Object input1, java.lang.Object input2, java.lang.Object input3, java.lang.Object input4) throws java.rmi.RemoteException {
1.9.4.1 +110 -42 xml-axis/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
Index: WhiteMesaSoap12AddTestSvcTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -u -r1.9 -r1.9.4.1
--- WhiteMesaSoap12AddTestSvcTestCase.java 23 Feb 2003 05:44:21 -0000 1.9
+++ WhiteMesaSoap12AddTestSvcTestCase.java 2 Mar 2003 02:55:24 -0000 1.9.4.1
@@ -9,25 +9,25 @@
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
+import org.apache.axis.utils.XMLUtils;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.enum.Style;
import org.apache.axis.enum.Use;
-import org.apache.axis.message.SOAPEnvelope;
-import org.apache.axis.message.SOAPHeaderElement;
-import org.apache.axis.message.RPCElement;
-import org.apache.axis.message.RPCParam;
-import org.apache.axis.message.SOAPBodyElement;
-import org.apache.axis.message.PrefixedQName;
-import org.apache.axis.message.MessageElement;
+import org.apache.axis.message.*;
import org.apache.axis.soap.SOAP12Constants;
import org.apache.axis.soap.SOAPConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
+import org.w3c.dom.Element;
import test.wsdl.soap12.additional.xsd.SOAPStruct;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.util.Vector;
+import java.net.URL;
/**
* Additional SOAP 1.2 tests.
@@ -53,19 +53,75 @@
// Endpoints
// TODO : Shouldn't be hardcoded!
// public static final String HOST = "http://localhost:8080";
- public static final String HOST = "http://www.whitemesa.net";
- public static final String RPC_ENDPOINT = HOST + "/soap12/add-test-rpc";
- public static final String DOC_ENDPOINT = HOST + "/soap12/add-test-doc";
- public static final String GET_DOC_ENDPOINT = HOST + "/soap12/add-test-doc/getTime";
- public static final String GET_RPC_ENDPOINT = HOST + "/soap12/add-test-rpc/getTime";
- public static final String DOC_INT_ENDPOINT = HOST + "/soap12/add-test-doc-int";
- public static final String DOC_INT_UC_ENDPOINT = HOST + "/soap12/add-test-doc-int-uc";
+ public static String HOST = "http://www.whitemesa.net";
+ public static String RPC_ENDPOINT = HOST + "/soap12/add-test-rpc";
+ public static String DOC_ENDPOINT = HOST + "/soap12/add-test-doc";
+ public static String GET_DOC_ENDPOINT = HOST + "/soap12/add-test-doc/getTime";
+ public static String GET_RPC_ENDPOINT = HOST + "/soap12/add-test-rpc/getTime";
+ public static String DOC_INT_ENDPOINT = HOST + "/soap12/add-test-doc-int";
+ public static String DOC_INT_UC_ENDPOINT = HOST + "/soap12/add-test-doc-int-uc";
private QName SOAPSTRUCT_QNAME = new QName("http://example.org/ts-tests/xsd", "SOAPStruct");
+ static String configFile = null;
+
+ public static void main(String[] args) throws Exception {
+ // If we have an argument, it's a configuration file.
+ if (args.length > 0) {
+ configFile = args[0];
+ }
+ WhiteMesaSoap12AddTestSvcTestCase tester = new WhiteMesaSoap12AddTestSvcTestCase("testXMLP5");
+ tester.setUp();
+ tester.testXMLP19();
+ System.out.println("Done.");
+// junit.textui.TestRunner.run(WhiteMesaSoap12AddTestSvcTestCase.class);
+ }
+
public WhiteMesaSoap12AddTestSvcTestCase(java.lang.String name) {
super(name);
}
-
+
+ protected void setUp() throws Exception {
+ if (configFile == null) {
+ configFile = System.getProperty("configFile");
+ }
+
+ if (configFile == null) {
+ return;
+ }
+
+ Document doc = XMLUtils.newDocument(configFile);
+ NodeList nl = doc.getDocumentElement().getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++) {
+ Node node = nl.item(i);
+ if (!(node instanceof Element))
+ continue;
+ Element el = (Element) node;
+ String tag = el.getLocalName();
+ String data = XMLUtils.getChildCharacterData(el);
+ if ("host".equals(tag)) {
+ HOST = data;
+ RPC_ENDPOINT = HOST + "/soap12/add-test-rpc";
+ DOC_ENDPOINT = HOST + "/soap12/add-test-doc";
+ GET_DOC_ENDPOINT = HOST + "/soap12/add-test-doc/getTime";
+ GET_RPC_ENDPOINT = HOST + "/soap12/add-test-rpc/getTime";
+ DOC_INT_ENDPOINT = HOST + "/soap12/add-test-doc-int";
+ DOC_INT_UC_ENDPOINT = HOST + "/soap12/add-test-doc-int-uc";
+ } else if ("rpcEndpoint".equals(tag)) {
+ RPC_ENDPOINT = data;
+ } else if ("docEndpoint".equals(tag)) {
+ DOC_ENDPOINT = data;
+ } else if ("getRpcEndpoint".equals(tag)) {
+ GET_RPC_ENDPOINT = data;
+ } else if ("getDocEndpoint".equals(tag)) {
+ GET_DOC_ENDPOINT = data;
+ } else if ("docIntEndpoint".equals(tag)) {
+ DOC_INT_ENDPOINT = data;
+ } else if ("docIntUcEndpoint".equals(tag)) {
+ DOC_INT_UC_ENDPOINT = data;
+ }
+ }
+ }
+
/**
* Test xmlp-1 - call echoString with no arguments (even though it expects
* one). Confirm bad arguments fault from endpoint.
@@ -125,7 +181,7 @@
// gonna for now.
}
- public void textXMLP4() throws Exception {
+ public void testXMLP4() throws Exception {
Call call = new Call(RPC_ENDPOINT);
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.registerTypeMapping(SOAPStruct.class, SOAPSTRUCT_QNAME,
@@ -183,10 +239,11 @@
}
public void testXMLP7() throws Exception {
+ URL url = new URL(DOC_ENDPOINT);
test.wsdl.soap12.additional.Soap12AddTestDocBindingStub binding;
try {
binding = (test.wsdl.soap12.additional.Soap12AddTestDocBindingStub)
- new test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocPort();
+ new test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
@@ -214,31 +271,15 @@
}
public void testXMLP8() throws Exception {
- test.wsdl.soap12.additional.Soap12AddTestDocBindingStub binding;
- try {
- binding = (test.wsdl.soap12.additional.Soap12AddTestDocBindingStub)
- new test.wsdl.soap12.additional.WhiteMesaSoap12AddTestSvcLocator().getSoap12AddTestDocPort();
- }
- catch (javax.xml.rpc.ServiceException jre) {
- if(jre.getLinkedCause()!=null)
- jre.getLinkedCause().printStackTrace();
- throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
- }
- assertNotNull("binding is null", binding);
-
- // Time out after a minute
- binding.setTimeout(60000);
-
- // Test operation
+ Call call = new Call(DOC_ENDPOINT);
+ call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
+ QName qname = new QName(TEST_NS, "echoReceiverFault");
try {
- binding.echoReceiverFault(STRING_VAL);
- } catch (java.rmi.RemoteException e) {
- if (e instanceof AxisFault) {
- AxisFault af = (AxisFault)e;
- assertEquals(Constants.FAULT_SOAP12_RECEIVER,
- af.getFaultCode());
- return; // success
- }
+ call.invoke(qname, null);
+ } catch (AxisFault af) {
+ assertEquals(Constants.FAULT_SOAP12_RECEIVER,
+ af.getFaultCode());
+ return; // success
}
fail("Should have received receiver fault!");
@@ -267,7 +308,34 @@
}
fail("Didn't catch expected fault");
}
-
+
+ /**
+ * Test xmlp-10 : reply with the schema types of the arguments, in order
+ */
+ public void testXMLP10() throws Exception {
+ Call call = new Call(RPC_ENDPOINT);
+ call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
+ SOAPEnvelope reqEnv = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
+ SOAPBodyElement body = new SOAPBodyElement(
+ new PrefixedQName(TEST_NS,
+ "echoSimpleTypesAsStructOfSchemaTypes", "ns"));
+ reqEnv.addBodyElement(body);
+ MessageElement arg = new MessageElement("", "input1");
+ arg.setObjectValue(new Integer(5));
+ body.addChild(arg);
+ arg = new MessageElement("", "input2");
+ arg.setObjectValue(new Float(5.5F));
+ body.addChild(arg);
+ arg = new MessageElement("", "input3");
+ arg.setObjectValue("hi there");
+ body.addChild(arg);
+ arg = new MessageElement("", "input4");
+ Text text = new Text("untyped");
+ arg.addChild(text);
+ body.addChild(arg);
+ call.invoke(reqEnv);
+ }
+
/**
* Test xmlp-11 : send a string where an integer is expected, confirm
* BadArguments fault.
1.1.4.1 +1 -1 xml-axis/java/test/wsdl/soap12/additional/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/soap12/additional/build.xml,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -r1.1 -r1.1.4.1
--- build.xml 20 Jan 2003 01:58:31 -0000 1.1
+++ build.xml 2 Mar 2003 02:55:24 -0000 1.1.4.1
@@ -64,7 +64,7 @@
<copy todir="${build.dir}/work/test/wsdl/soap12/additional" overwrite="yes">
<fileset dir="${axis.home}/test/wsdl/soap12/additional">
<include name="*TestCase.java"/>
- <include name="*Impl.java"/>
+ <include name="*Service.java"/>
</fileset>
</copy>