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 2008/01/27 18:48:47 UTC
svn commit: r615621 [1/2] - in /webservices/axis2/trunk/java/modules:
addressing/src/org/apache/axis2/handlers/addressing/
addressing/test/org/apache/axis2/handlers/addressing/
jaxws-api/src/javax/xml/ws/ jaxws-api/src/javax/xml/ws/handler/
jaxws-api/s...
Author: pradine
Date: Sun Jan 27 09:48:25 2008
New Revision: 615621
URL: http://svn.apache.org/viewvc?rev=615621&view=rev
Log:
Merge changes from the jaxws21 branch into the trunk.
Added:
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Action.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/Action.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/EndpointReference.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/EndpointReference.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/FaultAction.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/FaultAction.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/RespectBinding.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/RespectBinding.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/RespectBindingFeature.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/RespectBindingFeature.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceFeature.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/WebServiceFeature.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/soap/Addressing.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/soap/Addressing.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/soap/AddressingFeature.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/soap/AddressingFeature.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/soap/MTOM.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/soap/MTOM.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/soap/MTOMFeature.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/soap/MTOMFeature.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/wsaddressing/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReference.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/wsaddressing/package-info.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws-api/src/javax/xml/ws/wsaddressing/package-info.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReferenceBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/Axis2EndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/JAXWSEndpointReferenceFactoryImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointKey.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMap.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointMap.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/ReferenceParameterList.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/ReferenceParameterList.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/config/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/AddressingConfigurator.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/MTOMConfigurator.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/config/RespectBindingConfigurator.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/feature/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientConfigurator.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/ClientFramework.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Binding.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Binding.java
webservices/axis2/trunk/java/modules/jaxws/test-resources/xml/referenceparameters.xml
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/test-resources/xml/referenceparameters.xml
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtilsTests.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/EndpointReferenceUtilsTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/ReferenceParameterListTests.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/addressing/util/ReferenceParameterListTests.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/metadata/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/metadata/
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/metadata/InterfaceName.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/metadata/InterfaceName.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/metadata/ServiceName.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/metadata/ServiceName.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/metadata/WSDLLocation.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/metadata/WSDLLocation.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/addressing/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerConfigurator.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/server/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/server/config/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/AddressingConfigurator.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/MTOMConfigurator.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java
webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/feature/
- copied from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/feature/
webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/feature/MTOMFeatureTests.java
- copied unchanged from r615581, webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/feature/MTOMFeatureTests.java
Removed:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/ServiceName.java
Modified:
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Binding.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/BindingProvider.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Endpoint.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Service.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceContext.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/handler/MessageContext.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/Provider.java
webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/ServiceDelegate.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/Constants.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReferenceHelper.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescriptionJava.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceContextAnnot.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Sun Jan 27 09:48:25 2008
@@ -70,8 +70,22 @@
}
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
- SOAPHeader header = msgContext.getEnvelope().getHeader();
+ //Determine if we want to ignore addressing headers. This parameter cannot be
+ //retrieved from the HandlerDescription because it's value can vary on a per
+ //service basis.
+ Parameter disableParam = msgContext.getParameter(DISABLE_ADDRESSING_HANDLERS);
+ String value = Utils.getParameterValue(disableParam);
+ if (JavaUtils.isTrueExplicitly(value)) {
+ if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+ log.debug(
+ "The handler has been disabled. No further processing will take place.");
+ }
+ msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
+ return InvocationResponse.CONTINUE;
+ }
+
// if there are not headers put a flag to disable addressing temporary
+ SOAPHeader header = msgContext.getEnvelope().getHeader();
if (header == null) {
msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
return InvocationResponse.CONTINUE;
@@ -120,7 +134,7 @@
log.debug(namespace +
" Headers present in the SOAP message. Starting to process ...");
}
- if (extractAddressingInformation(header, msgContext, iterator, namespace, disableRefparamExtract)) {
+ if (extractAddressingInformation(header, msgContext, iterator, namespace)) {
msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
}
}
@@ -141,12 +155,11 @@
* @param messageContext the active MessageContext
* @param headers an Iterator over the addressing headers targeted to me
* @param namespace the addressing namespace
- * @param disableRefparamExtract whether to disable processing of reference parameters or not.
* @return true if addressing information was found
* @throws AxisFault if an error occurs
*/
boolean extractAddressingInformation(SOAPHeader header, MessageContext messageContext,
- Iterator headers, String namespace, boolean disableRefparamExtract)
+ Iterator headers, String namespace)
throws AxisFault {
Options messageContextOptions = messageContext.getOptions();
@@ -217,8 +230,7 @@
extractToEPRInformation(toBlock,
messageContextOptions,
header,
- namespace,
- disableRefparamExtract);
+ namespace);
}
if (messageIDBlock != null && !ignoreHeaders[MESSAGEID_FLAG]) {
extractMessageIDInformation(messageIDBlock, messageContext);
@@ -426,7 +438,7 @@
private void extractToEPRInformation(SOAPHeaderBlock soapHeaderBlock,
Options messageContextOptions, SOAPHeader header,
- String namespace, boolean disableRefparamExtract) {
+ String namespace) {
EndpointReference epr;
//here the addressing epr overidde what ever already there in the message context
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingInHandlerTestBase.java Sun Jan 27 09:48:25 2008
@@ -75,7 +75,7 @@
.getAxisConfiguration().getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
Iterator addressingHeaderBlocks = header.getHeadersToProcess(rolePlayer, addressingNamespace);
inHandler.extractAddressingInformation(header, mc, addressingHeaderBlocks,
- addressingNamespace, false);
+ addressingNamespace);
}
protected Options extractAddressingInformationFromHeaders(RolePlayer rolePlayer) throws Exception{
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Binding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Binding.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Binding.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Binding.java Sun Jan 27 09:48:25 2008
@@ -23,6 +23,8 @@
public interface Binding {
+ public abstract String getBindingID();
+
public abstract List<Handler> getHandlerChain();
public abstract void setHandlerChain(List<Handler> list);
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/BindingProvider.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/BindingProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/BindingProvider.java Sun Jan 27 09:48:25 2008
@@ -21,6 +21,10 @@
import java.util.Map;
public interface BindingProvider {
+
+ public abstract EndpointReference getEndpointReference();
+
+ public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
public abstract Map<java.lang.String, java.lang.Object> getRequestContext();
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Endpoint.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Endpoint.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Endpoint.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Endpoint.java Sun Jan 27 09:48:25 2008
@@ -64,6 +64,10 @@
public abstract void setProperties(Map<java.lang.String, java.lang.Object> map);
+ public abstract EndpointReference getEndpointReference(org.w3c.dom.Element... referenceParameters);
+
+ public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, org.w3c.dom.Element... referenceParameters);
+
public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
}
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Service.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Service.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Service.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/Service.java Sun Jan 27 09:48:25 2008
@@ -23,7 +23,6 @@
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
-import java.net.URI;
import java.net.URL;
import java.util.Iterator;
import java.util.concurrent.Executor;
@@ -44,6 +43,18 @@
return (T) _delegate.getPort(serviceEndpointInterface);
}
+ public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+ return (T) _delegate.getPort(portName, serviceEndpointInterface, features);
+ }
+
+ public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+ return (T) _delegate.getPort(serviceEndpointInterface, features);
+ }
+
+ public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features) {
+ return (T) _delegate.getPort(endpointReference, serviceEndpointInterface, features);
+ }
+
public void addPort(QName portName, String bindingId, String endpointAddress) {
_delegate.addPort(portName, bindingId, endpointAddress);
}
@@ -52,15 +63,31 @@
return _delegate.createDispatch(portName, type, mode);
}
- public Dispatch<java.lang.Object> createDispatch(QName portName, JAXBContext context, Mode mode) {
+ public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode) {
return _delegate.createDispatch(portName, context, mode);
}
+ public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode, WebServiceFeature... features) {
+ return _delegate.createDispatch(portName, type, mode, features);
+ }
+
+ public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features) {
+ return _delegate.createDispatch(endpointReference, type, mode, features);
+ }
+
+ public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
+ return _delegate.createDispatch(portName, context, mode, features);
+ }
+
+ public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
+ return _delegate.createDispatch(endpointReference, context, mode, features);
+ }
+
public QName getServiceName() {
return _delegate.getServiceName();
}
- public Iterator<javax.xml.namespace.QName> getPorts() {
+ public Iterator<QName> getPorts() {
return _delegate.getPorts();
}
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceContext.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceContext.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/WebServiceContext.java Sun Jan 27 09:48:25 2008
@@ -23,6 +23,10 @@
public interface WebServiceContext {
+ public abstract EndpointReference getEndpointReference(org.w3c.dom.Element... referenceParameters);
+
+ public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, org.w3c.dom.Element... referenceParameters);
+
public abstract MessageContext getMessageContext();
public abstract Principal getUserPrincipal();
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/handler/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/handler/MessageContext.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/handler/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/handler/MessageContext.java Sun Jan 27 09:48:25 2008
@@ -38,6 +38,7 @@
public static final String WSDL_INTERFACE = "javax.xml.ws.wsdl.interface";
public static final String WSDL_OPERATION = "javax.xml.ws.wsdl.operation";
public static final String HTTP_RESPONSE_CODE = "javax.xml.ws.http.response.code";
+ public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters";
public static final String HTTP_REQUEST_HEADERS = "javax.xml.ws.http.request.headers";
public static final String HTTP_RESPONSE_HEADERS = "javax.xml.ws.http.response.headers";
public static final String HTTP_REQUEST_METHOD = "javax.xml.ws.http.request.method";
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/Provider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/Provider.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/Provider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/Provider.java Sun Jan 27 09:48:25 2008
@@ -16,12 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package javax.xml.ws.spi;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.w3c.dom.Element;
+
import java.net.URL;
+import java.util.List;
public abstract class Provider {
@@ -29,7 +36,7 @@
}
public static Provider provider() {
- return (Provider) FactoryFinder.find("javax.xml.ws.spi.Provider", DEFAULT_JAXWSPROVIDER);
+ return (Provider) FactoryFinder.find(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER);
}
public abstract ServiceDelegate createServiceDelegate(URL url, QName qname, Class class1);
@@ -38,6 +45,17 @@
public abstract Endpoint createAndPublishEndpoint(String s, Object obj);
+ public abstract EndpointReference readEndpointReference(Source eprInfoset);
+
+ public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ public abstract W3CEndpointReference createW3CEndpointReference(String address,
+ QName serviceName,
+ QName portName,
+ List<Element> metadata,
+ String wsdlDocumentLocation,
+ List<Element> referenceParameters);
+
public static final String JAXWSPROVIDER_PROPERTY = "javax.xml.ws.spi.Provider";
private static final String DEFAULT_JAXWSPROVIDER = "org.apache.axis2.jaxws.spi.Provider";
}
Modified: webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/ServiceDelegate.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/ServiceDelegate.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/ServiceDelegate.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-api/src/javax/xml/ws/spi/ServiceDelegate.java Sun Jan 27 09:48:25 2008
@@ -21,8 +21,10 @@
import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.ws.Dispatch;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.HandlerResolver;
-import java.net.URI;
import java.net.URL;
import java.util.Iterator;
import java.util.concurrent.Executor;
@@ -36,15 +38,29 @@
public abstract <T> T getPort(Class<T> class1);
+ public abstract <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ public abstract <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
public abstract void addPort(QName qname, String bindingId, String s);
- public abstract <T>Dispatch<T> createDispatch(QName qname, Class<T> class1, javax.xml.ws.Service.Mode mode);
+ public abstract <T>Dispatch<T> createDispatch(QName qname, Class<T> class1, Service.Mode mode);
- public abstract Dispatch<java.lang.Object> createDispatch(QName qname, JAXBContext jaxbcontext, javax.xml.ws.Service.Mode mode);
+ public abstract Dispatch<Object> createDispatch(QName qname, JAXBContext jaxbcontext, javax.xml.ws.Service.Mode mode);
+ public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode, WebServiceFeature... features);
+
+ public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features);
+
+ public abstract Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features);
+
+ public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features);
+
public abstract QName getServiceName();
- public abstract Iterator<javax.xml.namespace.QName> getPorts();
+ public abstract Iterator<QName> getPorts();
public abstract URL getWSDLDocumentLocation();
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java Sun Jan 27 09:48:25 2008
@@ -18,27 +18,34 @@
*/
package org.apache.axis2.jaxws;
+import java.net.URL;
import java.util.Hashtable;
import java.util.Map;
+import javax.xml.namespace.QName;
import javax.xml.ws.Binding;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
import org.apache.axis2.jaxws.binding.BindingUtils;
import org.apache.axis2.jaxws.binding.SOAPBinding;
import org.apache.axis2.jaxws.client.PropertyValidator;
import org.apache.axis2.jaxws.core.InvocationContext;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
import org.apache.axis2.jaxws.handler.HandlerResolverImpl;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.spi.ServiceDelegate;
import org.apache.axis2.transport.http.HTTPConstants;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class BindingProvider implements org.apache.axis2.jaxws.spi.BindingProvider {
-
protected Map<String, Object> requestContext;
protected Map<String, Object> responseContext;
@@ -46,37 +53,52 @@
protected EndpointDescription endpointDesc;
protected ServiceDelegate serviceDelegate;
+
+ protected org.apache.axis2.addressing.EndpointReference epr;
+
+ protected String addressingNamespace;
- private Binding binding = null;
+ private org.apache.axis2.jaxws.spi.Binding binding = null;
private static final Log log = LogFactory.getLog(BindingProvider.class);
- public BindingProvider(ServiceDelegate svcDelegate, EndpointDescription epDesc) {
- endpointDesc = epDesc;
- serviceDelegate = svcDelegate;
-
- initialize();
+ public BindingProvider(ServiceDelegate svcDelegate,
+ EndpointDescription epDesc,
+ org.apache.axis2.addressing.EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ this.endpointDesc = epDesc;
+ this.serviceDelegate = svcDelegate;
+ this.epr = epr;
+ this.addressingNamespace = addressingNamespace;
+
+ initialize(features);
}
/*
* Initialize any objects needed by the BindingProvider
*/
- private void initialize() {
+ private void initialize(WebServiceFeature... features) {
requestContext = new ValidatingClientContext();
responseContext = new ValidatingClientContext();
-
+
// Setting standard property defaults for the request context
- requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, new Boolean(false));
- requestContext.put(BindingProvider.SOAPACTION_USE_PROPERTY, new Boolean(true));
-
+ requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, Boolean.FALSE);
+ requestContext.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+
// Set the endpoint address
- String endpointAddress = endpointDesc.getEndpointAddress();
- if (endpointAddress != null) {
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
+ String endpointAddress = (epr != null ) ? epr.getAddress() : endpointDesc.getEndpointAddress();
+ if (endpointAddress != null && !"".equals(endpointAddress)) {
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
}
// JAXWS 9.2.1.1 requires that we go ahead and create the binding object
// so we can also set the handlerchain
- if (binding == null) {
- binding = BindingUtils.createBinding(endpointDesc);
+ binding = (org.apache.axis2.jaxws.spi.Binding) BindingUtils.createBinding(endpointDesc);
+ if(log.isDebugEnabled()){
+ log.debug("Lookign for Handler Resolver");
+ }
+ // TODO should we allow the ServiceDelegate to figure out the default handlerresolver? Probably yes, since a client app may look for one there.
+ HandlerResolver handlerResolver = null;
+ if(serviceDelegate.getHandlerResolver() != null){
// See if the metadata from creating the service indicates that MTOM should be enabled
if (binding instanceof SOAPBinding) {
@@ -87,25 +109,19 @@
}
if(log.isDebugEnabled()){
- log.debug("Lookign for Handler Resolver");
+ log.debug("Reading default Handler Resolver ");
}
- // TODO should we allow the ServiceDelegate to figure out the default handlerresolver? Probably yes, since a client app may look for one there.
- HandlerResolver handlerResolver = null;
- if(serviceDelegate.getHandlerResolver() != null){
- if(log.isDebugEnabled()){
- log.debug("Reading default Handler Resolver ");
- }
- handlerResolver= serviceDelegate.getHandlerResolver();
- }
- else{
- handlerResolver = new HandlerResolverImpl(endpointDesc.getServiceDescription());
- if(log.isDebugEnabled()){
- log.debug("Creating new Handler Resolver using HandlerResolverImpl");
- }
+ handlerResolver= serviceDelegate.getHandlerResolver();
+ }
+ else{
+ handlerResolver = new HandlerResolverImpl(endpointDesc.getServiceDescription());
+ if(log.isDebugEnabled()){
+ log.debug("Creating new Handler Resolver using HandlerResolverImpl");
}
- binding.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
}
-
+ binding.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
+
+ binding.setWebServiceFeatures(features);
}
public ServiceDelegate getServiceDelegate() {
@@ -119,10 +135,6 @@
public Binding getBinding() {
return binding;
}
-
- public void setBinding(Binding binding) {
- this.binding = binding;
- }
public Map<String, Object> getRequestContext() {
return requestContext;
@@ -215,10 +227,58 @@
}
}
+ public EndpointReference getEndpointReference() {
+ return getEndpointReference(W3CEndpointReference.class);
+ }
+
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz) {
+ EndpointReference jaxwsEPR = null;
+ String addressingNamespace = EndpointReferenceUtils.getAddressingNamespace(clazz);
+
+ if (!BindingUtils.isSOAPBinding(binding.getBindingID()))
+ throw new UnsupportedOperationException("This method is unsupported for the binding: " + binding.getBindingID());
+
+ try {
+ org.apache.axis2.addressing.EndpointReference epr =
+ getAxis2EndpointReference(addressingNamespace);
+ jaxwsEPR = EndpointReferenceUtils.convertFromAxis2(epr, addressingNamespace);
+ }
+ catch (Exception e) {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("Error creating endpoint reference", e);
+ }
+
+ return clazz.cast(jaxwsEPR);
+ }
+
+ public org.apache.axis2.addressing.EndpointReference getAxis2EndpointReference(String addressingNamespace) throws AxisFault {
+ org.apache.axis2.addressing.EndpointReference epr = this.epr;
+
+ if (epr == null || !addressingNamespace.equals(this.addressingNamespace)) {
+ String address = endpointDesc.getEndpointAddress();
+ QName service = endpointDesc.getServiceQName();
+ QName port = endpointDesc.getPortQName();
+ URL wsdlURL = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation();
+ String wsdlLocation = (wsdlURL != null) ? wsdlURL.toString() : null;
+
+ epr = EndpointReferenceUtils.createAxis2EndpointReference(address, service, port, wsdlLocation, addressingNamespace);
+ }
+
+ return epr;
+ }
+
+ public String getAddressingNamespace() {
+ return addressingNamespace;
+ }
+
/*
* An inner class used to validate properties as they are set by the client.
*/
class ValidatingClientContext extends Hashtable<String, Object> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3485112205801917858L;
@Override
public synchronized Object put(String key, Object value) {
@@ -234,4 +294,6 @@
}
}
}
+
+
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java Sun Jan 27 09:48:25 2008
@@ -16,24 +16,32 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.axis2.jaxws.binding;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import javax.xml.ws.Binding;
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.Handler;
+import org.apache.axis2.jaxws.client.config.RespectBindingConfigurator;
+import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.feature.ClientConfigurator;
+import org.apache.axis2.jaxws.feature.ClientFramework;
import org.apache.axis2.jaxws.handler.HandlerResolverImpl;
+import org.apache.axis2.jaxws.spi.Binding;
+import org.apache.axis2.jaxws.spi.BindingProvider;
/**
- * @author rott classes that would normally "implement javax.xml.ws.Binding"
- * should extend this class instead.
+ * Classes that would normally "implement javax.xml.ws.Binding"
+ * should extend this class instead.
*/
-public class BindingImpl implements Binding {
+public abstract class BindingImpl implements Binding {
+ private static final ClientConfigurator RESPECT_BINDING_CONFIGURATOR =
+ new RespectBindingConfigurator();
// an unsorted list of handlers
private List<Handler> handlers = null;
@@ -43,15 +51,13 @@
private EndpointDescription endpointDesc;
protected Set<String> roles = null;
+
+ protected ClientFramework framework = null;
protected static final String SOAP11_ENV_NS = "http://schemas.xmlsoap.org/soap/envelope/";
protected static final String SOAP12_ENV_NS = "http://www.w3.org/2003/05/soap-envelope";
- public BindingImpl(String bindingId) {
- this.bindingId = bindingId;
- }
-
public BindingImpl(EndpointDescription endpointDesc) {
this.endpointDesc = endpointDesc;
// client
@@ -60,6 +66,9 @@
// server
this.bindingId = endpointDesc.getBindingType();
}
+
+ framework = new ClientFramework();
+ framework.addConfigurator(RespectBindingFeature.ID, RESPECT_BINDING_CONFIGURATOR);
}
public List<Handler> getHandlerChain() {
@@ -81,4 +90,26 @@
}
}
+ /**
+ * @since JAX-WS 2.1
+ */
+ public String getBindingID() {
+ return this.bindingId;
+ }
+
+ public void configure(MessageContext messageContext, BindingProvider provider) {
+ framework.configure(messageContext, provider);
+ }
+
+ public WebServiceFeature getWebServiceFeature(String id) {
+ return framework.getFeature(id);
+ }
+
+ public void setWebServiceFeatures(WebServiceFeature... features) {
+ if (features != null) {
+ for (WebServiceFeature feature : features) {
+ framework.addFeature(feature);
+ }
+ }
+ }
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java Sun Jan 27 09:48:25 2008
@@ -19,7 +19,11 @@
package org.apache.axis2.jaxws.binding;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+import org.apache.axis2.jaxws.client.config.AddressingConfigurator;
+import org.apache.axis2.jaxws.client.config.MTOMConfigurator;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.feature.ClientConfigurator;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.utility.SAAJFactory;
import org.apache.commons.logging.Log;
@@ -30,8 +34,9 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
-import java.util.AbstractSet;
import java.util.HashSet;
import java.util.Set;
@@ -42,6 +47,10 @@
* explicitly specificied.
*/
public class SOAPBinding extends BindingImpl implements javax.xml.ws.soap.SOAPBinding {
+ private static final ClientConfigurator ADDRESSING_CONFIGURATOR =
+ new AddressingConfigurator();
+ private static final ClientConfigurator MTOM_CONFIGURATOR =
+ new MTOMConfigurator();
private boolean mtomEnabled = false;
@@ -49,6 +58,10 @@
public SOAPBinding(EndpointDescription endpointDesc) {
super(endpointDesc);
+
+ framework.addConfigurator(AddressingFeature.ID, ADDRESSING_CONFIGURATOR);
+ framework.addConfigurator(SubmissionAddressingFeature.ID, ADDRESSING_CONFIGURATOR);
+ framework.addConfigurator(MTOMFeature.ID, MTOM_CONFIGURATOR);
}
/*
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java Sun Jan 27 09:48:25 2008
@@ -22,13 +22,10 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPFault;
import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
import javax.xml.ws.ProtocolException;
import javax.xml.ws.Response;
import javax.xml.ws.WebServiceException;
@@ -37,7 +34,9 @@
import javax.xml.ws.http.HTTPException;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
+import javax.xml.ws.WebServiceFeature;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.jaxws.BindingProvider;
import org.apache.axis2.jaxws.ExceptionFactory;
@@ -51,13 +50,11 @@
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils;
import org.apache.axis2.jaxws.message.Message;
-import org.apache.axis2.jaxws.message.Protocol;
-import org.apache.axis2.jaxws.message.util.XMLFaultUtils;
+import org.apache.axis2.jaxws.spi.Binding;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.spi.ServiceDelegate;
import org.apache.axis2.jaxws.spi.migrator.ApplicationContextMigratorUtil;
-import org.apache.axis2.jaxws.utility.SAAJFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -72,8 +69,12 @@
protected Mode mode;
- protected BaseDispatch(ServiceDelegate svcDelgate, EndpointDescription epDesc) {
- super(svcDelgate, epDesc);
+ protected BaseDispatch(ServiceDelegate svcDelgate,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelgate, epDesc, epr, addressingNamespace, features);
InvocationControllerFactory icf = (InvocationControllerFactory) FactoryRegistry.getFactory(InvocationControllerFactory.class);
ic = icf.getInvocationController();
@@ -134,7 +135,8 @@
*/
// be sure to use whatever handlerresolver is registered on the Service
- invocationContext.setHandlers(getBinding().getHandlerChain());
+ Binding binding = (Binding) getBinding();
+ invocationContext.setHandlers(binding.getHandlerChain());
Message requestMsg = createRequestMessage(obj);
@@ -147,6 +149,9 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the WebServiceFeature configuration requested by the user.
+ binding.configure(requestMsgCtx, this);
+
// Send the request using the InvocationController
ic.invoke(invocationContext);
@@ -201,6 +206,21 @@
MessageContext requestMsgCtx = new MessageContext();
requestMsgCtx.setEndpointDescription(getEndpointDescription());
invocationContext.setRequestMessageContext(requestMsgCtx);
+
+ /*
+ * TODO: review: make sure the handlers are set on the InvocationContext
+ * This implementation of the JAXWS runtime does not use Endpoint, which
+ * would normally be the place to initialize and store the handler list.
+ * In lieu of that, we will have to intialize and store them on the
+ * InvocationContext. also see the InvocationContextFactory. On the client
+ * side, the binding is not yet set when we call into that factory, so the
+ * handler list doesn't get set on the InvocationContext object there. Thus
+ * we gotta do it here.
+ */
+
+ // be sure to use whatever handlerresolver is registered on the Service
+ Binding binding = (Binding) getBinding();
+ invocationContext.setHandlers(binding.getHandlerChain());
Message requestMsg = createRequestMessage(obj);
@@ -213,6 +233,9 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the WebServiceFeature configuration requested by the user.
+ binding.configure(requestMsgCtx, this);
+
// Send the request using the InvocationController
ic.invokeOneWay(invocationContext);
@@ -250,6 +273,21 @@
MessageContext requestMsgCtx = new MessageContext();
requestMsgCtx.setEndpointDescription(getEndpointDescription());
invocationContext.setRequestMessageContext(requestMsgCtx);
+
+ /*
+ * TODO: review: make sure the handlers are set on the InvocationContext
+ * This implementation of the JAXWS runtime does not use Endpoint, which
+ * would normally be the place to initialize and store the handler list.
+ * In lieu of that, we will have to intialize and store them on the
+ * InvocationContext. also see the InvocationContextFactory. On the client
+ * side, the binding is not yet set when we call into that factory, so the
+ * handler list doesn't get set on the InvocationContext object there. Thus
+ * we gotta do it here.
+ */
+
+ // be sure to use whatever handlerresolver is registered on the Service
+ Binding binding = (Binding) getBinding();
+ invocationContext.setHandlers(binding.getHandlerChain());
Message requestMsg = createRequestMessage(obj);
@@ -262,6 +300,9 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the WebServiceFeature configuration requested by the user.
+ binding.configure(requestMsgCtx, this);
+
// Setup the Executor that will be used to drive async responses back to
// the client.
// FIXME: We shouldn't be getting this from the ServiceDelegate, rather each
@@ -310,6 +351,21 @@
MessageContext requestMsgCtx = new MessageContext();
requestMsgCtx.setEndpointDescription(getEndpointDescription());
invocationContext.setRequestMessageContext(requestMsgCtx);
+
+ /*
+ * TODO: review: make sure the handlers are set on the InvocationContext
+ * This implementation of the JAXWS runtime does not use Endpoint, which
+ * would normally be the place to initialize and store the handler list.
+ * In lieu of that, we will have to intialize and store them on the
+ * InvocationContext. also see the InvocationContextFactory. On the client
+ * side, the binding is not yet set when we call into that factory, so the
+ * handler list doesn't get set on the InvocationContext object there. Thus
+ * we gotta do it here.
+ */
+
+ // be sure to use whatever handlerresolver is registered on the Service
+ Binding binding = (Binding) getBinding();
+ invocationContext.setHandlers(binding.getHandlerChain());
Message requestMsg = createRequestMessage(obj);
@@ -322,6 +378,9 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the WebServiceFeature configuration requested by the user.
+ binding.configure(requestMsgCtx, this);
+
// Setup the Executor that will be used to drive async responses back to
// the client.
// FIXME: We shouldn't be getting this from the ServiceDelegate, rather each
@@ -408,20 +467,11 @@
private void setupMessageProperties(Message msg) {
// If the user has enabled MTOM on the SOAPBinding, we need
// to make sure that gets pushed to the Message object.
- Binding binding = getBinding();
+ Binding binding = (Binding) getBinding();
if (binding != null && binding instanceof SOAPBinding) {
SOAPBinding soapBinding = (SOAPBinding)binding;
if (soapBinding.isMTOMEnabled())
msg.setMTOMEnabled(true);
- }
-
- // Check if the user enabled MTOM using the SOAP binding
- // properties for MTOM
- String bindingID = endpointDesc.getClientBindingID();
- if ((bindingID.equalsIgnoreCase(SOAPBinding.SOAP11HTTP_MTOM_BINDING) ||
- bindingID.equalsIgnoreCase(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) &&
- !msg.isMTOMEnabled()) {
- msg.setMTOMEnabled(true);
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java Sun Jan 27 09:48:25 2008
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.client.dispatch;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -28,9 +29,6 @@
import org.apache.axis2.jaxws.message.factory.BlockFactory;
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
-import org.apache.axis2.jaxws.message.factory.SOAPEnvelopeBlockFactory;
-import org.apache.axis2.jaxws.message.factory.SourceBlockFactory;
-import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.spi.ServiceDelegate;
import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
@@ -40,16 +38,26 @@
import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import javax.xml.transform.Source;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
public class JAXBDispatch<T> extends BaseDispatch<T> {
private static final Log log = LogFactory.getLog(JAXBDispatch.class);
private JAXBContext jaxbContext;
- public JAXBDispatch(ServiceDelegate svcDelegate, EndpointDescription epDesc) {
- super(svcDelegate, epDesc);
+ public JAXBDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription epDesc,
+ WebServiceFeature... features) {
+ this(svcDelegate, epDesc, null, null, features);
+ }
+
+ public JAXBDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelegate, epDesc, epr, addressingNamespace, features);
}
public JAXBContext getJAXBContext() {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java Sun Jan 27 09:48:25 2008
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.client.dispatch;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -41,14 +42,25 @@
import javax.xml.transform.Source;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
public class XMLDispatch<T> extends BaseDispatch<T> {
private static final Log log = LogFactory.getLog(XMLDispatch.class);
private Class type;
private Class blockFactoryType;
- public XMLDispatch(ServiceDelegate svcDelegate, EndpointDescription enpdointDesc) {
- super(svcDelegate, enpdointDesc);
+ public XMLDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription endpointDesc,
+ WebServiceFeature... features) {
+ this(svcDelegate, endpointDesc, null, null, features);
+ }
+
+ public XMLDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription endpointDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelegate, endpointDesc, epr, addressingNamespace, features);
}
public Class getType() {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Sun Jan 27 09:48:25 2008
@@ -18,7 +18,7 @@
*/
package org.apache.axis2.jaxws.client.proxy;
-import javax.xml.ws.handler.HandlerResolver;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.BindingProvider;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
@@ -33,6 +33,7 @@
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.spi.Binding;
import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.spi.ServiceDelegate;
import org.apache.axis2.jaxws.spi.migrator.ApplicationContextMigratorUtil;
@@ -40,9 +41,10 @@
import org.apache.commons.logging.LogFactory;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.soap.SOAPBinding;
+
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -84,9 +86,21 @@
private Method method = null;
- public JAXWSProxyHandler(ServiceDelegate delegate, Class seiClazz, EndpointDescription epDesc) {
- super(delegate, epDesc);
+ public JAXWSProxyHandler(ServiceDelegate delegate,
+ Class seiClazz,
+ EndpointDescription epDesc,
+ WebServiceFeature... features) {
+ this(delegate, seiClazz, epDesc, null, null, features);
+ }
+ public JAXWSProxyHandler(ServiceDelegate delegate,
+ Class seiClazz,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(delegate, epDesc, epr, addressingNamespace, features);
+
this.seiClazz = seiClazz;
this.serviceDesc = delegate.getServiceDescription();
}
@@ -161,7 +175,7 @@
request.setOperationDescription(operationDesc);
// Enable MTOM on the Message if the property was set on the SOAPBinding.
- Binding bnd = getBinding();
+ Binding bnd = (Binding) getBinding();
if (bnd != null && bnd instanceof SOAPBinding) {
if (((SOAPBinding)bnd).isMTOMEnabled()) {
Message requestMsg = request.getMessage();
@@ -185,10 +199,6 @@
requestIC.setRequestMessageContext(request);
requestIC.setServiceClient(serviceDelegate.getServiceClient(endpointDesc.getPortQName()));
-
- // TODO: Change this to some form of factory so that we can change the IC to
- // a more simple one for marshaller/unmarshaller testing.
- InvocationController controller = new AxisInvocationController();
// Migrate the properties from the client request context bag to
// the request MessageContext.
@@ -196,6 +206,13 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), request);
+ // Perform the WebServiceFeature configuration requested by the user.
+ bnd.configure(request, this);
+
+ // TODO: Change this to some form of factory so that we can change the IC to
+ // a more simple one for marshaller/unmarshaller testing.
+ InvocationController controller = new AxisInvocationController();
+
// Check if the call is OneWay, Async or Sync
if (operationDesc.isOneWay()) {
if (log.isDebugEnabled()) {
@@ -287,7 +304,7 @@
return null;
}
-
+
private AsyncResponse createProxyListener(Object[] args, OperationDescription operationDesc) {
ProxyAsyncListener listener = new ProxyAsyncListener(operationDesc);
listener.setHandler(this);
@@ -327,9 +344,6 @@
MessageContext request = new MessageContext();
request.setMessage(message);
-
- // TODO: What happens here might be affected by the property migration plugpoint.
- request.setProperties(getRequestContext());
if (log.isDebugEnabled()) {
log.debug("Request MessageContext created successfully.");
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java Sun Jan 27 09:48:25 2008
@@ -18,12 +18,21 @@
*/
package org.apache.axis2.jaxws.context;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.w3c.dom.Element;
+
+import java.net.URI;
import java.security.Principal;
public class WebServiceContextImpl implements WebServiceContext {
@@ -91,4 +100,37 @@
this.soapMessageContext = soapMessageContext;
}
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
+ EndpointReference jaxwsEPR = null;
+ String addressingNamespace = EndpointReferenceUtils.getAddressingNamespace(clazz);
+
+ if (soapMessageContext != null) {
+ QName service = (QName) soapMessageContext.get(MessageContext.WSDL_SERVICE);
+ QName endpoint = (QName) soapMessageContext.get(MessageContext.WSDL_PORT);
+ URI wsdlURI = (URI) soapMessageContext.get(MessageContext.WSDL_DESCRIPTION);
+ String wsdlLocation = (wsdlURI != null) ? wsdlURI.toString() : null;
+
+ org.apache.axis2.addressing.EndpointReference axis2EPR =
+ EndpointReferenceUtils.createAxis2EndpointReference(null, service, endpoint, wsdlLocation, addressingNamespace);
+
+ try {
+ EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters);
+ jaxwsEPR = EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
+ }
+ catch (Exception e) {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("Error creating endpoint reference", e);
+ }
+ }
+ else {
+ //TODO NLS enable.
+ throw new IllegalStateException("Message context not available.");
+ }
+
+ return clazz.cast(jaxwsEPR);
+ }
+
+ public EndpointReference getEndpointReference(Element... referenceParameters) {
+ return getEndpointReference(W3CEndpointReference.class, referenceParameters);
+ }
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java Sun Jan 27 09:48:25 2008
@@ -18,7 +18,9 @@
*/
package org.apache.axis2.jaxws.context.utils;
+import org.apache.axiom.soap.SOAPHeader;
import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.jaxws.addressing.util.ReferenceParameterList;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
@@ -29,6 +31,7 @@
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -39,7 +42,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.util.Map;
+import java.util.List;
public class ContextUtils {
@@ -73,7 +76,7 @@
}
catch (URISyntaxException ex) {
log.warn(Messages.getMessage("addPropertiesErr",
- wsdlLocation.toString(),sd.getServiceQName().toString()), ex);
+ wsdlLocation.toString(),description.getServiceQName().toString()), ex);
}
soapMessageContext
.put(javax.xml.ws.handler.MessageContext.WSDL_DESCRIPTION, wsdlLocationURI);
@@ -82,15 +85,30 @@
}
soapMessageContext
- .put(javax.xml.ws.handler.MessageContext.WSDL_SERVICE, sd.getServiceQName());
+ .put(javax.xml.ws.handler.MessageContext.WSDL_SERVICE, description.getServiceQName());
soapMessageContext
.setScope(javax.xml.ws.handler.MessageContext.WSDL_SERVICE, Scope.APPLICATION);
if (log.isDebugEnabled()) {
- log.debug("WSDL_SERVICE :" + sd.getServiceQName());
+ log.debug("WSDL_SERVICE :" + description.getServiceQName());
}
}
}
+ //Lazily provide a list of available reference parameters.
+ org.apache.axis2.context.MessageContext msgContext =
+ jaxwsMessageContext.getAxisMessageContext();
+ SOAPHeader header = msgContext.getEnvelope().getHeader();
+ List<Element> list = new ReferenceParameterList(header);
+
+ soapMessageContext
+ .put(javax.xml.ws.handler.MessageContext.REFERENCE_PARAMETERS, list);
+ soapMessageContext
+ .setScope(javax.xml.ws.handler.MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Added reference parameter list.");
+ }
+
// If we are running within a servlet container, then JAX-WS requires that the
// servlet related properties be set on the MessageContext
soapMessageContext.put(javax.xml.ws.handler.MessageContext.SERVLET_CONTEXT,
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Sun Jan 27 09:48:25 2008
@@ -19,6 +19,10 @@
package org.apache.axis2.jaxws.registry;
+import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
+import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactoryImpl;
+import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactory;
+import org.apache.axis2.jaxws.addressing.factory.JAXWSEndpointReferenceFactoryImpl;
import org.apache.axis2.jaxws.core.controller.InvocationControllerFactory;
import org.apache.axis2.jaxws.core.controller.impl.InvocationControllerFactoryImpl;
import org.apache.axis2.jaxws.handler.lifecycle.factory.HandlerLifecycleManagerFactory;
@@ -94,6 +98,8 @@
table.put(EndpointLifecycleManagerFactory.class, new EndpointLifecycleManagerFactoryImpl());
table.put(HandlerLifecycleManagerFactory.class, new HandlerLifecycleManagerFactory());
table.put(ClassFinderFactory.class, new ClassFinderFactory());
+ table.put(JAXWSEndpointReferenceFactory.class, new JAXWSEndpointReferenceFactoryImpl());
+ table.put(Axis2EndpointReferenceFactory.class, new Axis2EndpointReferenceFactoryImpl());
table.put(ExecutorFactory.class, new JAXWSExecutorFactory());
table.put(ServiceInstanceFactory.class, new ServiceInstanceFactoryImpl());
table.put(InvocationControllerFactory.class, new InvocationControllerFactoryImpl());
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Sun Jan 27 09:48:25 2008
@@ -25,6 +25,8 @@
import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactory;
+import org.apache.axis2.jaxws.addressing.factory.Axis2EndpointReferenceFactoryImpl;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.core.util.MessageContextUtils;
import org.apache.axis2.jaxws.description.DescriptionFactory;
@@ -49,6 +51,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;
import java.io.StringReader;
import java.security.PrivilegedActionException;
@@ -399,6 +402,21 @@
ServiceDescription sd =
DescriptionFactory.createServiceDescriptionFromServiceImpl(implClass, axisSvc);
EndpointDescription ed = sd.getEndpointDescriptions_AsCollection().iterator().next();
+
+ // TODO: This is only temporary until the deprecated method is no longer used
+ QName service = ed.getServiceQName();
+ QName endpoint = ed.getPortQName();
+ axisSvc = ed.getAxisService();
+
+ try {
+ Axis2EndpointReferenceFactoryImpl axis2EPRFactory =
+ (Axis2EndpointReferenceFactoryImpl) FactoryRegistry.getFactory(Axis2EndpointReferenceFactory.class);
+ axis2EPRFactory.addAddress(service, endpoint, axisSvc.getEPRs()[0]);
+ }
+ catch (Exception e) {
+ throw ExceptionFactory.makeWebServiceException(e);
+ }
+
return ed;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java Sun Jan 27 09:48:25 2008
@@ -22,20 +22,26 @@
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.binding.BindingImpl;
+import org.apache.axis2.jaxws.addressing.util.EndpointReferenceUtils;
import org.apache.axis2.jaxws.binding.BindingUtils;
import org.apache.axis2.jaxws.description.DescriptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.transport.http.HTTPWorkerFactory;
import org.apache.axis2.transport.http.server.SimpleHttpServer;
import org.apache.axis2.transport.http.server.WorkerFactory;
+import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.ws.Binding;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
import java.io.IOException;
+import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
@@ -203,5 +209,37 @@
} catch (InterruptedException e) {
e.printStackTrace();
}
+ }
+
+ @Override
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
+ EndpointReference jaxwsEPR = null;
+ String addressingNamespace = EndpointReferenceUtils.getAddressingNamespace(clazz);
+ String address = endpointDesc.getEndpointAddress();
+ QName serviceName = endpointDesc.getServiceQName();
+ QName portName = endpointDesc.getPortQName();
+ URL wsdlURL = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation();
+
+ if (!BindingUtils.isSOAPBinding(binding.getBindingID()))
+ throw new UnsupportedOperationException("This method is unsupported for the binding: " + binding.getBindingID());
+
+ org.apache.axis2.addressing.EndpointReference axis2EPR =
+ EndpointReferenceUtils.createAxis2EndpointReference(address, serviceName, portName, wsdlURL.toString(), addressingNamespace);
+
+ try {
+ EndpointReferenceUtils.addReferenceParameters(axis2EPR, referenceParameters);
+ jaxwsEPR = EndpointReferenceUtils.convertFromAxis2(axis2EPR, addressingNamespace);
+ }
+ catch (Exception e) {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("Error creating endpoint reference", e);
+ }
+
+ return clazz.cast(jaxwsEPR);
+ }
+
+ @Override
+ public EndpointReference getEndpointReference(Element... referenceParameters) {
+ return getEndpointReference(W3CEndpointReference.class, referenceParameters);
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java Sun Jan 27 09:48:25 2008
@@ -18,6 +18,8 @@
*/
package org.apache.axis2.jaxws.spi;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.description.EndpointDescription;
/**
@@ -27,5 +29,8 @@
public EndpointDescription getEndpointDescription();
public ServiceDelegate getServiceDelegate();
-
+
+ public EndpointReference getAxis2EndpointReference(String addressingNamespace) throws AxisFault;
+
+ public String getAddressingNamespace();
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java?rev=615621&r1=615620&r2=615621&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java Sun Jan 27 09:48:25 2008
@@ -55,7 +55,7 @@
// JAXBUtils class will use the same ClassLoader to retrieve a JAXBContext as the
// one that was used to create the request
public static final String CACHE_CLASSLOADER = "CACHE_CLASSLOADER";
-
+
/** Intentionally Private */
private Constants() {
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org