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/27 21:57:32 UTC
cvs commit: xml-axis/java/test/soap12 TestDeser.java TestEncodingStyle.java TestFault.java TestHrefs.java TestSer.java
gdaniels 2003/03/27 12:57:32
Modified: java/src/org/apache/axis Constants.java
java/src/org/apache/axis/message BodyBuilder.java
java/test/soap12 TestDeser.java TestEncodingStyle.java
TestFault.java TestHrefs.java TestSer.java
Log:
Expose SOAP 1.2 ProcedureNotPresent fault in mainline code. Add a property to disable this behavior if you're deserializing without an OperationDesc (the only reason we do this is for white-box soap12 tests).
Revision Changes Path
1.117 +6 -0 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.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- Constants.java 18 Mar 2003 16:50:38 -0000 1.116
+++ Constants.java 27 Mar 2003 20:57:32 -0000 1.117
@@ -675,6 +675,12 @@
// When invoked from a servlet, per JAX-RPC, we need a
// ServletEndpointContext object. This is where it lives.
public static final String MC_SERVLET_ENDPOINT_CONTEXT = "servletEndpointContext";
+
+ // If we're SOAP 1.2, the default behavior in org.apache.axis.message.BodyBuilder
+ // is to throw a ProcedureNotPresent fault if we can't dispatch to an
+ // OperationDesc during deserialization. Set this property to any non-null
+ // value to prevent this behavior (only used by test.soap12.
+ public static final String MC_NO_OPERATION_OK = "NoOperationOK";
/**
* what the extension of JWS files is. If changing this, note that
1.58 +2 -9 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.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- BodyBuilder.java 2 Mar 2003 06:36:19 -0000 1.57
+++ BodyBuilder.java 27 Mar 2003 20:57:32 -0000 1.58
@@ -222,15 +222,9 @@
// 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()) &&
+ (msgContext != null && !msgContext.isClient() &&
+ (msgContext.getProperty(Constants.MC_NO_OPERATION_OK) == null)) &&
soapConstants == SOAPConstants.SOAP12_CONSTANTS) {
AxisFault fault =
new AxisFault(Constants.FAULT_SOAP12_SENDER,
@@ -239,7 +233,6 @@
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,
1.5 +1 -0 xml-axis/java/test/soap12/TestDeser.java
Index: TestDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/soap12/TestDeser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestDeser.java 19 Jan 2003 21:25:10 -0000 1.4
+++ TestDeser.java 27 Mar 2003 20:57:32 -0000 1.5
@@ -118,6 +118,7 @@
Message message = new Message(soap);
MessageContext context = new MessageContext(server);
context.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
+ context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
message.setMessageContext(context);
1.3 +2 -0 xml-axis/java/test/soap12/TestEncodingStyle.java
Index: TestEncodingStyle.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/soap12/TestEncodingStyle.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestEncodingStyle.java 24 Feb 2003 19:47:56 -0000 1.2
+++ TestEncodingStyle.java 27 Mar 2003 20:57:32 -0000 1.3
@@ -152,6 +152,7 @@
Message message = new Message(req);
MessageContext context = new MessageContext(server);
context.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
+ context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
message.setMessageContext(context);
@@ -208,6 +209,7 @@
Message message = new Message(req);
MessageContext context = new MessageContext(server);
+ context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
// Set the "invalid" encoding style
TypeMappingRegistry reg = context.getTypeMappingRegistry();
1.3 +3 -0 xml-axis/java/test/soap12/TestFault.java
Index: TestFault.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/soap12/TestFault.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestFault.java 1 Feb 2003 19:16:51 -0000 1.2
+++ TestFault.java 27 Mar 2003 20:57:32 -0000 1.3
@@ -6,6 +6,7 @@
import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
+import org.apache.axis.Constants;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.encoding.SerializationContextImpl;
import org.apache.axis.message.SOAPBodyElement;
@@ -46,6 +47,8 @@
// Serialize
MessageContext msgContext = new MessageContext(new AxisServer());
msgContext.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
+ msgContext.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
+
SOAPEnvelope msg = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
SOAPFault fault = new SOAPFault(new AxisFault(FAULTCODE, FAULTSUBCODE,
1.4 +3 -1 xml-axis/java/test/soap12/TestHrefs.java
Index: TestHrefs.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/soap12/TestHrefs.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestHrefs.java 19 Jan 2003 21:25:10 -0000 1.3
+++ TestHrefs.java 27 Mar 2003 20:57:32 -0000 1.4
@@ -53,7 +53,9 @@
throws Exception
{
Message message = new Message(data);
- message.setMessageContext(new MessageContext(new AxisServer()));
+ MessageContext context = new MessageContext(new AxisServer());
+ message.setMessageContext(context);
+ context.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope();
assertNotNull("SOAP envelope should not be null", envelope);
1.4 +4 -0 xml-axis/java/test/soap12/TestSer.java
Index: TestSer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/soap12/TestSer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestSer.java 20 Dec 2002 17:28:21 -0000 1.3
+++ TestSer.java 27 Mar 2003 20:57:32 -0000 1.4
@@ -51,6 +51,8 @@
public void doTestData (boolean multiref) throws Exception {
MessageContext msgContext = new MessageContext(new AxisServer());
msgContext.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
+ msgContext.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
+
SOAPEnvelope msg = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
RPCParam arg1 = new RPCParam("urn:myNamespace", "testParam", "this is a string");
@@ -126,6 +128,8 @@
try {
MessageContext msgContext = new MessageContext(new AxisServer());
msgContext.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
+ msgContext.setProperty(Constants.MC_NO_OPERATION_OK, Boolean.TRUE);
+
String req =
"<xsd1:A xmlns:xsd1=\"urn:myNamespace\">"
+ "<xsd1:B>"