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 pr...@apache.org on 2007/07/27 14:27:57 UTC
svn commit: r560215 - in /webservices/axis2/branches/java/jaxws21/modules:
integration/ jaxws/ jaxws/src/org/apache/axis2/jaxws/client/async/
jaxws/src/org/apache/axis2/jaxws/context/utils/
jaxws/src/org/apache/axis2/jaxws/core/controller/ jaxws/src/or...
Author: pradine
Date: Fri Jul 27 05:27:54 2007
New Revision: 560215
URL: http://svn.apache.org/viewvc?view=rev&rev=560215
Log:
Sync with trunk to revision 557028.
Added:
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/HandlerTracker.java
- copied unchanged from r557028, webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/HandlerTracker.java
Removed:
webservices/axis2/branches/java/jaxws21/modules/jaxws/test-resources/axis2.xml
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/SOAPMustUnderstandHeaderChecker.java
Modified:
webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml
webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml
webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/InvocationController.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/BaseMessageContext.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/description/DescriptionTestUtils2.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.java
webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersProtocolHandler.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml Fri Jul 27 05:27:54 2007
@@ -314,6 +314,146 @@
</dependencies>
<profiles>
<profile>
+ <id>java14</id>
+ <activation>
+ <jdk>1.4</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <skip>false</skip>
+
+ <!-- The pertest forkMode is not ideal but seems to be necessary
+ because the test server doesn't shut down properly :-(
+ Should be removed if possible -->
+ <forkMode>pertest</forkMode>
+ <argLine>-Xms256m -Xmx512m</argLine>
+ <!-- Enable the next 2 lines if you want to attach a debugger
+ <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*.java</exclude>
+ <exclude>**/*Util*.java</exclude>
+ <exclude>**/*InteropStubTest.java</exclude>
+ <exclude>**/*ServiceGroupContextTest.java</exclude>
+ <exclude>**/*EchoRawSwAFileInputTest.java</exclude>
+ <exclude>**org/apache/axis2/mail/*.java</exclude>
+ <exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java</exclude>
+ <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.java</exclude>
+ <exclude>**/ScenarioST1Test.java</exclude>
+ <exclude>**/samples/wsdl/perf2/*.java</exclude>
+ </excludes>
+ <systemProperties>
+ <property>
+ <name>build.repository</name>
+ <value>./target/test-classes</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>java15</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <skip>false</skip>
+
+ <!-- The pertest forkMode is not ideal but seems to be necessary
+ because the test server doesn't shut down properly :-(
+ Should be removed if possible -->
+ <forkMode>pertest</forkMode>
+ <argLine>-Xms256m -Xmx512m</argLine>
+ <!-- Enable the next 2 lines if you want to attach a debugger
+ <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*.java</exclude>
+ <exclude>**/*Util*.java</exclude>
+ <exclude>**/*InteropStubTest.java</exclude>
+ <exclude>**/*ServiceGroupContextTest.java</exclude>
+ <exclude>**/*EchoRawSwAFileInputTest.java</exclude>
+ <exclude>**org/apache/axis2/mail/*.java</exclude>
+ <exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java</exclude>
+ <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.java</exclude>
+ <exclude>**/ScenarioST1Test.java</exclude>
+ <exclude>**/samples/wsdl/perf2/*.java</exclude>
+ </excludes>
+ <systemProperties>
+ <property>
+ <name>build.repository</name>
+ <value>./target/test-classes</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>java16</id>
+ <activation>
+ <jdk>1.6</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <skip>false</skip>
+
+ <!-- The pertest forkMode is not ideal but seems to be necessary
+ because the test server doesn't shut down properly :-(
+ Should be removed if possible -->
+ <forkMode>pertest</forkMode>
+ <argLine>-Xms256m -Xmx512m</argLine>
+ <!-- Enable the next 2 lines if you want to attach a debugger
+ <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*.java</exclude>
+ <exclude>**/*Util*.java</exclude>
+ <exclude>**/*InteropStubTest.java</exclude>
+ <exclude>**/*ServiceGroupContextTest.java</exclude>
+ <exclude>**/*EchoRawSwAFileInputTest.java</exclude>
+ <exclude>**org/apache/axis2/mail/*.java</exclude>
+ <exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java</exclude>
+ <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.java</exclude>
+ <exclude>**/ScenarioST1Test.java</exclude>
+ <exclude>**/samples/wsdl/perf2/*.java</exclude>
+ <exclude>**/BaseDataTypesTest.java</exclude>
+ <exclude>**/ComplexDataTypesTest.java</exclude>
+ </excludes>
+ <systemProperties>
+ <property>
+ <name>build.repository</name>
+ <value>./target/test-classes</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>enterprise</id>
<build>
<plugins>
@@ -514,42 +654,6 @@
</goals>
</execution>
</executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <skip>false</skip>
-
- <!-- The pertest forkMode is not ideal but seems to be necessary
- because the test server doesn't shut down properly :-(
- Should be removed if possible -->
- <forkMode>pertest</forkMode>
- <argLine>-Xms256m -Xmx512m</argLine>
- <!-- Enable the next 2 lines if you want to attach a debugger
- <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
- <includes>
- <include>**/*Test.java</include>
- </includes>
- <excludes>
- <exclude>**/*Abstract*.java</exclude>
- <exclude>**/*Util*.java</exclude>
- <exclude>**/*InteropStubTest.java</exclude>
- <exclude>**/*ServiceGroupContextTest.java</exclude>
- <exclude>**/*EchoRawSwAFileInputTest.java</exclude>
- <exclude>**org/apache/axis2/mail/*.java</exclude>
- <exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java</exclude>
- <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.java</exclude>
- <exclude>**/ScenarioST1Test.java</exclude>
- <exclude>**/samples/wsdl/perf2/*.java</exclude>
- </excludes>
- <systemProperties>
- <property>
- <name>build.repository</name>
- <value>./target/test-classes</value>
- </property>
- </systemProperties>
- </configuration>
</plugin>
</plugins>
</build>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml Fri Jul 27 05:27:54 2007
@@ -465,17 +465,6 @@
<include name="org/apache/axis2/jaxws/server/**"/>
</fileset>
</copy>
- <copy toDir="target/test-classes/services/SoapMessageMUProviderService/">
- <fileset dir="target/test-classes">
- <include name="org/apache/axis2/jaxws/provider/soapmsgmu/**"/>
- </fileset>
- <fileset dir="test/org/apache/axis2/jaxws/provider/soapmsgmu">
- <include name="META-INF/**"/>
- </fileset>
- <fileset dir="target/classes">
- <include name="org/apache/axis2/jaxws/server/**"/>
- </fileset>
- </copy>
<copy toDir="target/test-classes/services/JAXBProviderService/">
<fileset dir="target/test-classes">
<include name="org/apache/axis2/jaxws/provider/jaxb/**"/>
@@ -817,7 +806,6 @@
<copy toDir="target/test-classes/">
<fileset dir="test-resources/">
<include name="**/*.properties"/>
- <include name="**/axis2.xml"/>
</fileset>
</copy>
</tasks>
@@ -852,7 +840,7 @@
<configuration>
<skip>false</skip>
<forkMode>once</forkMode>
- <argLine>-Xms256m -Xmx512m</argLine>
+ <argLine>-Xms256m -Xmx512m -Djava.endorsed.dirs=${project.build.directory}/../../saaj-api/target/ </argLine>
<!-- Enable the next 2 lines if you want to attach a debugger
<argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
<includes>
@@ -863,10 +851,21 @@
<name>build.repository</name>
<value>./target/test-classes</value>
</property>
- <!-- Need this for the client side to pickup an axis2.xml to configure SoapMessageMUProviderChecker -->
<property>
- <name>org.apache.axis2.jaxws.config.path</name>
- <value>./target/test-classes/axis2.xml</value>
+ <name>javax.xml.soap.MessageFactory</name>
+ <value>org.apache.axis2.saaj.MessageFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.soap.SOAPFactory</name>
+ <value>org.apache.axis2.saaj.SOAPFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.soap.SOAPConnectionFactory</name>
+ <value>org.apache.axis2.saaj.SOAPConnectionFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.soap.MetaFactory</name>
+ <value>org.apache.axis2.saaj.SAAJMetaFactoryImpl</value>
</property>
</systemProperties>
</configuration>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java Fri Jul 27 05:27:54 2007
@@ -21,8 +21,10 @@
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.handler.AttachmentsAdapter;
import org.apache.axis2.jaxws.handler.HandlerChainProcessor;
import org.apache.axis2.jaxws.handler.HandlerInvokerUtils;
+import org.apache.axis2.jaxws.handler.TransportHeadersAdapter;
import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.spi.migrator.ApplicationContextMigratorUtil;
import org.apache.commons.logging.Log;
@@ -205,6 +207,8 @@
// TODO: IMPORTANT: this is the right call here, but beware that the messagecontext may be turned into
// a fault context with a fault message. We need to check for this and, if necessary, make an exception and throw it.
// Invoke inbound handlers.
+ TransportHeadersAdapter.install(response);
+ AttachmentsAdapter.install(response);
HandlerInvokerUtils.invokeInboundHandlers(response.getMEPContext(),
response.getInvocationContext().getHandlers(),
HandlerChainProcessor.MEP.RESPONSE,
@@ -251,7 +255,10 @@
// it is possible the message could be null. For example, if we gave the proxy a bad endpoint address.
// If it is the case that the message is null, there's no sense running through the handlers.
if (faultMessageContext.getMessage() != null)
- // Invoke inbound handlers.
+ // Invoke inbound handlers.
+ // The adapters are intentionally NOT installed here. They cause unit test failures
+ // TransportHeadersAdapter.install(faultMessageContext);
+ // AttachmentsAdapter.install(faultMessageContext);
HandlerInvokerUtils.invokeInboundHandlers(faultMessageContext.getMEPContext(),
faultMessageContext.getInvocationContext()
.getHandlers(),
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java Fri Jul 27 05:27:54 2007
@@ -175,10 +175,6 @@
}
}
- soapMessageContext.put(javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE,
- axisMsgContext.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE));
- soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.HTTP_RESPONSE_CODE,
- Scope.APPLICATION);
}
public static void addWSDLProperties(MessageContext jaxwsMessageContext) {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/InvocationController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/InvocationController.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/InvocationController.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/InvocationController.java Fri Jul 27 05:27:54 2007
@@ -22,8 +22,10 @@
import org.apache.axis2.jaxws.core.InvocationContext;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.core.util.MessageContextUtils;
+import org.apache.axis2.jaxws.handler.AttachmentsAdapter;
import org.apache.axis2.jaxws.handler.HandlerChainProcessor;
import org.apache.axis2.jaxws.handler.HandlerInvokerUtils;
+import org.apache.axis2.jaxws.handler.TransportHeadersAdapter;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.util.Constants;
import org.apache.commons.logging.Log;
@@ -124,6 +126,8 @@
response.setEndpointDescription(request.getEndpointDescription());
// Invoke inbound handlers.
+ TransportHeadersAdapter.install(response);
+ AttachmentsAdapter.install(response);
HandlerInvokerUtils.invokeInboundHandlers(response.getMEPContext(),
ic.getHandlers(),
HandlerChainProcessor.MEP.RESPONSE,
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/BaseMessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/BaseMessageContext.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/BaseMessageContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/BaseMessageContext.java Fri Jul 27 05:27:54 2007
@@ -19,6 +19,8 @@
package org.apache.axis2.jaxws.handler;
import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.util.Collection;
import java.util.Map;
@@ -34,6 +36,7 @@
*
*/
public class BaseMessageContext implements javax.xml.ws.handler.MessageContext {
+ private static final Log log = LogFactory.getLog(BaseMessageContext.class);
protected MessageContext messageCtx;
@@ -82,7 +85,44 @@
* @see java.util.Map#get(java.lang.Object)
*/
public Object get(Object key) {
- return messageCtx.getMEPContext().get(key);
+ // There are some properties that, in some cases, should not span the message exchange;
+ // that is, they should come from only the current message context. For others properties,
+ // they should span the message exchange, meaning a property could be set on the request
+ // and it will also be available on the response. [JAXWS 2.0, Sec 9.4.1.1, pp. 110-113]
+ Object returnValue = null;
+ if (shouldPropertySpanMEP(key)) {
+ returnValue = messageCtx.getMEPContext().get(key);
+ } else {
+ returnValue = messageCtx.getProperty((String) key);
+ }
+
+ // For the HTTP_REQUEST_HEADERS and HTTP_RESPONSE_HEADERS, the CTS tests want a null returned
+ // if there are no headers. Since we always put an instance of TransportHeadersAdapter,
+ // which contains the headers, on the message context, return a null if it is empty.
+ if (returnValue != null && (returnValue instanceof TransportHeadersAdapter)) {
+ TransportHeadersAdapter adapter = (TransportHeadersAdapter) returnValue;
+ if (adapter.isEmpty()) {
+ return null;
+ }
+ }
+ return returnValue;
+ }
+
+ private boolean shouldPropertySpanMEP(Object key) {
+ boolean shouldSpan = true;
+ String keyString = (String) key;
+
+ // The CTS tests require that HTTP_REQUEST_HEADERS span the request and response contexts
+ // on the service-provider, but do NOT span the request and response context on the
+ // service-requester. So, for an INBOUND flow, do not allow HTTP_REQUEST_HEADERS to
+ // span the request and response contexts. The result is that the service-requester
+ // inbound handler will not see the request headers while processing a response.
+ Boolean outbound = (Boolean) messageCtx.getMEPContext().get(MESSAGE_OUTBOUND_PROPERTY);
+ if (outbound != null && !outbound)
+ if (javax.xml.ws.handler.MessageContext.HTTP_REQUEST_HEADERS.equals(keyString)) {
+ shouldSpan = false;
+ }
+ return shouldSpan;
}
/* (non-Javadoc)
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java Fri Jul 27 05:27:54 2007
@@ -32,6 +32,8 @@
import org.apache.axis2.jaxws.core.InvocationContextImpl;
import org.apache.axis2.jaxws.core.MEPContext;
import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.handler.AttachmentsAdapter;
+import org.apache.axis2.jaxws.handler.TransportHeadersAdapter;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.message.util.MessageUtils;
import org.apache.axis2.jaxws.util.Constants;
@@ -96,7 +98,10 @@
MessageContext requestMsgCtx = new MessageContext(axisRequestMsgCtx);
requestMsgCtx.setMEPContext(new MEPContext(requestMsgCtx));
-
+ // The adapters need to be installed on the new request Message Context
+ AttachmentsAdapter.install(requestMsgCtx);
+ TransportHeadersAdapter.install(requestMsgCtx);
+
Binding binding = (Binding)axisRequestMsgCtx.getProperty(PARAM_BINDING);
InvocationContext ic = InvocationContextFactory.createInvocationContext(binding);
ic.setRequestMessageContext(requestMsgCtx);
@@ -133,10 +138,9 @@
faultToReturn = responseMsgCtx.getCausedByException();
else {
faultToReturn = new AxisFault("An error was detected during JAXWS processing",
- axisResponseMsgCtx);
-
+ axisResponseMsgCtx);
}
- } else {
+ } else {
//This assumes that we are on the ultimate execution thread
ThreadContextMigratorUtil.performMigrationToContext(
Constants.THREAD_CONTEXT_MIGRATOR_LIST_ID, axisResponseMsgCtx);
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/description/DescriptionTestUtils2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/description/DescriptionTestUtils2.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/description/DescriptionTestUtils2.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/description/DescriptionTestUtils2.java Fri Jul 27 05:27:54 2007
@@ -82,13 +82,10 @@
// Need to get to the private Service._delegate field in order to get to the ServiceDescription to test
ServiceDelegate returnServiceDelegate = null;
try {
- Field serviceDelgateField = service.getClass().getDeclaredField("_delegate");
+ Field serviceDelgateField = service.getClass().getDeclaredFields()[0];
serviceDelgateField.setAccessible(true);
returnServiceDelegate = (ServiceDelegate) serviceDelgateField.get(service);
} catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Fri Jul 27 05:27:54 2007
@@ -59,7 +59,6 @@
import org.apache.axis2.jaxws.provider.JAXBProviderTests;
import org.apache.axis2.jaxws.provider.SOAPFaultProviderTests;
import org.apache.axis2.jaxws.provider.SoapMessageProviderTests;
-import org.apache.axis2.jaxws.provider.SoapMessageMUProviderTests;
import org.apache.axis2.jaxws.provider.SourceMessageProviderTests;
import org.apache.axis2.jaxws.provider.SourceProviderTests;
import org.apache.axis2.jaxws.provider.StringMessageProviderTests;
@@ -157,7 +156,6 @@
suite.addTestSuite(SourceMessageProviderTests.class);
// TODO FIXME: Test fails
//suite.addTestSuite(SoapMessageProviderTests.class);
- suite.addTestSuite(SoapMessageMUProviderTests.class);
suite.addTestSuite(JAXBProviderTests.class);
suite.addTestSuite(ProxyTests.class);
//TODO: FIXME - Was working, now doesn't
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java Fri Jul 27 05:27:54 2007
@@ -21,23 +21,11 @@
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.OutputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
import java.util.Iterator;
import javax.imageio.IIOImage;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConstants;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
/**
* This will serve as a helper class for attachments utility methods. All methods
@@ -45,81 +33,7 @@
*
*/
public class AttachmentUtil {
- public static final String SOAP11_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope";
- public static final String SOAP12_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
-
- public static final String MU_TEXT = "soap message mustUnderstand header request";
- public static final String UNDERSTOOD_MU_TEXT = "understood headers soap message mustUnderstand header request";
- public static final String TEXT = "soap message request";
- public static final String VALUE = "value";
- public static final String VALUE_NODE = "<"+VALUE+">";
- public static final String VALUE_NODE_SLASH = "</"+VALUE+">";
- public static final String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- public static final String MUHEADER_CLIENT = "ns1:muclient";
- public static final String MUHEADER_SERVER = "ns1:muserver";
- public static final String MUHEADER_CLIENT_UNDERSTOOD = "ns1:muclientunderstood";
- public static final String MUHEADER_SERVER_UNDERSTOOD = "ns1:muserverunderstood";
- public static final String msgEnvMU =
- "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soapenv:Header>" +
- "<"+MUHEADER_CLIENT+" xmlns:ns1=\"http://ws.apache.org/axis2\" soapenv:mustUnderstand=\"1\">MUinfo</"+MUHEADER_CLIENT+">" +
- "</soapenv:Header>" +
- "<soapenv:Body>" +
- "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
- VALUE_NODE +
- MU_TEXT +
- VALUE_NODE_SLASH +
- "</ns1:invoke>" +
- "</soapenv:Body>" +
- "</soapenv:Envelope>";
-
- public static final String msgEnv =
- "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soapenv:Body>" +
- "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
- VALUE_NODE +
- MU_TEXT +
- VALUE_NODE_SLASH +
- "</ns1:invoke>" +
- "</soapenv:Body>" +
- "</soapenv:Envelope>";
-
- public static final String msgEnvPlain =
- "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soapenv:Body>" +
- "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
- VALUE_NODE +
- TEXT +
- VALUE_NODE_SLASH +
- "</ns1:invoke>" +
- "</soapenv:Body>" +
- "</soapenv:Envelope>";
-
- public static final String msgEnvMU_understood =
- "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soapenv:Header>" +
- "<"+MUHEADER_CLIENT_UNDERSTOOD+" xmlns:ns1=\"http://ws.apache.org/axis2\" soapenv:mustUnderstand=\"1\">MUinfo</"+MUHEADER_CLIENT_UNDERSTOOD+">" +
- "</soapenv:Header>" +
- "<soapenv:Body>" +
- "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
- VALUE_NODE +
- UNDERSTOOD_MU_TEXT +
- VALUE_NODE_SLASH +
- "</ns1:invoke>" +
- "</soapenv:Body>" +
- "</soapenv:Envelope>";
-
- public static final String msgEnv_understood =
- "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- "<soapenv:Body>" +
- "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
- VALUE_NODE +
- UNDERSTOOD_MU_TEXT +
- VALUE_NODE_SLASH +
- "</ns1:invoke>" +
- "</soapenv:Body>" +
- "</soapenv:Envelope>";
-
+
/**
* Store a given image to an Image output stream
* @param mimeType
@@ -142,81 +56,5 @@
ios.flush();
imageWriter.dispose();
}
-
- /**
- * Adapter method used to convert any type of Source to a String
- *
- * @param input
- * @return
- */
- public static String toString(Source input) {
-
- if (input == null)
- return null;
-
- StringWriter writer = new StringWriter();
- Transformer trasformer;
- try {
- trasformer = TransformerFactory.newInstance().newTransformer();
- Result result = new StreamResult(writer);
- trasformer.transform(input, result);
- } catch (Exception e) {
- return null;
- }
-
- return writer.getBuffer().toString();
- }
-
- /**
- * Adapter method used to convert any type of SOAPMessage to a String
- *
- * @param input
- * @return
- */
- public static String toString(SOAPMessage input) {
-
- if (input == null)
- return null;
-
- Source result = null;
- try {
- result = input.getSOAPPart().getContent();
- } catch (SOAPException e) {
- e.printStackTrace();
- }
-
- return toString(result);
- }
-
- /**
- * Method used to convert Strings to SOAPMessages
- *
- * @param msgString
- * @return
- */
- public static SOAPMessage toSOAPMessage(String msgString) {
-
- if (msgString == null) return null;
-
- SOAPMessage message = null;
- try {
- MessageFactory factory = null;
-
- // Force the usage of specific MesasgeFactories
- if (msgString.indexOf(SOAP11_NAMESPACE) >= 0) {
- factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
- } else {
- factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
- }
- message = factory.createMessage();
- message.getSOAPPart().setContent((Source) new StreamSource(new StringReader(msgString)));
- message.saveChanges();
- } catch (SOAPException e) {
- System.out.println("toSOAPMessage Exception encountered: " + e);
- e.printStackTrace();
- }
- return message;
- }
-
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.java Fri Jul 27 05:27:54 2007
@@ -40,6 +40,16 @@
*/
public int addNumbersHandler(int arg0, int arg1) throws AddNumbersHandlerFault_Exception {
+ HandlerTracker tracker = HandlerTracker.getHandlerTracker(AddNumbersProtocolHandler.class);
+ if (!tracker.isCalled(HandlerTracker.Methods.HANDLE_MESSAGE)) {
+ throw new RuntimeException("handleMessage() was not called on the handler");
+ }
+ /* FIXME: getHeaders() is currently not called
+ if (!tracker.isCalled(HandlerTracker.Methods.GET_HEADERS)) {
+ throw new RuntimeException("getHeaders() was not called on the handler");
+ }
+ */
+
// for these properties tests to always pass, an inbound server-side handler must "put" them
MessageContext mc = ctx.getMessageContext();
String propKey1 = "AddNumbersLogicalHandlerInboundAppScopedProperty";
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersProtocolHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersProtocolHandler.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersProtocolHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersProtocolHandler.java Fri Jul 27 05:27:54 2007
@@ -26,18 +26,24 @@
public class AddNumbersProtocolHandler implements javax.xml.ws.handler.soap.SOAPHandler<SOAPMessageContext> {
+ HandlerTracker tracker = HandlerTracker.getHandlerTracker(AddNumbersProtocolHandler.class);
+
public void close(MessageContext messagecontext) {
+ tracker.close(messagecontext);
}
public Set<QName> getHeaders() {
+ tracker.getHeaders();
return null;
}
public boolean handleFault(SOAPMessageContext messagecontext) {
+ tracker.handleFault(messagecontext);
return true;
}
public boolean handleMessage(SOAPMessageContext messagecontext) {
+ tracker.handleMessage(messagecontext);
return true;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Fri Jul 27 05:27:54 2007
@@ -48,7 +48,6 @@
import org.apache.axis2.transport.TransportListener;
import org.apache.axis2.transport.TransportSender;
import org.apache.axis2.util.Loader;
-import org.apache.axis2.util.SOAPMustUnderstandHeaderChecker;
import org.apache.axis2.util.TargetResolver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -123,12 +122,6 @@
config_element.getFirstChildWithName(new QName(TAG_TARGET_RESOLVERS));
processTargetResolvers(axisConfig, targetResolvers);
- // Process SOAPMustUnderstandHeaderCheckers
- OMElement headerCheckers =
- config_element.getFirstChildWithName(new QName(TAG_MUSTUNDERSTAND_CHECKERS));
- processMustUnderstandCheckers(axisConfig, headerCheckers);
-
-
// Process Observers
Iterator obs_ittr = config_element.getChildrenWithName(new QName(TAG_LISTENER));
@@ -246,30 +239,6 @@
if (log.isTraceEnabled()) {
log.trace(
"processTargetResolvers: Exception thrown initialising TargetResolver: " +
- e.getMessage());
- }
- }
- }
- }
- }
-
- private void processMustUnderstandCheckers(AxisConfiguration axisConfig, OMElement headerCheckers) {
- if (headerCheckers != null) {
- Iterator iterator = headerCheckers.getChildrenWithName(new QName(TAG_MUSTUNDERSTAND_CHECKER));
- while (iterator.hasNext()) {
- OMElement headerChecker = (OMElement) iterator.next();
- OMAttribute classNameAttribute =
- headerChecker.getAttribute(new QName(TAG_CLASS_NAME));
- String className = classNameAttribute.getAttributeValue();
- try {
- Class classInstance = Loader.loadClass(className);
- SOAPMustUnderstandHeaderChecker checkerClass =
- (SOAPMustUnderstandHeaderChecker) classInstance.newInstance();
- axisConfig.addMustUnderstandHeaderChecker(checkerClass);
- } catch (Exception e) {
- if (log.isTraceEnabled()) {
- log.trace(
- "processHeaderCheckers: Exception thrown initialising SOAPMustUnderstandHeaderChecker: " +
e.getMessage());
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Fri Jul 27 05:27:54 2007
@@ -51,8 +51,6 @@
String TAG_TYPE = "type";
String TAG_TARGET_RESOLVERS = "targetResolvers";
String TAG_TARGET_RESOLVER = "targetResolver";
- String TAG_MUSTUNDERSTAND_CHECKERS = "soapMustUnderstandCheckers";
- String TAG_MUSTUNDERSTAND_CHECKER = "soapMustUnderstandChecker";
String TAG_TRANSPORT_SENDER = "transportSender";
String TAG_TRANSPORT_RECEIVER = "transportReceiver";
String TAG_SERVICE_GROUP = "serviceGroup";
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml Fri Jul 27 05:27:54 2007
@@ -124,17 +124,6 @@
<!--<targetResolver class="" />-->
<!--</targetResolvers>-->
- <!-- ================================================= -->
- <!-- SOAP Must Understand Header Checkers -->
- <!-- ================================================= -->
- <!-- Uncomment the following and specify the class name for your SOAPMustUnderstandHeaderChecker -->
- <!-- implementation to add a header checker. Header checkers are used to identify SOAP Header -->
- <!-- QNames that will be processed by components (such as a MessageReceiver) after the point -->
- <!-- the Axis2 engine checks that all mustUnderstand headers are understood. -->
- <!-- <soapMustUnderstandCheckers> -->
- <!-- <soapMustUnderstandChecker class="" /> -->
- <!-- </soapMustUnderstandCheckers> -->
-
<!-- ================================================= -->
<!-- Transport Ins -->
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java Fri Jul 27 05:27:54 2007
@@ -36,6 +36,7 @@
import org.apache.axis2.engine.AxisEngine;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.util.CallbackReceiver;
import org.apache.axis2.util.Utils;
import org.apache.axis2.wsdl.WSDLConstants;
@@ -371,6 +372,13 @@
AxisEngine.send(msgContext);
responseMessageContext.setDoingREST(msgContext.isDoingREST());
+
+ // Copy RESPONSE properties which the transport set onto the request message context when it processed
+ // the incoming response recieved in reply to an outgoing request.
+ responseMessageContext.setProperty(MessageContext.TRANSPORT_HEADERS,
+ msgContext.getProperty(MessageContext.TRANSPORT_HEADERS));
+ responseMessageContext.setProperty(HTTPConstants.MC_HTTP_STATUS_CODE,
+ msgContext.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE));
responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgContext
.getProperty(MessageContext.TRANSPORT_IN));
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java Fri Jul 27 05:27:54 2007
@@ -33,7 +33,6 @@
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.phaseresolver.PhaseResolver;
import org.apache.axis2.transport.MessageFormatter;
-import org.apache.axis2.util.SOAPMustUnderstandHeaderChecker;
import org.apache.axis2.util.TargetResolver;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
@@ -125,8 +124,6 @@
private boolean start;
private ArrayList targetResolvers;
-
- private ArrayList mustUnderstandHeaderCheckers;
private ClusterManager clusterManager;
@@ -159,7 +156,6 @@
this.phasesinfo = new PhasesInfo();
targetResolvers = new ArrayList();
- mustUnderstandHeaderCheckers = new ArrayList();
}
public void addMessageReceiver(String mepURL,
@@ -1015,29 +1011,6 @@
public void addTargetResolver(TargetResolver tr) {
targetResolvers.add(tr);
}
-
- /**
- * Return an iterator over implentations of SOAPMustUnderstandHeaderChecker. These
- * implentations are called during mustUnderstand validation with a HashMap of headers
- * for the actor/role the engine is currently acting in. They can remove headers they
- * understand from the map so those headers, if marked mustUnderstand and not yet processed,
- * do not cause a mustUnderstand fault to be thrown.
- *
- * @return an iterator over SOAPMustUnderstandHeaderChecker implementations. It may be
- * empty if none are configured.
- */
- public Iterator getMustUnderstandHeaderCheckers() {
- return mustUnderstandHeaderCheckers.iterator();
- }
-
- /**
- * Add an implementation of SOAPMustUnderstandHeaderChecker to the list of checkers.
- *
- * @param checker The implementation to be added.
- */
- public void addMustUnderstandHeaderChecker(SOAPMustUnderstandHeaderChecker checker) {
- mustUnderstandHeaderCheckers.add(checker);
- }
public void addLocalPolicyAssertion(QName name) {
this.localPolicyAssertions.add(name);
@@ -1123,4 +1096,3 @@
}
}
}
-
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Fri Jul 27 05:27:54 2007
@@ -36,13 +36,11 @@
import org.apache.axis2.util.CallbackReceiver;
import org.apache.axis2.util.LoggingControl;
import org.apache.axis2.util.MessageContextBuilder;
-import org.apache.axis2.util.SOAPMustUnderstandHeaderChecker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
/**
@@ -65,10 +63,7 @@
public AxisEngine(ConfigurationContext engineContext) {
}
- public static void checkMustUnderstand(MessageContext msgContext) throws AxisFault {
- if (msgContext == null) {
- return;
- }
+ private static void checkMustUnderstand(MessageContext msgContext) throws AxisFault {
SOAPEnvelope envelope = msgContext.getEnvelope();
if (envelope.getHeader() == null) {
return;
@@ -77,12 +72,9 @@
// Get all the headers targeted to us
Iterator headerBlocks = envelope.getHeader().getHeadersToProcess(null);
- // Have the mustUnderstand Header checkers remove any headers from the list they understand
- Iterator notUnderstoodHeaders = removeUnderstoodHeaders(msgContext, headerBlocks);
-
- while (notUnderstoodHeaders.hasNext()) {
- SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) notUnderstoodHeaders.next();
-
+ while (headerBlocks.hasNext()) {
+ SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
+
// if this header block has been processed or mustUnderstand isn't
// turned on then its cool
if (headerBlock.isProcessed() || !headerBlock.getMustUnderstand()) {
@@ -97,51 +89,6 @@
}
}
- private static Iterator removeUnderstoodHeaders(MessageContext msgContext, Iterator headerBlocks) {
- Iterator mustUnderstandCheckers = msgContext.getConfigurationContext()
- .getAxisConfiguration().getMustUnderstandHeaderCheckers();
- Iterator notUnderstoodHeaders = null;
-
- if (mustUnderstandCheckers != null && mustUnderstandCheckers.hasNext()) {
- // Create a map of the headers that need to be understood keyed by the header QName
- // to make it easy for the checkers to find the headers they understand, then let
- // each of the checkers remove any headers from the map that they will understand.
- // REVIEW: Can there be duplicate SOAP header QNames? If so, the vaules of the map
- // need to be a linked list or the collection needs to support duplicate keys.
- HashMap notYetUnderstoodHeaders = new HashMap();
- while (headerBlocks.hasNext()) {
- SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
- notYetUnderstoodHeaders.put(headerBlock.getQName(), headerBlock);
- }
-
- while (mustUnderstandCheckers.hasNext()) {
- SOAPMustUnderstandHeaderChecker checker =
- (SOAPMustUnderstandHeaderChecker) mustUnderstandCheckers.next();
- if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
- log.debug("Before calling mustUnderstandChecker "
- + checker
- + " list of not-yet-understood headers is: "
- + notYetUnderstoodHeaders);
- }
-
- notYetUnderstoodHeaders =
- checker.removeUnderstoodHeaders(msgContext, notYetUnderstoodHeaders);
-
- if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
- log.debug("After calling mustUnderstandChecker "
- + checker
- + " list of not-yet-understood headers is: "
- + notYetUnderstoodHeaders);
- }
- }
- notUnderstoodHeaders = notYetUnderstoodHeaders.values().iterator();
- } else {
- // There are no validators, so just return the Iterator paramster unchanged
- notUnderstoodHeaders = headerBlocks;
- }
- return notUnderstoodHeaders;
- }
-
/**
* This method is called to handle any error that occurs at inflow or outflow. But if the
* method is called twice, it implies that sending the error handling has failed, in which case
@@ -185,9 +132,9 @@
InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);
if (pi.equals(InvocationResponse.CONTINUE)) {
- checkMustUnderstand(msgContext);
if (msgContext.isServerSide()) {
// invoke the Message Receivers
+ checkMustUnderstand(msgContext);
MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
if (receiver == null) {
@@ -330,9 +277,9 @@
//invoking the MR
if (pi.equals(InvocationResponse.CONTINUE)) {
- checkMustUnderstand(msgContext);
if (msgContext.isServerSide()) {
// invoke the Message Receivers
+ checkMustUnderstand(msgContext);
MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
if (receiver == null) {
throw new AxisFault(Messages.getMessage(
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Fri Jul 27 05:27:54 2007
@@ -101,8 +101,11 @@
*/
protected void obtainHTTPHeaderInformation(HttpMethodBase method,
MessageContext msgContext) throws AxisFault {
+ // Set RESPONSE properties onto the REQUEST message context. They will need to be copied off the request context onto
+ // the response context elsewhere, for example in the OutInOperationClient.
Map transportHeaders = new CommonsTransportHeaders(method.getResponseHeaders());
msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, transportHeaders);
+ msgContext.setProperty(HTTPConstants.MC_HTTP_STATUS_CODE, new Integer(method.getStatusCode()));
Header header = method.getResponseHeader(HTTPConstants.HEADER_CONTENT_TYPE);
if (header != null) {
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?view=diff&rev=560215&r1=560214&r2=560215
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Fri Jul 27 05:27:54 2007
@@ -296,18 +296,21 @@
WsdlComposite wsdlComposite = null;
String bindingType = getBindingType();
- boolean isSOAP12 = (bindingType.equals( javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
- || bindingType.equals(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING))
- ? true : false;
- //Determine if we need to generate WSDL
- //First, make sure that this is not a SOAP 1.2 based binding, per JAXWS spec. we cannot
- //generate WSDL if the binding type is SOAP 1.2 based.
- //Then, assuming the composite does not contain a
- //Wsdl Definition, go ahead and generate it
+ boolean isSOAP11 =
+ (bindingType.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING) ||
+ bindingType.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING))
+ ? true : false;
+
+
+ // Determine if we need to generate WSDL
+ // First, make sure that this is only a SOAP 1.1 based binding, per JAXWS spec. we cannot
+ // generate WSDL if the binding type is not SOAP 1.1 based.
+ // Then, assuming the composite does not contain a
+ // Wsdl Definition, go ahead and generate it
// REVIEW: I think this should this be isSOAP11 so the generators are only called for
// SOAP11; i.e. NOT for SOAP12 or XML/HTTP bindings.
- if (!isSOAP12) {
+ if (isSOAP11){
if (
(isEndpointBased() &&
DescriptionUtils.isEmpty(getAnnoWebServiceEndpointInterface()))
@@ -341,7 +344,7 @@
+ composite.getClassName());
}
- if (!isSOAP12) {
+ if (isSOAP11){
//Save the WSDL Location and the WsdlDefinition, value depends on whether wsdl was generated
Parameter wsdlLocationParameter = new Parameter();
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org