JBossWS SVN: r9015 - in stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core: jaxws/binding and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-13 05:19:01 -0500 (Tue, 13 Jan 2009)
New Revision: 9015
Added:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
Log:
[JBWS-2452] Implementing getEndpointReference methods in BindingProvidedImpl, ClientImpl and DispatchImpl
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-01-12 17:29:12 UTC (rev 9014)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-01-13 10:19:01 UTC (rev 9015)
@@ -23,12 +23,16 @@
import java.util.Observable;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.SOAP11BindingJAXRPC;
import org.jboss.ws.core.jaxrpc.SOAP12BindingJAXRPC;
+import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
import org.jboss.ws.core.jaxws.binding.HTTPBindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS;
import org.jboss.ws.core.jaxws.binding.SOAP12BindingJAXWS;
@@ -103,6 +107,29 @@
return binding;
}
+ public EndpointReference getEndpointReference()
+ {
+ if (binding instanceof HTTPBinding )
+ {
+ throw new UnsupportedOperationException("Cannot get EPR for BindingProvider instances using the XML/HTTP binding");
+ }
+ return getEndpointReference(W3CEndpointReference.class);
+ }
+
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz)
+ {
+ if (binding instanceof HTTPBinding )
+ {
+ throw new UnsupportedOperationException("Cannot get epr for BindingProvider instances using the XML/HTTP binding");
+ }
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ builder.address(epMetaData.getEndpointAddress());
+ builder.serviceName(epMetaData.getServiceMetaData().getServiceName());
+ builder.endpointName(epMetaData.getPortName());
+ builder.wsdlDocumentLocation(epMetaData.getEndpointAddress() + "?wsdl");
+ return EndpointReferenceUtil.transform(clazz, builder.build());
+ }
+
public void update(Observable observable, Object object)
{
if(log.isDebugEnabled()) log.debug("Update config: " + object);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2009-01-12 17:29:12 UTC (rev 9014)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2009-01-13 10:19:01 UTC (rev 9015)
@@ -25,13 +25,11 @@
import java.util.Map;
import javax.xml.ws.Binding;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.http.HTTPBinding;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
@@ -94,14 +92,4 @@
{
return (Binding)binding;
}
-
- public EndpointReference getEndpointReference()
- {
- throw new NotImplementedException();
- }
-
- public <T extends EndpointReference> T getEndpointReference(Class<T> clazz)
- {
- throw new NotImplementedException();
- }
}
Added: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java (rev 0)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java 2009-01-13 10:19:01 UTC (rev 9015)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws.binding;
+
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Transforms an EPR to an instance of a given EndpointReference class
+ *
+ * @since 12-Jan-2009
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class EndpointReferenceUtil {
+
+ public static <T extends EndpointReference> T transform(Class<T> clazz, EndpointReference epr) {
+ assert epr != null;
+ if (clazz.isAssignableFrom(W3CEndpointReference.class)) {
+ if (epr instanceof W3CEndpointReference) {
+ return (T) epr;
+ }
+ else
+ {
+ throw new WebServiceException("Unsupported EndpointReference: " + epr);
+ }
+ }
+ //transformations from different types of EndpointReference could be supported in future...
+
+ throw new WebServiceException("EndpointReference of type " + clazz + " not supported.");
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/EndpointReferenceUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 17:29:12 UTC (rev 9014)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-13 10:19:01 UTC (rev 9015)
@@ -453,12 +453,12 @@
public EndpointReference getEndpointReference()
{
- throw new NotImplementedException();
+ return bindingProvider.getEndpointReference();
}
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz)
{
- throw new NotImplementedException();
+ return bindingProvider.getEndpointReference(clazz);
}
public EndpointConfigMetaData getEndpointConfigMetaData()
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 17:29:12 UTC (rev 9014)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-13 10:19:01 UTC (rev 9015)
@@ -534,12 +534,12 @@
public EndpointReference getEndpointReference()
{
- throw new NotImplementedException();
+ return bindingProvider.getEndpointReference();
}
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz)
{
- throw new NotImplementedException();
+ return bindingProvider.getEndpointReference(clazz);
}
public String getConfigFile()
15 years, 11 months
JBossWS SVN: r9014 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-12 12:29:12 -0500 (Mon, 12 Jan 2009)
New Revision: 9014
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
Log:
[JBWS-1999] Remove System.out.println
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 17:15:52 UTC (rev 9013)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 17:29:12 UTC (rev 9014)
@@ -172,7 +172,6 @@
{
SOAPFault fault = sfe.getFault();
String faultCode = fault.getFaultCode();
- System.out.println(faultCode);
assertEquals("Fault Code", FAULT_CODE, faultCode);
String faultString = fault.getFaultString();
assertEquals("Fault Message", FAULT_STRING, faultString);
15 years, 11 months
JBossWS SVN: r9013 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/jaxws/client and 13 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-12 12:15:52 -0500 (Mon, 12 Jan 2009)
New Revision: 9013
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
Removed:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
Log:
[JBWS-1999] WS-Security, authentication and authorization for POJO endpoints.
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/pom.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -82,6 +82,12 @@
<version>${jboss.jbosssx.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <scope>provided</scope>
+ <version>${jboss.jbosssx.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<scope>provided</scope>
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -171,7 +171,7 @@
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -595,7 +595,7 @@
private boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)bindingProvider.getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -61,10 +61,14 @@
protected int falseIndex = -1;
// True if the current direction is outbound
protected Boolean isOutbound;
+ // True if this is for the server/endpoint side, used to determine client side specific
+ // conformance requirements.
+ private boolean serverSide;
- public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler> unsortedChain)
+ public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler> unsortedChain, boolean serverSide)
{
this.epMetaData = epMetaData;
+ this.serverSide = serverSide;
// Sort handler logical handlers first
List<Handler> sortedChain = new ArrayList<Handler>();
@@ -264,9 +268,17 @@
// the client MUST be passed on to the application. If the exception in question is a subclass of WebService-
// Exception then an implementation MUST rethrow it as-is, without any additional wrapping, otherwise it
// MUST throw a WebServiceException whose cause is set to the exception that was thrown during handler processing.
- private void processHandlerFailure(Exception ex)
+ private void processHandlerFailure(RuntimeException ex)
{
log.error("Exception during handler processing", ex);
+
+ // If this call is server side then the conformance requirement specific to
+ // clients can be avoided.
+ if (serverSide == true)
+ {
+ throw ex;
+ }
+
if (ex instanceof WebServiceException)
{
throw (WebServiceException)ex;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -161,8 +161,8 @@
{
if (type == HandlerType.ALL)
throw new IllegalArgumentException("Invalid handler type: " + type);
-
- HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData, getHandlerChain(sepMetaData, type));
+
+ HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData, getHandlerChain(sepMetaData, type), true);
if (type == HandlerType.PRE)
preExecutor.set(executor);
else if (type == HandlerType.ENDPOINT)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/SecurityDecoder.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -35,6 +35,7 @@
import org.jboss.ws.extensions.security.element.UsernameToken;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.extensions.security.nonce.NonceFactory;
+import org.jboss.ws.extensions.security.operation.AuthorizeOperation;
import org.jboss.ws.extensions.security.operation.DecryptionOperation;
import org.jboss.ws.extensions.security.operation.ReceiveUsernameOperation;
import org.jboss.ws.extensions.security.operation.ReceiveX509Certificate;
@@ -44,6 +45,7 @@
import org.jboss.ws.extensions.security.operation.SignatureVerificationOperation;
import org.jboss.ws.extensions.security.operation.TimestampVerificationOperation;
import org.jboss.ws.metadata.wsse.Authenticate;
+import org.jboss.ws.metadata.wsse.Authorize;
import org.jboss.ws.metadata.wsse.TimestampVerification;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -67,7 +69,7 @@
private TimestampVerification timestampVerification;
- private Authenticate authenticate;
+ private Authenticate authenticate;
private HashSet<String> signedIds = new HashSet<String>();
@@ -155,9 +157,8 @@
if (ids != null)
encryptedIds.addAll(ids);
}
- }
+ }
-
}
public void verify(List<RequireOperation> requireOperations) throws WSSecurityException
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -39,6 +39,7 @@
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.extensions.security.nonce.DefaultNonceFactory;
import org.jboss.ws.extensions.security.nonce.NonceFactory;
+import org.jboss.ws.extensions.security.operation.AuthorizeOperation;
import org.jboss.ws.extensions.security.operation.EncodingOperation;
import org.jboss.ws.extensions.security.operation.EncryptionOperation;
import org.jboss.ws.extensions.security.operation.RequireEncryptionOperation;
@@ -50,6 +51,8 @@
import org.jboss.ws.extensions.security.operation.TimestampOperation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.wsse.Authenticate;
+import org.jboss.ws.metadata.wsse.Authorize;
import org.jboss.ws.metadata.wsse.Config;
import org.jboss.ws.metadata.wsse.Encrypt;
import org.jboss.ws.metadata.wsse.Operation;
@@ -79,7 +82,7 @@
Config config = getActualConfig(configuration, operationConfig);
SOAPHeader soapHeader = message.getSOAPHeader();
QName secQName = new QName(Constants.WSSE_NS, "Security");
- Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader, secQName) : null;
+ Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader, secQName) : null;
if (secHeaderElement == null)
{
@@ -89,45 +92,76 @@
if (hasRequirements(config))
throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
-
- return;
}
try
{
- SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(), configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
- configuration.getKeyPasswords(), configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
- NonceFactory factory = Util.loadFactory(NonceFactory.class, configuration.getNonceFactory(), DefaultNonceFactory.class);
- SecurityDecoder decoder = new SecurityDecoder(securityStore, factory, configuration.getTimestampVerification(), config == null ? null : config.getAuthenticate());
+ if (secHeaderElement != null)
+ {
+ decodeHeader(configuration, config, message, secHeaderElement);
+ }
- decoder.decode(message.getSOAPPart(), secHeaderElement);
-
- if (log.isTraceEnabled())
- log.trace("Decoded Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
-
- List<RequireOperation> operations = buildRequireOperations(config);
-
- decoder.verify(operations);
- if(log.isDebugEnabled()) log.debug("Verification is successful");
-
- decoder.complete();
+ authorize(config);
}
catch (WSSecurityException e)
{
if (e.isInternalError())
log.error("Internal error occured handling inbound message:", e);
- else if(log.isDebugEnabled()) log.debug("Returning error to sender: " + e.getMessage());
+ else if (log.isDebugEnabled())
+ log.debug("Returning error to sender: " + e.getMessage());
throw convertToFault(e);
}
-
+
}
+ private void decodeHeader(WSSecurityConfiguration configuration, Config config, SOAPMessage message, Element secHeaderElement) throws WSSecurityException
+ {
+ SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(), configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
+ configuration.getKeyPasswords(), configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
+ NonceFactory factory = Util.loadFactory(NonceFactory.class, configuration.getNonceFactory(), DefaultNonceFactory.class);
+
+ Authenticate authenticate = null;
+
+ if (config != null)
+ {
+ authenticate = config.getAuthenticate();
+ }
+
+ SecurityDecoder decoder = new SecurityDecoder(securityStore, factory, configuration.getTimestampVerification(), authenticate);
+
+ decoder.decode(message.getSOAPPart(), secHeaderElement);
+
+ if (log.isTraceEnabled())
+ log.trace("Decoded Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
+
+ List<RequireOperation> operations = buildRequireOperations(config);
+
+ decoder.verify(operations);
+ if (log.isDebugEnabled())
+ log.debug("Verification is successful");
+
+ decoder.complete();
+ }
+
+ private void authorize(Config config) throws WSSecurityException
+ {
+ if (config != null)
+ {
+ Authorize authorize = config.getAuthorize();
+ if (authorize != null)
+ {
+ AuthorizeOperation authorizeOp = new AuthorizeOperation(authorize);
+ authorizeOp.process();
+ }
+ }
+ }
+
public void encodeMessage(WSSecurityConfiguration configuration, SOAPMessage message, Config operationConfig, String user, String password) throws SOAPException
{
Config config = getActualConfig(configuration, operationConfig);
log.debug("WS-Security config: " + config);
-
+
// Nothing to process
if (config == null)
return;
@@ -172,12 +206,13 @@
if (operations.size() == 0)
return;
- if(log.isDebugEnabled()) log.debug("Encoding Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
+ if (log.isDebugEnabled())
+ log.debug("Encoding Message:\n" + DOMWriter.printNode(message.getSOAPPart(), true));
try
{
SecurityStore securityStore = new SecurityStore(configuration.getKeyStoreURL(), configuration.getKeyStoreType(), configuration.getKeyStorePassword(),
- configuration.getKeyPasswords() , configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
+ configuration.getKeyPasswords(), configuration.getTrustStoreURL(), configuration.getTrustStoreType(), configuration.getTrustStorePassword());
SecurityEncoder encoder = new SecurityEncoder(operations, securityStore);
encoder.encode(message.getSOAPPart());
}
@@ -185,7 +220,8 @@
{
if (e.isInternalError())
log.error("Internal error occured handling outbound message:", e);
- else if(log.isDebugEnabled()) log.debug("Returning error to sender: " + e.getMessage());
+ else if (log.isDebugEnabled())
+ log.debug("Returning error to sender: " + e.getMessage());
throw convertToFault(e);
}
@@ -199,7 +235,7 @@
securityAdaptor.setPrincipal(null);
securityAdaptor.setCredential(null);
}
-
+
private List<Target> convertTargets(List<org.jboss.ws.metadata.wsse.Target> targets)
{
if (targets == null)
@@ -232,7 +268,7 @@
{
if (operationConfig == null)
return null;
-
+
Requires requires = operationConfig.getRequires();
if (requires == null)
return null;
@@ -270,7 +306,7 @@
{
EndpointMetaData epMetaData = ctx.getEndpointMetaData();
QName port = epMetaData.getPortName();
-
+
OperationMetaData opMetaData = ctx.getOperationMetaData();
if (opMetaData == null)
{
@@ -293,7 +329,7 @@
//null operationConfig means default behavior
return operationConfig != null ? operationConfig : configuration.getDefaultConfig();
}
-
+
private Config selectOperationConfig(WSSecurityConfiguration configuration, QName portName, QName opName)
{
Port port = configuration.getPorts().get(portName != null ? portName.getLocalPart() : null);
@@ -311,8 +347,7 @@
}
return operation.getConfig();
}
-
-
+
private boolean hasRequirements(Config config)
{
return config != null && config.getRequires() != null;
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java)
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/AuthorizeOperation.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,186 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.extensions.security.operation;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.security.auth.Subject;
+
+import org.jboss.logging.Logger;
+import org.jboss.security.AuthenticationManager;
+import org.jboss.security.RealmMapping;
+import org.jboss.security.SecurityContext;
+import org.jboss.security.SecurityContextAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.ws.extensions.security.exception.WSSecurityException;
+import org.jboss.ws.metadata.wsse.Authorize;
+import org.jboss.ws.metadata.wsse.Role;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+
+/**
+ * Operation to authenticate and check the authorisation of the
+ * current user.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @since December 23rd 2008
+ */
+public class AuthorizeOperation
+{
+
+ private static final Logger log = Logger.getLogger(AuthorizeOperation.class);
+
+ private Authorize authorize;
+
+ private AuthenticationManager am;
+
+ private RealmMapping rm;
+
+ private SecurityAdaptorFactory secAdapterfactory;
+
+ public AuthorizeOperation(Authorize authorize)
+ {
+ this.authorize = authorize;
+
+ try
+ {
+ Context ctx = new InitialContext();
+ Object obj = ctx.lookup("java:comp/env/security/securityMgr");
+ am = (AuthenticationManager)obj;
+ rm = (RealmMapping)am;
+ }
+ catch (NamingException ne)
+ {
+ throw new WSException("Unable to lookup AuthenticationManager", ne);
+ }
+
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdapterfactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+
+ public void process() throws WSSecurityException
+ {
+ boolean TRACE = log.isTraceEnabled();
+
+ if (TRACE)
+ log.trace("About to check authorization, using security domain '" + am.getSecurityDomain() + "'");
+
+ // Step 1 - Authenticate using currently associated principals.
+ SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
+ Principal principal = securityAdaptor.getPrincipal();
+ Object credential = securityAdaptor.getCredential();
+
+ Subject subject = new Subject();
+
+ if (am.isValid(principal, credential, subject) == false)
+ {
+ String msg = "Authentication failed, principal=" + principal;
+ log.error(msg);
+ SecurityException e = new SecurityException(msg);
+ throw new FailedAuthenticationException(e);
+ }
+ pushSubjectContext(principal, credential, subject);
+ if (TRACE)
+ log.trace("Authenticated, principal=" + principal);
+
+ // Step 2 - If unchecked all ok so return.
+ if (authorize.isUnchecked())
+ {
+ if (TRACE)
+ log.trace("authorize.isUnchecked()==true skipping roles check.");
+
+ return;
+ }
+
+ // Step 3 - If roles specified check user in role.
+ Set<Principal> expectedRoles = expectedRoles();
+ if (TRACE)
+ log.trace("expectedRoles=" + expectedRoles);
+
+ if (rm.doesUserHaveRole(principal, expectedRoles) == false)
+ {
+ Set<Principal> userRoles = rm.getUserRoles(principal);
+ String msg = "Insufficient method permissions, principal=" + principal + ", requiredRoles=" + expectedRoles + ", principalRoles=" + userRoles;
+ log.error(msg);
+ SecurityException e = new SecurityException(msg);
+ throw new FailedAuthenticationException(e);
+ }
+
+ if (TRACE)
+ log.trace("Roles check complete, principal=" + principal + ", requiredRoles=" + expectedRoles);
+ }
+
+ private Set<Principal> expectedRoles()
+ {
+ List<Role> roles = authorize.getRoles();
+ int rolesCount = (roles != null) ? roles.size() : 0;
+ Set<Principal> expectedRoles = new HashSet<Principal>(rolesCount);
+
+ if (roles != null)
+ {
+ for (Role current : roles)
+ {
+ expectedRoles.add(new SimplePrincipal(current.getName()));
+ }
+ }
+
+ return expectedRoles;
+ }
+
+ private static SecurityContext getSecurityContext()
+ {
+ return (SecurityContext)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run()
+ {
+ return SecurityContextAssociation.getSecurityContext();
+ }
+ });
+ }
+
+ private static void pushSubjectContext(final Principal p, final Object cred, final Subject s)
+ {
+ AccessController.doPrivileged(new PrivilegedAction() {
+
+ public Object run()
+ {
+ SecurityContext sc = getSecurityContext();
+ if (sc == null)
+ throw new IllegalStateException("Security Context is null");
+ sc.getUtil().createSubjectInfo(p, cred, s);
+ return null;
+ }
+ });
+ }
+
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/operation/ReceiveUsernameOperation.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -65,8 +65,6 @@
{
UsernameToken user = (UsernameToken)token;
SecurityAdaptor securityAdaptor = secAdapterfactory.newSecurityAdapter();
- Logger.getLogger(this.getClass()).info("Username: " + user.getUsername());
- Logger.getLogger(this.getClass()).info("Password: " + user.getPassword());
if (user.isDigest())
{
verifyUsernameToken(user);
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java)
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Authorize.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * <code>Authorize</code> specifies that the users credentials should be
+ * checked to ensure the user is authorized to call the endpoint.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Authorize implements Serializable
+{
+
+ private Unchecked unchecked;
+
+ private List<Role> roles = new ArrayList<Role>();
+
+ public List<Role> getRoles()
+ {
+ return Collections.unmodifiableList(roles);
+ }
+
+ public void addRole(final Role role)
+ {
+ if (isUnchecked())
+ {
+ throw new IllegalStateException("Can not add role after setting 'Unchecked'");
+ }
+ roles.add(role);
+ }
+
+ public boolean isUnchecked()
+ {
+ return unchecked != null;
+ }
+
+ void setUnchecked(Unchecked unchecked)
+ {
+ if (roles.isEmpty() == false)
+ {
+ throw new IllegalStateException("Can not set 'Unchecked' with role(s) defined.");
+ }
+ this.unchecked = unchecked;
+ }
+
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Config.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -38,6 +38,7 @@
private Encrypt encrypt;
private Requires requires;
private Authenticate authenticate;
+ private Authorize authorize;
public Encrypt getEncrypt()
{
@@ -98,4 +99,14 @@
{
this.authenticate = authenticate;
}
+
+ public Authorize getAuthorize()
+ {
+ return this.authorize;
+ }
+
+ public void setAuthorize(Authorize authorize)
+ {
+ this.authorize = authorize;
+ }
}
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java)
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Role.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Role</code> representation of a role authorized to call an endpoint.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Role implements Serializable
+{
+
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.name;
+ }
+
+}
Copied: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java)
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/Unchecked.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.Serializable;
+
+/**
+ * <code>Unchecked</code> used when all authenticated users are authorized.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class Unchecked implements Serializable
+{
+
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -307,6 +307,10 @@
{
return new Authenticate();
}
+ else if ("authorize".equals(localName))
+ {
+ return new Authorize();
+ }
return null;
}
@@ -363,7 +367,7 @@
{
log.trace("addChild: [obj=" + config + ",child=" + authenticate + "]");
config.setAuthenticate(authenticate);
- }
+ }
/**
* Called when parsing character is complete.
@@ -372,7 +376,7 @@
{
log.trace("addChild: [obj=" + authenticate + ",child=" + usernameAuth + "]");
authenticate.setUsernameAuth(usernameAuth);
- }
+ }
/**
* Called when parsing character is complete.
@@ -382,7 +386,34 @@
log.trace("addChild: [obj=" + authenticate + ",child=" + signatureCertAuth + "]");
authenticate.setSignatureCertAuth(signatureCertAuth);
}
-
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Authorize authorize, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + authorize + "]");
+ config.setAuthorize(authorize);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Authorize authorize, Unchecked unchecked, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + authorize + ",child=" + unchecked + "]");
+ authorize.setUnchecked(unchecked);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Authorize authorize, Role role, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + authorize + ",child=" + role + "]");
+ authorize.addRole(role);
+ }
+
private Object handleTargets(Object object, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
{
log.trace("newChild: " + localName);
@@ -452,7 +483,25 @@
return null;
}
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Authorize authorize, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("unchecked".equals(localName))
+ {
+ return new Unchecked();
+ }
+ else if ("role".equals(localName))
+ {
+ return new Role();
+ }
+ return null;
+ }
+
/**
* Called when parsing of a new element started.
*/
@@ -475,7 +524,14 @@
target.setValue(value);
}
+
+ public void setValue(Role role, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + role + ",value=" + value + "]");
+ role.setName(value);
+ }
+
/**
* Called when parsing character is complete.
*/
Modified: stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd
===================================================================
--- stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/core/src/main/resources/schema/jboss-ws-security_1_0.xsd 2009-01-12 17:15:52 UTC (rev 9013)
@@ -136,6 +136,16 @@
<xs:documentation>Specifies the token to be used for JAAS authentication. If this is not specified, the username token will be used if available.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="authorize" type="authorizeType" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ Specifies that authentication is required and either provides a list of roles authorized to access the endpoint or unchecked if any
+ authenticated user can access the endpoint.
+
+ This should only be used for POJO endpoints, EJB3 endpoints should configure security as for any other EJB3 session bean.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="requireTimestampType">
@@ -351,4 +361,19 @@
</xs:annotation>
</xs:attribute>
</xs:complexType>
+ <xs:complexType name="authorizeType">
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="role" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Specifies a role that is allowed to call the endpoint.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="unchecked" type="uncheckedType" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Specifies that any authenticated user can call the endpoint.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="uncheckedType"/>
</xs:schema>
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -255,6 +255,17 @@
<include name="jboss.xml"/>
</metainf>
</jar>
+
+ <!-- jaxws-jbws1999 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws1999.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1999/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws1999/*TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF">
+ <include name="*"/>
+ </webinf>
+ </war>
<!-- jaxws-jbws2011-->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2011.jar">
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -28,7 +28,7 @@
* Simple TestEndpoint to test the handling to WSSE timestamps.
*
* @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
- * @since Aril 14 2008
+ * @since April 14 2008
*/
public interface TestEndpoint extends Remote
{
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999 (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-1999
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws1999")
-public interface Endpoint
-{
-
- public String echoUnchecked(final String message);
-
- public String echoFriendRequired(final String message);
-
- public String echoEnemyRequired(final String message);
-
- public String echoNoSecurity(final String message);
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws1999")
+public interface Endpoint
+{
+
+ public String echoUnchecked(final String message);
+
+ public String echoFriendRequired(final String message);
+
+ public String echoEnemyRequired(final String message);
+
+ public String echoNoSecurity(final String message);
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import javax.jws.WebService;
-
-import org.jboss.ws.annotation.EndpointConfig;
-
-/**
- * Test Endpoint to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-1999
- */
-@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://ws.jboss.org/jbws1999", endpointInterface = "org.jboss.test.ws.jaxws.jbws1999.Endpoint")
-@EndpointConfig(configName = "Standard WSSecurity Endpoint")
-public class EndpointImpl implements Endpoint
-{
-
- public String echoEnemyRequired(final String message)
- {
- return message;
- }
-
- public String echoFriendRequired(final String message)
- {
- return message;
- }
-
- public String echoNoSecurity(final String message)
- {
- return message;
- }
-
- public String echoUnchecked(final String message)
- {
- return message;
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://ws.jboss.org/jbws1999", endpointInterface = "org.jboss.test.ws.jaxws.jbws1999.Endpoint")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ public String echoEnemyRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoFriendRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoNoSecurity(final String message)
+ {
+ return message;
+ }
+
+ public String echoUnchecked(final String message)
+ {
+ return message;
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,211 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.wsse.Authorize;
-import org.jboss.ws.metadata.wsse.Config;
-import org.jboss.ws.metadata.wsse.Port;
-import org.jboss.ws.metadata.wsse.Role;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * Test case to test reading the 'authorize' configuration.
- *
- * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
- * @since December 18th 2008
- */
-public class JBWS1999ConfigurationTestCase extends JBossWSTest
-{
-
- private WSSecurityConfiguration load(final String fileName) throws IOException
- {
- File configFile = getResourceFile("jaxws/jbws1999/config/" + fileName);
- WSSecurityOMFactory factory = WSSecurityOMFactory.newInstance();
-
- return factory.parse(configFile.toURL());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * which contains two roles.
- */
- public void testDefaultRoles() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-roles.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 2 roles", 2, roles.size());
-
- List<String> roleNames = new ArrayList<String>(roles.size());
- for (Role current : roles)
- {
- roleNames.add(current.getName());
- }
- assertTrue("Expected 'Trader' role.", roleNames.contains("Trader"));
- assertTrue("Expected 'Banker' role.", roleNames.contains("Banker"));
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * which contains two roles.
- */
- public void testPortRoles() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-roles.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 2 roles", 2, roles.size());
-
- List<String> roleNames = new ArrayList<String>(roles.size());
- for (Role current : roles)
- {
- roleNames.add(current.getName());
- }
- assertTrue("Expected 'Trader' role.", roleNames.contains("Trader"));
- assertTrue("Expected 'Banker' role.", roleNames.contains("Banker"));
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * which contains one role.
- */
- public void testDefaultRole() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 1 roles", 1, roles.size());
-
- Role role = roles.get(0);
- assertEquals("Expected 'Trader' role.", "Trader", role.getName());
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * which contains one role.
- */
- public void testPortRole() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertFalse("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 1 roles", 1, roles.size());
-
- Role role = roles.get(0);
- assertEquals("Expected 'Trader' role.", "Trader", role.getName());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * with unchecked.
- */
- public void testDefaultUnchecked() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-unchecked.xml");
-
- Config config = wsConfig.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertTrue("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 0 roles", 0, roles.size());
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * with unchecked.
- */
- public void testPortUnchecked() throws Exception
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-unchecked.xml");
-
- Port port = wsConfig.getPorts().get("TestPort");
- Config config = port.getDefaultConfig();
- Authorize authorize = config.getAuthorize();
- assertTrue("Unchecked", authorize.isUnchecked());
- List<Role> roles = authorize.getRoles();
-
- assertEquals("Expected 0 roles", 0, roles.size());
- }
-
- /**
- * Test loading a configuration with a default 'authorize' definition
- * with unchecked and a role defined, parsing should fail.
- */
- public void testDefaultRoleUnchecked() throws Exception
- {
- try
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role-unchecked.xml");
- fail("Expected exception not thrown.");
- }
- catch (IOException expected)
- {
- Throwable cause = expected.getCause();
- assertEquals(IllegalStateException.class, cause.getClass());
- }
- }
-
- /**
- * Test loading a configuration with a port 'authorize' definition
- * with unchecked and a role defined, parsing should fail.
- */
- public void testPortRoleUnchecked() throws Exception
- {
- try
- {
- WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role-unchecked.xml");
- fail("Expected exception not thrown.");
- }
- catch (IOException expected)
- {
- Throwable cause = expected.getCause();
- assertEquals(IllegalStateException.class, cause.getClass());
- }
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999ConfigurationTestCase.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,211 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.ws.metadata.wsse.Authorize;
+import org.jboss.ws.metadata.wsse.Config;
+import org.jboss.ws.metadata.wsse.Port;
+import org.jboss.ws.metadata.wsse.Role;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Test case to test reading the 'authorize' configuration.
+ *
+ * @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
+ * @since December 18th 2008
+ */
+public class JBWS1999ConfigurationTestCase extends JBossWSTest
+{
+
+ private WSSecurityConfiguration load(final String fileName) throws IOException
+ {
+ File configFile = getResourceFile("jaxws/jbws1999/config/" + fileName);
+ WSSecurityOMFactory factory = WSSecurityOMFactory.newInstance();
+
+ return factory.parse(configFile.toURL());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * which contains two roles.
+ */
+ public void testDefaultRoles() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-roles.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 2 roles", 2, roles.size());
+
+ List<String> roleNames = new ArrayList<String>(roles.size());
+ for (Role current : roles)
+ {
+ roleNames.add(current.getName());
+ }
+ assertTrue("Expected 'Trader' role.", roleNames.contains("Trader"));
+ assertTrue("Expected 'Banker' role.", roleNames.contains("Banker"));
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * which contains two roles.
+ */
+ public void testPortRoles() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-roles.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 2 roles", 2, roles.size());
+
+ List<String> roleNames = new ArrayList<String>(roles.size());
+ for (Role current : roles)
+ {
+ roleNames.add(current.getName());
+ }
+ assertTrue("Expected 'Trader' role.", roleNames.contains("Trader"));
+ assertTrue("Expected 'Banker' role.", roleNames.contains("Banker"));
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * which contains one role.
+ */
+ public void testDefaultRole() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 1 roles", 1, roles.size());
+
+ Role role = roles.get(0);
+ assertEquals("Expected 'Trader' role.", "Trader", role.getName());
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * which contains one role.
+ */
+ public void testPortRole() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertFalse("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 1 roles", 1, roles.size());
+
+ Role role = roles.get(0);
+ assertEquals("Expected 'Trader' role.", "Trader", role.getName());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * with unchecked.
+ */
+ public void testDefaultUnchecked() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-unchecked.xml");
+
+ Config config = wsConfig.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertTrue("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 0 roles", 0, roles.size());
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * with unchecked.
+ */
+ public void testPortUnchecked() throws Exception
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-unchecked.xml");
+
+ Port port = wsConfig.getPorts().get("TestPort");
+ Config config = port.getDefaultConfig();
+ Authorize authorize = config.getAuthorize();
+ assertTrue("Unchecked", authorize.isUnchecked());
+ List<Role> roles = authorize.getRoles();
+
+ assertEquals("Expected 0 roles", 0, roles.size());
+ }
+
+ /**
+ * Test loading a configuration with a default 'authorize' definition
+ * with unchecked and a role defined, parsing should fail.
+ */
+ public void testDefaultRoleUnchecked() throws Exception
+ {
+ try
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-default-role-unchecked.xml");
+ fail("Expected exception not thrown.");
+ }
+ catch (IOException expected)
+ {
+ Throwable cause = expected.getCause();
+ assertEquals(IllegalStateException.class, cause.getClass());
+ }
+ }
+
+ /**
+ * Test loading a configuration with a port 'authorize' definition
+ * with unchecked and a role defined, parsing should fail.
+ */
+ public void testPortRoleUnchecked() throws Exception
+ {
+ try
+ {
+ WSSecurityConfiguration wsConfig = load("jboss-wsse-port-role-unchecked.xml");
+ fail("Expected exception not thrown.");
+ }
+ catch (IOException expected)
+ {
+ Throwable cause = expected.getCause();
+ assertEquals(IllegalStateException.class, cause.getClass());
+ }
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,196 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file in the
-* distribution for a full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.ws.jaxws.jbws1999;
-
-import java.net.URL;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPFault;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import junit.framework.Test;
-
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * Test case to test UsernameToken authorization / authentication
- * for POJO endpoints.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 12th January 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-1999
- */
-public class JBWS1999TestCase extends JBossWSTest
-{
-
- private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1999";
-
- private static final String FAULT_CODE = "wsse:FailedAuthentication";
-
- private static final String FAULT_STRING = FailedAuthenticationException.faultString;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS1999TestCase.class, "jaxws-jbws1999.war");
- }
-
- public void testNoSecurity() throws Exception
- {
- Endpoint endpoint = getPort(false);
-
- String message = "NoSecurity Message";
-
- String response = endpoint.echoNoSecurity(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked_Default() throws Exception
- {
- Endpoint endpoint = getPort(false);
-
- String message = "UncheckedDefault Message";
-
- String response = endpoint.echoUnchecked(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "Unchecked Message";
-
- String response = endpoint.echoUnchecked(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testUnchecked_WrongPassword() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
-
- String message = "Unchecked_WrongPassword Message";
-
- try
- {
- endpoint.echoUnchecked(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault String", FAULT_STRING, faultString);
- }
-
- }
-
- public void testFriendRequired() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "FriendRequired Message";
-
- String response = endpoint.echoFriendRequired(message);
- assertEquals("Response Message", message, response);
- }
-
- public void testFriendRequired_WrongPassword() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
-
- String message = "FriendRequired Message";
-
- try
- {
- endpoint.echoFriendRequired(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
- }
- }
-
- public void testEnemyRequired() throws Exception
- {
- Endpoint endpoint = getPort(true);
- Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
-
- String message = "EnemyRequired Message";
-
- try
- {
- endpoint.echoEnemyRequired(message);
- fail("Expected SOAPFaultException not thrown!!");
- }
- catch (SOAPFaultException sfe)
- {
- SOAPFault fault = sfe.getFault();
- String faultCode = fault.getFaultCode();
- System.out.println(faultCode);
- assertEquals("Fault Code", FAULT_CODE, faultCode);
- String faultString = fault.getFaultString();
- assertEquals("Fault Message", FAULT_STRING, faultString);
- }
- }
-
- private Endpoint getPort(boolean enableSecurity) throws Exception
- {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://ws.jboss.org/jbws1999", "EndpointService");
- Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
- if (enableSecurity == true)
- {
- URL securityURL = getResourceURL("jaxws/jbws1999/jboss-wsse-client.xml");
- ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
- ((StubExt)port).setConfigName("Standard WSSecurity Client");
- }
-
- return port;
- }
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test case to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+public class JBWS1999TestCase extends JBossWSTest
+{
+
+ private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1999";
+
+ private static final String FAULT_CODE = "wsse:FailedAuthentication";
+
+ private static final String FAULT_STRING = FailedAuthenticationException.faultString;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS1999TestCase.class, "jaxws-jbws1999.war");
+ }
+
+ public void testNoSecurity() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "NoSecurity Message";
+
+ String response = endpoint.echoNoSecurity(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_Default() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "UncheckedDefault Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "Unchecked Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "Unchecked_WrongPassword Message";
+
+ try
+ {
+ endpoint.echoUnchecked(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault String", FAULT_STRING, faultString);
+ }
+
+ }
+
+ public void testFriendRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "FriendRequired Message";
+
+ String response = endpoint.echoFriendRequired(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testFriendRequired_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "FriendRequired Message";
+
+ try
+ {
+ endpoint.echoFriendRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ public void testEnemyRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "EnemyRequired Message";
+
+ try
+ {
+ endpoint.echoEnemyRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ System.out.println(faultCode);
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ private Endpoint getPort(boolean enableSecurity) throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws1999", "EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ if (enableSecurity == true)
+ {
+ URL securityURL = getResourceURL("jaxws/jbws1999/jboss-wsse-client.xml");
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ }
+
+ return port;
+ }
+}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999 (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999)
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
- <security-domain>java:/jaas/JBossWS</security-domain>
-
- <context-root>/jaxws-jbws1999</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+
+ <context-root>/jaxws-jbws1999</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,34 +0,0 @@
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config
- http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
-
- <port name="EndpointPort">
- <operation name="{http://ws.jboss.org/jbws1999}echoUnchecked">
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
- </operation>
-
- <operation name="{http://ws.jboss.org/jbws1999}echoFriendRequired">
- <config>
- <authorize>
- <role>friend</role>
- </authorize>
- </config>
- </operation>
-
- <operation name="{http://ws.jboss.org/jbws1999}echoEnemyRequired">
- <config>
- <authorize>
- <role>enemy</role>
- </authorize>
- </config>
- </operation>
- </port>
-
-
-
-</jboss-ws-security>
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,34 @@
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <port name="EndpointPort">
+ <operation name="{http://ws.jboss.org/jbws1999}echoUnchecked">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.jboss.org/jbws1999}echoFriendRequired">
+ <config>
+ <authorize>
+ <role>friend</role>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.jboss.org/jbws1999}echoEnemyRequired">
+ <config>
+ <authorize>
+ <role>enemy</role>
+ </authorize>
+ </config>
+ </operation>
+ </port>
+
+
+
+</jboss-ws-security>
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>Endpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.jbws1999.EndpointImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Endpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws1999.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,12 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- <unchecked/>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,12 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ <unchecked/>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,11 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-role.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,11 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,12 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Banker</role>
- <role>Trader</role>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-roles.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,12 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Banker</role>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,11 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-default-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,11 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,20 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Trader</role>
- <unchecked/>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,20 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ <unchecked/>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,19 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-role.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,19 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,20 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <role>Banker</role>
- <role>Trader</role>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-roles.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,20 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <role>Banker</role>
+ <role>Trader</role>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,19 +0,0 @@
-<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
- xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
-
- <config>
- <authorize>
- <role>Trader</role>
- </authorize>
- </config>
-
- <port name="TestPort">
- <config>
- <authorize>
- <unchecked/>
- </authorize>
- </config>
- </port>
-
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/config/jboss-wsse-port-unchecked.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,19 @@
+<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>
+
+ <config>
+ <authorize>
+ <role>Trader</role>
+ </authorize>
+ </config>
+
+ <port name="TestPort">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </port>
+
+</jboss-ws-security>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12 16:46:40 UTC (rev 9012)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
-
- <config>
- <username/>
-
- </config>
-</jboss-ws-security>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml (from rev 9012, stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12 17:15:52 UTC (rev 9013)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <username/>
+
+ </config>
+</jboss-ws-security>
\ No newline at end of file
15 years, 11 months
JBossWS SVN: r9012 - in stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxrpc/jbws1316 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-12 11:46:40 -0500 (Mon, 12 Jan 2009)
New Revision: 9012
Added:
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
Modified:
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
Log:
Implementation of runtime test case.
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12 16:14:25 UTC (rev 9011)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-01-12 16:46:40 UTC (rev 9012)
@@ -255,6 +255,17 @@
<include name="jboss.xml"/>
</metainf>
</jar>
+
+ <!-- jaxws-jbws1999 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws1999.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1999/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws1999/*TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws1999/WEB-INF">
+ <include name="*"/>
+ </webinf>
+ </war>
<!-- jaxws-jbws2011-->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2011.jar">
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12 16:14:25 UTC (rev 9011)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1316/TestEndpoint.java 2009-01-12 16:46:40 UTC (rev 9012)
@@ -28,7 +28,7 @@
* Simple TestEndpoint to test the handling to WSSE timestamps.
*
* @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
- * @since Aril 14 2008
+ * @since April 14 2008
*/
public interface TestEndpoint extends Remote
{
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws1999")
+public interface Endpoint
+{
+
+ public String echoUnchecked(final String message);
+
+ public String echoFriendRequired(final String message);
+
+ public String echoEnemyRequired(final String message);
+
+ public String echoNoSecurity(final String message);
+
+}
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+/**
+ * Test Endpoint to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://ws.jboss.org/jbws1999", endpointInterface = "org.jboss.test.ws.jaxws.jbws1999.Endpoint")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ public String echoEnemyRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoFriendRequired(final String message)
+ {
+ return message;
+ }
+
+ public String echoNoSecurity(final String message)
+ {
+ return message;
+ }
+
+ public String echoUnchecked(final String message)
+ {
+ return message;
+ }
+
+}
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,196 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxws.jbws1999;
+
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.extensions.security.exception.FailedAuthenticationException;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test case to test UsernameToken authorization / authentication
+ * for POJO endpoints.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 12th January 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-1999
+ */
+public class JBWS1999TestCase extends JBossWSTest
+{
+
+ private final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1999";
+
+ private static final String FAULT_CODE = "wsse:FailedAuthentication";
+
+ private static final String FAULT_STRING = FailedAuthenticationException.faultString;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS1999TestCase.class, "jaxws-jbws1999.war");
+ }
+
+ public void testNoSecurity() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "NoSecurity Message";
+
+ String response = endpoint.echoNoSecurity(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_Default() throws Exception
+ {
+ Endpoint endpoint = getPort(false);
+
+ String message = "UncheckedDefault Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "Unchecked Message";
+
+ String response = endpoint.echoUnchecked(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testUnchecked_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "Unchecked_WrongPassword Message";
+
+ try
+ {
+ endpoint.echoUnchecked(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault String", FAULT_STRING, faultString);
+ }
+
+ }
+
+ public void testFriendRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "FriendRequired Message";
+
+ String response = endpoint.echoFriendRequired(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testFriendRequired_WrongPassword() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thepig");
+
+ String message = "FriendRequired Message";
+
+ try
+ {
+ endpoint.echoFriendRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ public void testEnemyRequired() throws Exception
+ {
+ Endpoint endpoint = getPort(true);
+ Map<String, Object> requestContext = ((BindingProvider)endpoint).getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+
+ String message = "EnemyRequired Message";
+
+ try
+ {
+ endpoint.echoEnemyRequired(message);
+ fail("Expected SOAPFaultException not thrown!!");
+ }
+ catch (SOAPFaultException sfe)
+ {
+ SOAPFault fault = sfe.getFault();
+ String faultCode = fault.getFaultCode();
+ System.out.println(faultCode);
+ assertEquals("Fault Code", FAULT_CODE, faultCode);
+ String faultString = fault.getFaultString();
+ assertEquals("Fault Message", FAULT_STRING, faultString);
+ }
+ }
+
+ private Endpoint getPort(boolean enableSecurity) throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws1999", "EndpointService");
+ Endpoint port = Service.create(wsdlURL, serviceName).getPort(Endpoint.class);
+ if (enableSecurity == true)
+ {
+ URL securityURL = getResourceURL("jaxws/jbws1999/jboss-wsse-client.xml");
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ }
+
+ return port;
+ }
+}
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1999/JBWS1999TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+
+ <context-root>/jaxws-jbws1999</context-root>
+</jboss-web>
\ No newline at end of file
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,34 @@
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config
+ http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <port name="EndpointPort">
+ <operation name="{http://ws.jboss.org/jbws1999}echoUnchecked">
+ <config>
+ <authorize>
+ <unchecked/>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.jboss.org/jbws1999}echoFriendRequired">
+ <config>
+ <authorize>
+ <role>friend</role>
+ </authorize>
+ </config>
+ </operation>
+
+ <operation name="{http://ws.jboss.org/jbws1999}echoEnemyRequired">
+ <config>
+ <authorize>
+ <role>enemy</role>
+ </authorize>
+ </config>
+ </operation>
+ </port>
+
+
+
+</jboss-ws-security>
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws1999.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml (rev 0)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml 2009-01-12 16:46:40 UTC (rev 9012)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+
+ <config>
+ <username/>
+
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/branches/dlofthouse/JBWS-1999/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1999/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 11 months
JBossWS SVN: r9011 - in stack/native/branches/jaxws21/modules: jaxws-ext/src/main/java/javax/xml/ws and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-12 11:14:25 -0500 (Mon, 12 Jan 2009)
New Revision: 9011
Removed:
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/handler/
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/
Modified:
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
Log:
[JBWS-2445] Moving jaxws 2.1 partial impl from jaxws-ext to jaxws module
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-01-12 16:01:56 UTC (rev 9010)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-01-12 16:14:25 UTC (rev 9011)
@@ -27,7 +27,6 @@
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.spi.Provider;
-import javax.xml.ws.spi.Provider21;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
/**
@@ -107,7 +106,7 @@
*/
public static EndpointReference readFrom(Source eprInfoset)
{
- return ((Provider21)Provider.provider()).readEndpointReference(eprInfoset);
+ return Provider.provider().readEndpointReference(eprInfoset);
}
/**
@@ -172,7 +171,7 @@
**/
public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
{
- return ((Provider21)Provider.provider()).getPort(this, serviceEndpointInterface, features);
+ return Provider.provider().getPort(this, serviceEndpointInterface, features);
}
/**
15 years, 11 months
JBossWS SVN: r9010 - in stack/native/branches/jaxws21: modules/core/src/main/java/org/jboss/ws/core/jaxws/binding and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-12 11:01:56 -0500 (Mon, 12 Jan 2009)
New Revision: 9010
Added:
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Action.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/FaultAction.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBinding.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceFeature.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/Addressing.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/AddressingFeature.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOM.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOMFeature.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
Removed:
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Action.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Binding21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Endpoint21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/EndpointReference.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/FaultAction.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBinding.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBindingFeature.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Service21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceContext21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceFeature.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/handler/MessageContext21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/Addressing.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/AddressingFeature.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOM.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOMFeature.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/Provider21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/ServiceDelegate21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/BindingProvider21.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
Modified:
stack/native/branches/jaxws21/.classpath
stack/native/branches/jaxws21/.project
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/eventing/jaxws/EventingService.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Binding.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/BindingProvider.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Endpoint.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Service.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceContext.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/handler/MessageContext.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/Provider.java
stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/ServiceDelegate.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1172/JBWS1172TestCase.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/json/JsonTestCase.java
Log:
[JBWS-2445] Moving jaxws 2.1 partial impl from jaxws-ext to jaxws module
Modified: stack/native/branches/jaxws21/.classpath
===================================================================
--- stack/native/branches/jaxws21/.classpath 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/.classpath 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="modules/saaj/src/main/java"/>
- <classpathentry kind="src" path="modules/testsuite/native-tests/target/wsconsume/java"/>
+ <classpathentry kind="src" output="target-eclipse/classes" path="modules/saaj/src/main/java"/>
<classpathentry kind="src" path="modules/testsuite/native-tests/src/test/java"/>
- <classpathentry kind="src" path="modules/jaxrpc/src/main/java"/>
- <classpathentry kind="src" path="modules/jaxws/src/main/java"/>
- <classpathentry kind="src" path="modules/jaxws-ext/src/main/java"/>
- <classpathentry kind="src" path="modules/core/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="modules/saaj/src/main/resources" path="modules/saaj/src/main/resources"/>
+ <classpathentry kind="src" output="target-eclipse/classes" path="modules/jaxrpc/src/main/java"/>
+ <classpathentry kind="src" output="target-eclipse/classes" path="modules/jaxws/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="modules/jaxws/src/main/resources" path="modules/jaxws/src/main/resources"/>
+ <classpathentry kind="src" output="target-eclipse/classes" path="modules/jaxws-ext/src/main/java"/>
+ <classpathentry kind="src" output="target-eclipse/classes" path="modules/core/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="modules/core/src/main/resources" path="modules/core/src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="modules/client/src/main/resources" path="modules/client/src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="modules/resources/src/main/resources" path="modules/resources/src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jbossws-common"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jbossws-framework"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jbossws-spi"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JBOSS500GA"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JUNIT"/>
- <classpathentry kind="output" path="target/eclipse-classes"/>
+ <classpathentry kind="output" path="target-eclipse/classes"/>
</classpath>
Modified: stack/native/branches/jaxws21/.project
===================================================================
--- stack/native/branches/jaxws21/.project 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/.project 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jbossws-native</name>
+ <name>jbossws-native-jaxws21</name>
<comment></comment>
<projects>
</projects>
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingExt.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -23,7 +23,7 @@
import java.util.List;
-import javax.xml.ws.Binding21;
+import javax.xml.ws.Binding;
import javax.xml.ws.handler.Handler;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -34,7 +34,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2006
*/
-public interface BindingExt extends Binding21
+public interface BindingExt extends Binding
{
/** Get the handler chain for a given type */
List<Handler> getHandlerChain(HandlerType handlerType);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/binding/BindingProviderImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -27,7 +27,7 @@
import javax.xml.ws.Binding;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
-import javax.xml.ws.wsaddressing.BindingProvider21;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.http.HTTPBinding;
@@ -43,7 +43,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2006
*/
-public class BindingProviderImpl extends CommonBindingProvider implements BindingProvider21
+public class BindingProviderImpl extends CommonBindingProvider implements BindingProvider
{
private Map<String, Object> requestContext = new HashMap<String, Object>();
private Map<String, Object> responseContext = new HashMap<String, Object>();
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -48,7 +48,6 @@
import javax.xml.ws.http.HTTPException;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
-import javax.xml.ws.wsaddressing.BindingProvider21;
import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.util.NotImplementedException;
@@ -87,7 +86,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 04-Jul-2006
*/
-public class ClientImpl extends CommonClient implements org.jboss.ws.extensions.wsrm.api.RMProvider, BindingProvider21
+public class ClientImpl extends CommonClient implements org.jboss.ws.extensions.wsrm.api.RMProvider, BindingProvider
{
// the associated endpoint meta data
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -38,7 +38,6 @@
import javax.xml.transform.Source;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Binding;
-import javax.xml.ws.Binding21;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Dispatch;
import javax.xml.ws.EndpointReference;
@@ -306,7 +305,7 @@
private RemoteConnection getRemotingConnection()
{
- String bindingID = ((Binding21)bindingProvider.getBinding()).getBindingID();
+ String bindingID = bindingProvider.getBinding().getBindingID();
if (EndpointMetaData.SUPPORTED_BINDINGS.contains(bindingID) == false)
throw new IllegalStateException("Unsupported binding: " + bindingID);
@@ -433,7 +432,7 @@
}
}
- String bindingID = ((Binding21)bindingProvider.getBinding()).getBindingID();
+ String bindingID = bindingProvider.getBinding().getBindingID();
if (EndpointMetaData.SUPPORTED_BINDINGS.contains(bindingID) == false)
throw new IllegalStateException("Unsupported binding: " + bindingID);
@@ -455,7 +454,7 @@
private Object getReturnObject(MessageAbstraction resMsg)
{
- String bindingID = ((Binding21)bindingProvider.getBinding()).getBindingID();
+ String bindingID = bindingProvider.getBinding().getBindingID();
if (EndpointMetaData.SUPPORTED_BINDINGS.contains(bindingID) == false)
throw new IllegalStateException("Unsupported binding: " + bindingID);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -34,7 +34,7 @@
import javax.xml.transform.Source;
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Endpoint21;
+import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServicePermission;
import java.net.URI;
@@ -51,7 +51,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 07-Jul-2006
*/
-public class EndpointImpl extends Endpoint21
+public class EndpointImpl extends Endpoint
{
// provide logging
private final Logger log = Logger.getLogger(EndpointImpl.class);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -32,9 +32,8 @@
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.soap.SOAPBinding;
-import javax.xml.ws.spi.Provider21;
+import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
-import javax.xml.ws.spi.ServiceDelegate21;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
@@ -48,7 +47,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 03-May-2006
*/
-public class ProviderImpl extends Provider21
+public class ProviderImpl extends Provider
{
// 6.2 Conformance (Concrete javax.xml.ws.spi.Provider required): An implementation MUST provide
// a concrete class that extends javax.xml.ws.spi.Provider. Such a class MUST have a public constructor
@@ -110,13 +109,6 @@
}
@Override
- public <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation,
- Element... referenceParameters)
- {
- throw new NotImplementedException();
- }
-
- @Override
public W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation,
List<Element> referenceParameters)
{
@@ -140,7 +132,7 @@
wsdlLocation = w3c.getWsdlLocation();
serviceName = w3c.getServiceName();
}
- ServiceDelegate21 delegate = (ServiceDelegate21)createServiceDelegate(wsdlLocation, serviceName, Service.class);
+ ServiceDelegate delegate = createServiceDelegate(wsdlLocation, serviceName, Service.class);
return delegate.getPort(epr, sei, features);
}
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -49,7 +49,7 @@
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.ReferenceParameters;
import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate21;
+import javax.xml.ws.spi.ServiceDelegate;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.logging.Logger;
@@ -89,7 +89,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 03-May-2006
*/
-public class ServiceDelegateImpl extends ServiceDelegate21
+public class ServiceDelegateImpl extends ServiceDelegate
{
// provide logging
private final Logger log = Logger.getLogger(ServiceDelegateImpl.class);
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/eventing/jaxws/EventingService.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/eventing/jaxws/EventingService.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/extensions/eventing/jaxws/EventingService.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -27,7 +27,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.Service21;
+import javax.xml.ws.Service;
/**
@@ -37,8 +37,7 @@
*
*/
@WebServiceClient(name = "EventingService", targetNamespace = "http://schemas.xmlsoap.org/ws/2004/08/eventing", wsdlLocation = "wind.wsdl")
-public class EventingService
- extends Service21
+public class EventingService extends Service
{
private final static URL WSDL_LOCATION;
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Action.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Action.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Action.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * The <code>Action</code> annotation allows explicit association of <code>Action</code>
+ * message addressing property with <code>input</code>, <code>output</code>, and
+ * <code>fault</code> messages of the mapped WSDL operation.
+ * <p>
+ * This annotation can be specified on each method of a service endpoint interface.
+ * For such a method, the mapped operation in the generated WSDL
+ * contains explicit <code>wsaw:Action</code> attribute on the WSDL <code>input</code>,
+ * <code>output</code> and <code>fault</code> messages of the WSDL <code>operation</code>
+ * based upon which attributes of the <code>Action</code> annotation have been specified.
+ * <p>
+ * <b>Example 1</b>: Specify explicit values for <code>Action</code> message addressing property
+ * for <code>input</code> and <code>output</code> messages.
+ *
+ * <pre>
+ * @javax.jws.WebService
+ * public class AddNumbersImpl {
+ * @javax.xml.ws.Action(
+ * input="http://example.com/inputAction",
+ * output="http://example.com/outputAction")
+ * public int addNumbers(int number1, int number2) {
+ * return number1 + number2;
+ * }
+ * }
+ * </pre>
+ *
+ * The generated WSDL looks like:
+ * <pre>
+ * <definitions targetNamespace="http://example.com/numbers" ...>
+ * ...
+ * <portType name="AddNumbersPortType">
+ * <operation name="AddNumbers">
+ * <input message="tns:AddNumbersInput" name="Parameters"
+ * wsaw:Action="http://example.com/inputAction"/>
+ * <output message="tns:AddNumbersOutput" name="Result"
+ * wsaw:Action="http://example.com/outputAction"/>
+ * </operation>
+ * <portType>
+ * ...
+ * <definitions>
+ * </pre>
+ *
+ * <p>
+ * <b>Example 2</b>: Specify explicit value for <code>Action</code> message addressing property
+ * for only the <code>input</code> message. The default values are used for the
+ * <code>output</code> message.
+ *
+ * <pre>
+ * @javax.jws.WebService
+ * public class AddNumbersImpl {
+ * @javax.xml.ws.Action(input="http://example.com/inputAction")
+ * public int addNumbers(int number1, int number2) {
+ * return number1 + number2;
+ * }
+ * }
+ * </pre>
+ *
+ * The generated WSDL looks like:
+ *
+ * <pre>
+ * <definitions targetNamespace="http://example.com/numbers" ...>
+ * ...
+ * <portType name="AddNumbersPortType">
+ * <operation name="AddNumbers">
+ * <input message="tns:AddNumbersInput" name="Parameters"
+ * wsaw:Action="http://example.com/inputAction"/>
+ * <output message="tns:AddNumbersOutput" name="Result"/>
+ * </operation>
+ * <portType>
+ * ...
+ * <definitions>
+ * </pre>
+ *
+ * It is legitimate to specify an explicit value for <code>Action</code> message addressing property for
+ * <code>output</code> message only. In this case, a default value of <code>wsaw:Action</code> is used
+ * for the <code>input</code> message.
+ *
+ * <p>
+ * <b>Example 3</b>: See <a href="FaultAction.html">FaultAction</a> annotation for an example of
+ * how to specify an explicit value for <code>Action</code> message addressing property for the
+ * <code>fault</code> message.
+ *
+ * @see FaultAction
+ *
+ * @since JAX-WS 2.1
+ */
+
+@Documented
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.METHOD)
+public @interface Action {
+ /**
+ * Explicit value of <code>Action</code> message addressing property for the <code>input</code>
+ * message of the operation. If the value is "", then no <code>wsaw:Action</code>
+ * is generated.
+ */
+ String input() default "";
+
+ /**
+ * Explicit value of <code>Action</code> message addressing property for the <code>output</code>
+ * message of the operation. If the value is "", then no <code>wsaw:Action</code>
+ * is generated.
+ */
+ String output() default "";
+
+ /**
+ * Explicit value of <code>Action</code> message addressing property for the <code>fault</code>
+ * message(s) of the operation. Each exception that is mapped to a fault and requires explicit
+ * <code>Action</code> message addressing property, need to be specified as a value in this property
+ * using <a href="FaultAction.html">FaultAction</a> annotation.
+ */
+ FaultAction[] fault() default {};
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Action.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Binding.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Binding.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Binding.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -28,7 +28,6 @@
**/
public interface Binding
{
-
/**
* Gets a copy of the handler chain for a protocol binding instance.
* If the returned chain is modified a call to <code>setHandlerChain</code>
@@ -50,4 +49,14 @@
* chain.
*/
public void setHandlerChain(java.util.List<javax.xml.ws.handler.Handler> chain);
+
+ /**
+ * Get the URI for this binding instance.
+ *
+ * @return String The binding identifier for the port.
+ * Never returns <code>null</code>
+ *
+ * @since JAX-WS 2.1
+ */
+ String getBindingID();
}
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/BindingProvider.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/BindingProvider.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/BindingProvider.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -23,6 +23,8 @@
import java.util.Map;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
/** The <code>BindingProvider</code> interface provides access to the
* protocol binding and associated context objects for request and
* response message processing.
@@ -104,4 +106,69 @@
* @return The Binding for this binding provider.
**/
Binding getBinding();
+
+ /**
+ * Returns the <code>EndpointReference</code> associated with
+ * this <code>BindingProvider</code> instance.
+ * <p>
+ * If the Binding for this <code>bindingProvider</code> is
+ * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
+ * <code>W3CEndpointReference</code> MUST be returned.
+ * If the returned <code>EndpointReference</code> is a
+ * <code>W3CEndpointReference</code> it MUST contain
+ * the <code>wsaw:ServiceName</code> element and the
+ * <code>wsaw:EndpointName</code> attribute on the
+ * <code>wsaw:ServiceName</code>. It SHOULD contain
+ * the embedded WSDL in the <code>wsa:Metadata</code> element
+ * if there is an associated WSDL. The
+ * <code>wsaw:InterfaceName</code> MAY also be present.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
+ * WS-Addressing - WSDL 1.0</a>.
+ *
+ * @return EndpointReference of the target endpoint associated with this
+ * <code>BindingProvider</code> instance.
+ *
+ * @throws java.lang.UnsupportedOperationException If this
+ * <code>BindingProvider</code> uses the XML/HTTP binding.
+ *
+ * @see W3CEndpointReference
+ *
+ * @since JAX-WS 2.1
+ */
+ public EndpointReference getEndpointReference();
+
+ /**
+ * Returns the <code>EndpointReference</code> associated with
+ * this <code>BindingProvider</code> instance. The instance
+ * returned will be of type <code>clazz</code>.
+ * <p>
+ * If the returned <code>EndpointReference</code> is a
+ * <code>W3CEndpointReference</code> it MUST contain
+ * the <code>wsaw:ServiceName</code> element and the
+ * <code>wsaw:EndpointName</code> attribute on the
+ * <code>wsaw:ServiceName</code>. It SHOULD contain
+ * the embedded WSDL in the <code>wsa:Metadata</code> element
+ * if there is an associated WSDL. The
+ * <code>wsaw:InterfaceName</code> MAY also be present.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
+ * WS-Addressing - WSDL 1.0</a>.
+ *
+ * @param clazz Specifies the type of <code>EndpointReference</code>
+ * that MUST be returned.
+
+ * @return EndpointReference of the target endpoint associated with this
+ * <code>BindingProvider</code> instance. MUST be of type
+ * <code>clazz</code>.
+
+ * @throws javax.xml.ws.WebServiceException If the Class <code>clazz</code>
+ * is not supported by this implementation.
+ * @throws java.lang.UnsupportedOperationException If this
+ * <code>BindingProvider</code> uses the XML/HTTP binding.
+ *
+ * @since JAX-WS 2.1
+ */
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
+
}
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Endpoint.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Endpoint.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Endpoint.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -23,6 +23,9 @@
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.spi.Provider;
+
+import org.w3c.dom.Element;
+
import java.util.List;
import java.util.Map;
@@ -291,5 +294,79 @@
* this instance.
**/
public abstract void setProperties(Map<String, Object> properties);
+
+ /**
+ * Returns the <code>EndpointReference</code> associated with
+ * this <code>Endpoint</code> instance.
+ * <p>
+ * If the Binding for this <code>bindingProvider</code> is
+ * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
+ * <code>W3CEndpointReference</code> MUST be returned.
+ * If the returned <code>EndpointReference</code> is a
+ * <code>W3CEndpointReference</code> it MUST contain
+ * the <code>wsaw:ServiceName</code> element and the
+ * <code>wsaw:EndpointName</code> attribute on the
+ * <code>wsaw:ServiceName</code>. It SHOULD contain
+ * the embedded WSDL in the <code>wsa:Metadata</code> element
+ * if there is an associated WSDL. The
+ * <code>wsaw:InterfaceName</code> MAY also be present.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
+ * WS-Addressing - WSDL 1.0</a>.
+ *
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ * @return EndpointReference of this <code>Endpoint</code> instance.
+ * If the returned <code>EndpointReference</code> is of type
+ * <code>W3CEndpointReference</code> then it MUST contain the
+ * the specified <code>referenceParameters</code>.
+ * @throws WebServiceException If any error in the creation of
+ * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+ * not in the published state.
+ * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+ * uses the XML/HTTP binding.
+ *
+ * @see javax.xml.ws.wsaddressing.W3CEndpointReference
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract EndpointReference getEndpointReference(Element... referenceParameters);
+
+ /**
+ * Returns the <code>EndpointReference</code> associated with
+ * this <code>Endpoint</code> instance.
+ * <p>
+ * If the returned <code>EndpointReference</code> is a
+ * <code>W3CEndpointReference</code> it MUST contain
+ * the <code>wsaw:ServiceName</code> element and the
+ * <code>wsaw:EndpointName</code> attribute on the
+ * <code>wsaw:ServiceName</code>. It SHOULD contain
+ * the embedded WSDL in the <code>wsa:Metadata</code> element
+ * if there is an associated WSDL. The
+ * <code>wsaw:InterfaceName</code> MAY also be present.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
+ * WS-Addressing - WSDL 1.0</a>.
+ *
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ * @return EndpointReference of type <code>clazz</code> of this
+ * <code>Endpoint<code> instance.
+ * If the returned <code>EndpointReference</code> is of type
+ * <code>W3CEndpointReference</code> then it MUST contain the
+ * the specified <code>referenceParameters</code>.
+
+ * @throws WebServiceException If any error in the creation of
+ * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
+ * not in the published state or if the <code>clazz</code> is not a supported
+ * <code>EndpointReference</code> type.
+ * @throws UnsupportedOperationException If this <code>BindingProvider</code>
+ * uses the XML/HTTP binding.
+ *
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters);
+
}
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.spi.Provider;
+import javax.xml.ws.spi.Provider21;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * This class represents an WS-Addressing EndpointReference
+ * which is a remote reference to a web service endpoint.
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+ * WS-Addressing</a>
+ * for more information on WS-Addressing EndpointReferences.
+ * <p>
+ * This class is immutable as the typical web service developer
+ * need not be concerned with its contents. The web service
+ * developer should use this class strictly as a mechanism to
+ * reference a remote web service endpoint. See the {@link Service} APIs
+ * that clients can use to that utilize an <code>EndpointReference</code>.
+ * See the {@link javax.xml.ws.Endpoint}, and
+ * {@link javax.xml.ws.BindingProvider} APIs on how
+ * <code>EndpointReferences</code> can be created for published
+ * endpoints.
+ * <p>
+ * Concrete implementations of this class will represent
+ * an <code>EndpointReference</code> for a particular version of Addressing.
+ * For example the {@link W3CEndpointReference} is for use
+ * with W3C WS-Addressing 1.0 - Core Recommendation.
+ * If JAX-WS implementors need to support different versions
+ * of addressing, they should write their own
+ * <code>EndpointReference</code> subclass for that version.
+ * This will allow a JAX-WS implementation to createEndpointReference
+ * vendor specific <code>EndpointReferences</code> that that
+ * vendor can use to flag a different version of
+ * addressing.
+ * <p>
+ * Web service developers that wish to pass or return
+ * <code>EndpointReferences</code> in Java methods in an
+ * SEI should use
+ * concrete instances of an <code>EndpointReference</code> such
+ * as the <code>W3CEndpointReferendce</code>. This way the
+ * schema mapped from the SEI will be more descriptive of the
+ * type of endpoint reference being passed.
+ * <p>
+ * JAX-WS implementors are expected to extract the XML infoset
+ * from an <CODE>EndpointReferece</CODE> using the
+ * <code>{@link EndpointReference#writeTo}</code>
+ * method.
+ * <p>
+ * JAXB will bind this class to xs:anyType. If a better binding
+ * is desired, web services developers should use a concrete
+ * subclass such as {@link W3CEndpointReference}.
+ *
+ * @see W3CEndpointReference
+ * @see Service
+ * @since JAX-WS 2.1
+ */
+//@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
+public abstract class EndpointReference
+{
+ //
+ //Default constructor to be only called by derived types.
+ //
+ protected EndpointReference()
+ {
+ };
+
+ /**
+ * Factory method to read an EndpointReference from the infoset contained in
+ * <code>eprInfoset</code>. This method delegates to the vendor specific
+ * implementation of the {@link javax.xml.ws.spi.Provider#readEndpointReference} method.
+ *
+ * @param eprInfoset The <code>EndpointReference<code> infoset to be unmarshalled
+ *
+ * @return the EndpointReference unmarshalled from <code>eprInfoset</code>
+ * never <code>null</code>
+ * @throws WebServiceException
+ * if an error occurs while creating the
+ * <code>EndpointReference</code> from the <CODE>eprInfoset</CODE>
+ * @throws java.lang.IllegalArgumentException
+ * if the null <code>eprInfoset</tt> value is given.
+ */
+ public static EndpointReference readFrom(Source eprInfoset)
+ {
+ return ((Provider21)Provider.provider()).readEndpointReference(eprInfoset);
+ }
+
+ /**
+ * write this EndpointReference to the specified infoset format
+ * @throws WebServiceException
+ * if there is an error writing the
+ * EndpointReference to the specified <code>result</code>.
+ *
+ * @throws java.lang.IllegalArgumentException
+ * If the null <code>result</tt> value is given.
+ */
+ public abstract void writeTo(Result result);
+
+ /**
+ * The getPort method returns a proxy. If there
+ * are any reference parameters in the
+ * <code>EndpointReference</code> instance, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * The <code>EndpointReference</code> instance specifies the
+ * endpoint that will be invoked by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL Metadata from this <code>EndpointReference</code> or from
+ * annotations on the <code>serviceEndpointInterface</code>.
+ * <p>
+ * Because this port is not created from a Service object, handlers
+ * will not automatically be configured, and the HandlerResolver
+ * and Executor cannot be get or set for this port. The
+ * <code>BindingProvider().getBinding().setHandlerChain()</code>
+ * method can be used to manually configure handlers for this port.
+ *
+ *
+ * @param serviceEndpointInterface Service endpoint interface
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If this
+ * <code>endpointReference</code>
+ * is invalid
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified
+ * <LI>If feature is enabled that is not compatible with
+ * this port or is unsupported.
+ * </UL>
+ *
+ * @see java.lang.reflect.Proxy
+ * @see WebServiceFeature
+ **/
+ public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
+ {
+ return ((Provider21)Provider.provider()).getPort(this, serviceEndpointInterface, features);
+ }
+
+ /**
+ * Displays EPR infoset for debugging convenience.
+ */
+ public String toString()
+ {
+ StringWriter w = new StringWriter();
+ writeTo(new StreamResult(w));
+ return w.toString();
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/EndpointReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/FaultAction.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/FaultAction.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/FaultAction.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * The <code>FaultAction</code> annotation is used inside an <a href="Action.html">
+ * Action</a> annotation to allow an explicit association of <code>Action</code> message
+ * addressing property with the <code>fault</code> messages of the WSDL operation mapped from
+ * the exception class.
+ * <p>
+ * In this version of JAX-WS there is no standard way to specify Action values in a WSDL and
+ * there is no standard default value. It is intended that, after the W3C WG on WS-Addressing
+ * has defined these items in a recommendation, a future version of JAX-WS will require the
+ * new standards.
+ *
+ * @since JAX-WS 2.1
+ */
+
+@Documented
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.METHOD)
+public @interface FaultAction {
+ /**
+ * Name of the exception class
+ */
+ Class className();
+
+ /**
+ * Value of <code>Action</code> message addressing property for the exception
+ */
+ String value() default "";
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/FaultAction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBinding.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBinding.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBinding.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+/**
+ * This feature clarifies the use of the <code>wsdl:binding</code>
+ * in a JAX-WS runtime.
+ * <p>
+ * This feature is only useful with web services that have an
+ * associated WSDL. Enabling this feature requires that a JAX-WS
+ * implementation inspect the <code>wsdl:binding</code> for an
+ * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
+ * that have the <code>required</code> attribute set to <code>true</code>
+ * are understood and are being used.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+ * required <code>wsdl:binding</code> extensions are either understood
+ * and used by the runtime, or explicitly disabled by the web service
+ * application. A web service application can disable a particular
+ * extension that has a know <code>WebServiceFeature</code> using
+ * either the {@link BindingType#features} element on the server
+ * or one of the following methods on the client:
+ * <ul>
+ * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+ * <li>{@link Service#getPort(Class,WebServiceFeature...)}
+ * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(QName,Class,
+ * Service.Mode mode,WebServiceFeature...)}
+ * <li>{@link Service21#createDispatch(EndpointReference,
+ * Class,Service.Mode,
+ * WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(QName,
+ * JAXBContext, Service.Mode, WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(EndpointReference,
+ * JAXBContext, Service.Mode, WebServiceFeature...)}
+ * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
+ * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
+ * generated <code>Service</code>.
+ * </ul>
+ * The runtime MUST also make sure that binding of
+ * SEI parameters/return values respect the <code>wsdl:binding</code>.
+ * With this feature enabled, if a required
+ * <code>wsdl:binding</code> extension is in the WSDL and it is not
+ * supported by a JAX-WS runtime and it has not
+ * been explicitly turned off by the web service developer, then
+ * that JAX-WS runtime MUST behave appropriately based on whether it is
+ * on the client or server:
+ * <UL>
+ * <li>Client: runtime MUST throw a
+ * <code>WebServiceException</code> no sooner than when one of the methods
+ * above is invoked but no later than the first invocation of an endpoint
+ * operation.
+ * <li>throw a WebServiceException and the endpoint MUST fail to start
+ * </ul>
+ * <li> DISABLED: In this Mode, an implementation may choose whether
+ * to inspect the <code>wsdl:binding<code> or not and to what degree
+ * the <code>wsdl:binding</code> will be inspected. For example,
+ * one implementation may choose to behave as if this feature is enabled,
+ * another implementation may only choose to verify the SEI's
+ * parameter/return type bindings.
+ * </ul>
+ *
+ * @see javax.xml.ws.RespectBindingFeature
+ *
+ * @since JAX-WS 2.1
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+@WebServiceFeatureAnnotation(id = RespectBindingFeature.ID, bean = RespectBindingFeature.class)
+public @interface RespectBinding {
+ /**
+ * Specifies if this feature is enabled or disabled.
+ */
+ boolean enabled() default true;
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBinding.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This feature clarifies the use of the <code>wsdl:binding</code>
+ * in a JAX-WS runtime.
+ * <p>
+ * This feature is only useful with web services that have an
+ * associated WSDL. Enabling this feature requires that a JAX-WS
+ * implementation inspect the <code>wsdl:binding</code> for an
+ * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
+ * that have the <code>required</code> attribute set to <code>true</code>
+ * are understood and are being used.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
+ * required <code>wsdl:binding</code> extensions are either understood
+ and used by the runtime, or explicitly disabled by the web service
+ * application. A web service application can disable a particular
+ * extension that has a know <code>WebServiceFeature</code> using
+ * either the {@link BindingType#features} element on the server
+ * or one of the following methods on the client:
+ * <ul>
+ * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
+ * <li>{@link Service#getPort(Class,WebServiceFeature...)}
+ * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(QName,Class,
+ * Service.Mode mode,WebServiceFeature...)}
+ * <li>{@link Service21#createDispatch(EndpointReference,
+ * Class,Service.Mode,
+ * WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(QName,
+ * JAXBContext, Service.Mode, WebServiceFeature...)}
+ * <li>{@link Service#createDispatch(EndpointReference,
+ * JAXBContext, Service.Mode, WebServiceFeature...)}
+ * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
+ * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
+ * generated <code>Service</code>.
+ * </ul>
+ * The runtime MUST also make sure that binding of
+ * SEI parameters/return values respect the <code>wsdl:binding</code>.
+ * With this feature enabled, if a required
+ * <code>wsdl:binding</code> extension is in the WSDL and it is not
+ * supported by a JAX-WS runtime and it has not
+ * been explicitly turned off by the web service developer, then
+ * that JAX-WS runtime MUST behave appropriately based on whether it is
+ * on the client or server:
+ * <UL>
+ * <li>Client: runtime MUST throw a
+ * <code>WebServiceException</code> no sooner than when one of the methods
+ * above is invoked but no later than the first invocation of an endpoint
+ * operation.
+ * <li>throw a WebServiceException and the endpoint MUST fail to start
+ * </ul>
+ * <li> DISABLED: In this Mode, an implementation may choose whether
+ * to inspect the <code>wsdl:binding<code> or not and to what degree
+ * the <code>wsdl:binding</code> will be inspected. For example,
+ * one implementation may choose to behave as if this feature is enabled,
+ * another implementation may only choose to verify the SEI's
+ * parameter/return type bindings.
+ * </ul>
+ *
+ * @see javax.xml.ws.soap.AddressingFeature
+ *
+ * @since JAX-WS 2.1
+ */
+public final class RespectBindingFeature extends WebServiceFeature
+{
+ /**
+ *
+ * Constant value identifying the RespectBindingFeature
+ */
+ public static final String ID = "javax.xml.ws.InspectBindingFeature";
+
+ /**
+ * Create an <code>RespectBindingFeature</code>.
+ * The instance created will be enabled.
+ */
+ public RespectBindingFeature()
+ {
+ this.enabled = true;
+ }
+
+ /**
+ * Create an RespectBindingFeature
+ *
+ * @param enabled specifies whether this feature should
+ * be enabled or not.
+ */
+ public RespectBindingFeature(boolean enabled)
+ {
+ this.enabled = enabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getID()
+ {
+ return ID;
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/RespectBindingFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Service.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Service.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/Service.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -342,4 +342,395 @@
{
delegate.setExecutor(executor);
}
+
+
+
+
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with objects of
+ * the users choosing. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the dispatch accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * <p>
+ * This method behaves the same as calling
+ * <pre>
+ * dispatch = service.createDispatch(portName, type, mode, features);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
+ * element in the
+ * metadata of the <code>endpointReference</code>.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned <code>Dispatch</code> object.
+ * @param type The class of object used to messages or message
+ * payloads. Implementations are required to support
+ * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
+ * when type is SOAPMessage.
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <li>If the <code>wsaw:ServiceName</code> element
+ * or the <code>wsaw:EndpointName</code> attribute
+ * is missing in the metdata of the
+ * <code>endpointReference</code>.
+ * <li>If the <code>wsaw:ServiceName</code> does not
+ * match the <code>serviceName</code> of this instance.
+ * <li>If the <code>wsaw:EndpointName</code> does not
+ * match a valid wsdl:Port in the WSDL metadata.
+ * <li>If any error in the creation of
+ * the <code>Dispatch</code> object.
+ * <li>if a feature is enabled that is not
+ * compatible with this port or is unsupported.
+ * </UL>
+ *
+ * @see javax.xml.transform.Source
+ * @see javax.xml.soap.SOAPMessage
+ * @see WebServiceFeature;
+ *
+ * @since JAX-WS 2.1
+ **/
+ public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).createDispatch(endpointReference, type, mode, features);
+ }
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with JAXB
+ * generated objects. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the dispatch accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * <p>
+ * This method behavies the same as calling
+ * <pre>
+ * dispatch = service.createDispatch(portName, context, mode, features);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
+ * element in the
+ * metadata of the <code>endpointReference</code>.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned <code>Dispatch</code> object.
+ * @param context The JAXB context used to marshall and unmarshall
+ * messages or message payloads.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body.
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws WebServiceException
+ * @throws WebServiceException
+ * <UL>
+ * <li>If there is any missing WSDL metadata
+ * as required by this method.
+ * <li>If the <code>wsaw:ServiceName</code> element
+ * or the <code>wsaw:EndpointName</code> attribute
+ * is missing in the metdata of the
+ * <code>endpointReference</code>.
+ * <li>If the <code>wsaw:ServiceName</code> does not
+ * match the <code>serviceName</code> of this instance.
+ * <li>If the <code>wsaw:EndpointName</code> does not
+ * match a valid wsdl:Port in the WSDL metadata.
+ * <li>If any error in the creation of
+ * the <code>Dispatch</code> object.
+ * <li>if a feature is enabled that is not
+ * compatible with this port or is unsupported.
+ * </UL>
+ *
+ * @see javax.xml.bind.JAXBContext
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).createDispatch(endpointReference, context, mode, features);
+ }
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with objects of
+ * the users choosing.
+ *
+ * @param portName Qualified name for the target service endpoint
+ * @param type The class of object used for messages or message
+ * payloads. Implementations are required to support
+ * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
+ * when type is SOAPMessage.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance.
+ * @throws WebServiceException If any error in the creation of
+ * the <code>Dispatch</code> object or if a
+ * feature is enabled that is not compatible with
+ * this port or is unsupported.
+ *
+ * @see javax.xml.transform.Source
+ * @see javax.xml.soap.SOAPMessage
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).createDispatch(portName, type, mode, features);
+ }
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with JAXB
+ * generated objects.
+ *
+ * @param portName Qualified name for the target service endpoint
+ * @param context The JAXB context used to marshall and unmarshall
+ * messages or message payloads.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance.
+ * @throws WebServiceException If any error in the creation of
+ * the <code>Dispatch</code> object or if a
+ * feature is enabled that is not compatible with
+ * this port or is unsupported.
+ *
+ * @see javax.xml.bind.JAXBContext
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).createDispatch(portName, context, mode, features);
+ }
+
+ /**
+ * The getPort method returns a proxy. The parameter
+ * <code>serviceEndpointInterface</code> specifies the service
+ * endpoint interface that is supported by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly.
+ * The returned proxy should not be reconfigured by the client.
+ *
+ * @param serviceEndpointInterface Service endpoint interface.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object instance that supports the
+ * specified service endpoint interface.
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy.
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified.
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ *
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).getPort(serviceEndpointInterface, features);
+ }
+
+ /**
+ * The getPort method returns a proxy.
+ * The parameter <code>endpointReference</code> specifies the
+ * endpoint that will be invoked by the returned proxy. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * The returned proxy should not be reconfigured by the client.
+ * If this <code>Service</code> instance has a known proxy
+ * port that matches the information contained in
+ * the WSDL,
+ * then that proxy is returned, otherwise a WebServiceException
+ * is thrown.
+ * <p>
+ * Calling this method has the same behavior as the following
+ * <pre>
+ * port = service.getPort(portName, serviceEndpointInterface);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpontName</code> attribute of the
+ * <code>wsaw:ServiceName</code> element in the
+ * metadata of the <code>endpointReference</code> or from the
+ * <code>serviceEndpointInterface</code> and the WSDL
+ * associated with this <code>Service</code> instance.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned proxy.
+ * @param serviceEndpointInterface Service endpoint interface.
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface.
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy.
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <LI>If the <code>wsaw:EndpointName</code> is
+ * missing from the <code>endpointReference</code>
+ * or does not match a wsdl:Port
+ * in the WSDL metadata.
+ * <LI>If the <code>wsaw:ServiceName</code> in the
+ * <code>endpointReference</code> metadata does not
+ * match the <code>serviceName</code> of this
+ * <code>Service</code> instance.
+ * <LI>If an invalid
+ * <code>endpointReference</code>
+ * is specified.
+ * <LI>If an invalid
+ * <code>serviceEndpointInterface</code>
+ * is specified.
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ *
+ * @since JAX-WS 2.1
+ **/
+ public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).getPort(endpointReference, serviceEndpointInterface, features);
+ }
+
+ /**
+ * The getPort method returns a proxy. A service client
+ * uses this proxy to invoke operations on the target
+ * service endpoint. The <code>serviceEndpointInterface</code>
+ * specifies the service endpoint interface that is supported by
+ * the created dynamic proxy instance.
+ *
+ * @param portName Qualified name of the service endpoint in
+ * the WSDL service description.
+ * @param serviceEndpointInterface Service endpoint interface
+ * supported by the dynamic proxy instance.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that
+ * supports the specified service endpoint
+ * interface.
+ * @throws WebServiceException This exception is thrown in the
+ * following cases:
+ * <UL>
+ * <LI>If there is an error in creation of
+ * the proxy.
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * or <code>portName</code> is specified.
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ * @see java.lang.reflect.Proxy
+ * @see java.lang.reflect.InvocationHandler
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features)
+ {
+ return ((ServiceDelegate)delegate).getPort(portName, serviceEndpointInterface, features);
+ }
+
}
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceContext.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceContext.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceContext.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -22,6 +22,9 @@
package javax.xml.ws;
import javax.xml.ws.handler.MessageContext;
+
+import org.w3c.dom.Element;
+
import java.security.Principal;
/**
@@ -91,5 +94,52 @@
* being serviced.
**/
public boolean isUserInRole(String role);
+
+ /**
+ * Returns the <code>WEndpointReference</code> for this
+ * endpoint.
+ *
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ * @return EndpointReference of the endpoint associated with this
+ * <code>WebServiceContext</code>.
+ * If the returned <code>EndpointReference</code> is of type
+ * <code>W3CEndpointReference</code> then it MUST contain the
+ * the specified <code>referenceParameters</code>.
+ *
+ * @throws IllegalStateException This exception is thrown
+ * if the method is called while no request is
+ * being serviced.
+ *
+ * @see javax.xml.ws.wsaddressing.W3CEndpointReference
+ *
+ * @since JAX-WS 2.1
+ */
+ public EndpointReference getEndpointReference(Element... referenceParameters);
+ /**
+ * Returns the <code>EndpointReference</code> associated with
+ * this endpoint.
+ * <p>
+ *
+ * @param clazz The type of <code>EndpointReference</code> that
+ * MUST be returned.
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ * @return EndpointReference of type <code>clazz</code> of the endpoint
+ * associated with this <code>WebServiceContext</code> instance.
+ * If the returned <code>EndpointReference</code> is of type
+ * <code>W3CEndpointReference</code> then it MUST contain the
+ * the specified <code>referenceParameters</code>.
+ *
+ * @throws IllegalStateException This exception is thrown
+ * if the method is called while no request is
+ * being serviced.
+ * @throws WebServiceException If the <code>clazz</code> type of
+ * <code>EndpointReference</code> is not supported.
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters);
+
}
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceFeature.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws;
+
+/**
+ * A WebServiceFeature is used to represent a feature that can be
+ * enabled or disabled for a web service.
+ * <p>
+ * The JAX-WS specification will define some standard features and
+ * JAX-WS implementors are free to define additional features if
+ * necessary. Vendor specific features may not be portable so
+ * caution should be used when using them. Each Feature definition
+ * MUST define a <code>public static final String ID</code>
+ * that can be used in the Feature annotation to refer
+ * to the feature. This ID MUST be unique across all features
+ * of all vendors. When defining a vendor specific feature ID,
+ * use a vendor specific namespace in the ID string.
+ *
+ * @see javax.xml.ws.RespectBindingFeature
+ * @see javax.xml.ws.soap.AddressingFeature
+ * @see javax.xml.ws.soap.MTOMFeature
+ *
+ * @since 2.1
+ */
+public abstract class WebServiceFeature
+{
+ /**
+ * Each Feature definition MUST define a public static final
+ * String ID that can be used in the Feature annotation to refer
+ * to the feature.
+ */
+ // public static final String ID = "some unique feature Identifier";
+ /**
+ * Get the unique identifier for this WebServiceFeature.
+ *
+ * @return the unique identifier for this feature.
+ */
+ public abstract String getID();
+
+ /**
+ * Specifies if the feature is enabled or disabled
+ */
+ protected boolean enabled = false;
+
+ protected WebServiceFeature()
+ {
+ }
+
+ /**
+ * Returns <code>true</code> if this feature is enabled.
+ *
+ * @return <code>true</code> if and only if the feature is enabled .
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/WebServiceFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/handler/MessageContext.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/handler/MessageContext.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/handler/MessageContext.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -144,6 +144,16 @@
public static final String PATH_INFO = "javax.xml.ws.http.request.pathinfo";
/**
+ * Standard property: WS Addressing Reference Parameters.
+ * The list MUST include all SOAP headers marked with the
+ * wsa:IsReferenceParameter="true" attribute.
+ * <p>Type: List<Element>
+ *
+ * @since JAX-WS 2.1
+ */
+ public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters";
+
+ /**
* Property scope. Properties scoped as <code>APPLICATION</code> are
* visible to handlers,
* client applications and service endpoints; properties scoped as
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/Addressing.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/Addressing.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/Addressing.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.soap;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+/**
+ * This feature represents the use of WS-Addressing with either
+ * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature
+ * with any other binding is NOT required.
+ * <p>
+ * Enabling this feature will result in the
+ * <code>wsaw:UsingAddressing</code> element being added to the
+ * <code>wsdl:Binding</code> for
+ * the endpoint and in the runtime being capable of responding to
+ * WS-Addressing headers.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, Addressing will be enabled.
+ * If there is not a WSDL associated with the Endpoint and
+ * a WSDL is to be generated, it MUST be generated with the
+ * wsaw:UsingAddressing element. At runtime, Addressing headers
+ * MUST be consumed by the receiver and generated by the
+ * sender even if the WSDL declares otherwise. The
+ * mustUnderstand="0" attribute MUST be used on the Addressing
+ * headers.
+ * <li> DISABLED: In this Mode, Addressing will be disabled
+ * even if an associated WSDL specifies otherwise. At runtime,
+ * Addressing headers MUST NOT be used.
+ * </ul>
+ * <p>
+ * The {@link #required} property can be used to
+ * specify if the <code>required</code> attribute on the
+ * <code>wsaw:UsingAddressing</code> element should
+ * be <code>true</code> or <code>false</code>. By default the
+ * <code>wsdl:required</code> parameter is <code>false</code>.
+ *
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">WS-Addressing</a>
+ * for more information on WS-Addressing.
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a> for more information on <code>wsaw:UsingAddressing</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+(a)WebServiceFeatureAnnotation(id=AddressingFeature.ID,bean=AddressingFeature.class)
+public @interface Addressing {
+ /**
+ * Specifies if this feature is enabled or disabled.
+ */
+ boolean enabled() default true;
+
+ /**
+ * Property to determine the value of the
+ * <code>wsdl:required</code> attribute on
+ * <code>wsaw:UsingAddressing</code> element in the WSDL.
+ */
+ boolean required() default false;
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/Addressing.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/AddressingFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/AddressingFeature.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/AddressingFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.soap;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This feature represents the use of WS-Addressing with either
+ * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature
+ * with any other binding is NOT required.
+ * <p>
+ * Enabling this feature on the server will result in the
+ * <code>wsaw:UsingAddressing</code> element being added to the
+ * <code>wsdl:Binding</code> for
+ * the endpoint and in the runtime being capable of responding to
+ * WS-Addressing headers.
+ * <p>
+ * Enabling this feature on the client will cause the JAX-WS runtime
+ * to include WS-Addressing headers in SOAP messages.
+ * <p>
+ * If the web service developer has not explicitly enabled this feature,
+ * it may be automatically enabled if the associated WSDL enables
+ * WS-Addressing via the <code>wsaw:UsingAddressing</code> element with
+ * the <code>wsdl:required</code> attribute set to <code>true</code>.
+ * <br>
+ * See {@link javax.xml.ws.RespectBindingFeature} for more information
+ * on required WSDL extensions.
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to be enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, Addressing will be enabled.
+ * If there is not a WSDL associated with the Endpoint and
+ * a WSDL is to be generated, it MUST be generated with the
+ * wsaw:UsingAddressing element. At runtime, Addressing headers
+ * MUST be consumed by the receiver and generated by the
+ * sender even if the WSDL declares otherwise. The
+ * mustUnderstand="0" attribute MUST be used on the Addressing
+ * headers.
+ * <li> DISABLED: In this Mode, Addressing will be disabled
+ * even if an associated WSDL specifies otherwise. At runtime,
+ * Addressing headers MUST NOT be used.
+ * </ul>
+ * <p>
+ * The {@link #required} property can be used to
+ * specify if the <code>required</code> attribute on the
+ * <code>wsaw:UsingAddressing</code> element should
+ * be <code>true</code> or <code>false</code>. By default the
+ * <code>wsdl:required</code> parameter is <code>false</code>.
+ *
+ * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">WS-Addressing</a>
+ * for more information on WS-Addressing.
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a> for more information on <code>wsaw:UsingAddressing</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class AddressingFeature extends WebServiceFeature {
+ /**
+ * Constant value identifying the AddressingFeature
+ */
+ public static final String ID = "http://www.w3.org/2005/08/addressing/module";
+
+ /**
+ * Property for <code>required</code> feature parameter. When Addressing
+ * is enabled, the value of this property will be set to the
+ * <code>wsdl:required</code> attribute on
+ * <code>wsaw:UsingAddressing</code> element in the WSDL.
+ */
+ protected boolean required = false;
+
+ /**
+ * Create an <code>AddressingFeature</code>.
+ * The instance created will be enabled.
+ */
+ public AddressingFeature() {
+ this.enabled = true;
+ }
+
+ /**
+ * Create an <code>AddressingFeature</code>
+ *
+ * @param enabled specifies whether this feature should
+ * be enabled or not.
+ */
+ public AddressingFeature(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ /**
+ * Create an <code>AddressingFeature</code>
+ *
+ * @param enabled specifies whether this feature should
+ * be enabled or not.
+ * @param required specifies the value that will be used
+ * for the <code>wsdl:required</code> attribute on the
+ * <code>wsaw:UsingAddressing</code> element.
+ */
+ public AddressingFeature(boolean enabled, boolean required) {
+ this.enabled = enabled;
+ this.required = required;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Gets the boolean value used to set the
+ * <code>wsdl:required</code> attribute on
+ * <code>wsaw:UsingAddressing</code> element
+ * in the WSDL.
+ *
+ * @return the current required value
+ */
+ public boolean isRequired() {
+ return required;
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/AddressingFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOM.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOM.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOM.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.soap;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+/**
+ * This feature represents the use of MTOM with a
+ * web service.
+ *
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, MTOM will be enabled.
+ * <li> DISABLED: In this Mode, MTOM will be disabled
+ * </ul>
+ * <p>
+ * The {@link #threshold} property can be used to set the threshold
+ * value used to determine when binary data should be XOP encoded.
+ *
+ * @since JAX-WS 2.1
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+(a)WebServiceFeatureAnnotation(id=MTOMFeature.ID,bean=MTOMFeature.class)
+public @interface MTOM {
+ /**
+ * Specifies if this feature is enabled or disabled.
+ */
+ boolean enabled() default true;
+
+ /**
+ * Property for MTOM threshold value. When MTOM is enabled, binary data above this
+ * size in bytes will be XOP encoded or sent as attachment. The value of this property
+ * MUST always be >= 0. Default value is 0.
+ */
+ int threshold() default 0;
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOM.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOMFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOMFeature.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOMFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.soap;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This feature represents the use of MTOM with a
+ * web service.
+ *
+ * <p>
+ * The following describes the affects of this feature with respect
+ * to being enabled or disabled:
+ * <ul>
+ * <li> ENABLED: In this Mode, MTOM will be enabled.
+ * <li> DISABLED: In this Mode, MTOM will be disabled
+ * </ul>
+ * <p>
+ * The {@link #threshold} property can be used to set the threshold
+ * value used to determine when binary data should be XOP encoded.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class MTOMFeature extends WebServiceFeature {
+ /**
+ * Constant value identifying the MTOMFeature
+ */
+ public static final String ID = "http://www.w3.org/2004/08/soap/features/http-optimization";
+
+
+ /**
+ * Property for MTOM threshold value. This property serves as a hint when
+ * MTOM is enabled, binary data above this size in bytes SHOULD be sent
+ * as attachment.
+ * The value of this property MUST always be >= 0. Default value is 0.
+ */
+ protected int threshold = 0;
+
+
+ /**
+ * Create an <code>MTOMFeature</code>.
+ * The instance created will be enabled.
+ */
+ public MTOMFeature() {
+ this.enabled = true;
+ }
+
+ /**
+ * Creates an <code>MTOMFeature</code>.
+ *
+ * @param enabled specifies if this feature should be enabled or not
+ */
+ public MTOMFeature(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+
+ /**
+ * Creates an <code>MTOMFeature</code>.
+ * The instance created will be enabled.
+ *
+ * @param threshold the size in bytes that binary data SHOULD be before
+ * being sent as an attachment.
+ *
+ * @throws WebServiceException if threshold is < 0
+ */
+ public MTOMFeature(int threshold) {
+ if (threshold < 0)
+ throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+ this.enabled = true;
+ this.threshold = threshold;
+ }
+
+ /**
+ * Creates an <code>MTOMFeature</code>.
+ *
+ * @param enabled specifies if this feature should be enabled or not
+ * @param threshold the size in bytes that binary data SHOULD be before
+ * being sent as an attachment.
+ *
+ * @throws WebServiceException if threshold is < 0
+ */
+ public MTOMFeature(boolean enabled, int threshold) {
+ if (threshold < 0)
+ throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
+ this.enabled = enabled;
+ this.threshold = threshold;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Gets the threshold value used to determine when binary data
+ * should be sent as an attachment.
+ *
+ * @return the current threshold size in bytes
+ */
+ public int getThreshold() {
+ return threshold;
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/soap/MTOMFeature.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/Provider.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/Provider.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -21,10 +21,17 @@
*/
package javax.xml.ws.spi;
+import java.util.List;
+
import javax.xml.namespace.QName;
import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
+
/**
* Service provider for ServiceDelegate and Endpoint objects.
*
@@ -132,4 +139,128 @@
*/
public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);
+ /**
+ * The getPort method returns a proxy. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * The parameter <code>endpointReference</code> specifies the
+ * endpoint that will be invoked by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL Metadata from the <code>EndpointReference</code>.
+ *
+ *
+ * @param endpointReference the EndpointReference that will
+ * be invoked by the returned proxy.
+ * @param serviceEndpointInterface Service endpoint interface
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface
+ * @throws javax.xml.ws.WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If this
+ * <code>endpointReference</code>
+ * is illegal
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified
+ * <LI>If feature is enabled that is not compatible with
+ * this port or is unsupported.
+ * </UL>
+ *
+ * @see javax.xml.ws.WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ /**
+ * Factory method to create a <code>W3CEndpointReference</code>.
+ *
+ * <p>
+ * This method can be used to create a <code>W3CEndpointReference</code>
+ * for any endpoint by specifying the <code>address</code> property along
+ * with any other desired properties. This method
+ * can also be used to create a <code>W3CEndpointReference</code> for
+ * an endpoint that is published by the same Java EE application.
+ * To do so the <code>address</code> property can be provided or this
+ * method can automatically determine the <code>address</code> of
+ * an endpoint that is published by the same Java EE application and is
+ * identified by the <code>serviceName</code> and
+ * <code>portName</code> propeties. If the <code>address</code> is
+ * <code>null</code> and the <code>serviceName</code> and
+ * <code>portName</code> do not identify an endpoint published by the
+ * same Java EE application, a
+ * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
+ *
+ * @param address Specifies the address of the target endpoint
+ * @param serviceName Qualified name of the service in the WSDL.
+ * @param portName Qualified name of the endpoint in the WSDL.
+ * @param metadata A list of elements that should be added to the
+ * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
+ * element.
+ * @param wsdlDocumentLocation URL for the WSDL document location for
+ * the service.
+ * @param referenceParameters Reference parameters to be associated
+ * with the returned <code>EndpointReference</code> instance.
+ *
+ * @return the <code>W3CEndpointReference<code> created from
+ * <code>serviceName</code>, <code>portName</code>,
+ * <code>metadata</code>, <code>wsdlDocumentLocation</code>
+ * and <code>referenceParameters</code>. This method
+ * never returns <code>null</code>.
+ *
+ * @throws javax.lang.IllegalArgumentException
+ * <ul>
+ * <li>If the <code>address</code>, <code>serviceName</code> and
+ * <code>portName</code> are all <code>null</code>.
+ * <li>If the <code>serviceName</code> service is <code>null</code> and the
+ * <code>portName> is NOT <code>null</code>.
+ * <li>If the <code>address</code> property is <code>null</code> and
+ * the <code>serviceName</code> and <code>portName</code> do not
+ * specify a valid endpoint published by the same Java EE
+ * application.
+ * <li>If the <code>serviceName</code>is NOT <code>null</code>
+ * and is not present in the specified WSDL.
+ * <li>If the <code>portName</code> port is not <code>null<code> and it
+ * is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+ * and does not represent a valid WSDL.
+ * </ul>
+ * @throws javax.xml.ws.WebServiceException If an error occurs while creating the
+ * <code>W3CEndpointReference</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+ public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata,
+ String wsdlDocumentLocation, List<Element> referenceParameters);
+
+ /**
+ * read an EndpointReference from the infoset contained in
+ * <code>eprInfoset</code>.
+ *
+ * @returns the <code>EndpointReference</code> unmarshalled from
+ * <code>eprInfoset</code>. This method never returns <code>null</code>.
+ *
+ * @throws javax.xml.ws.WebServiceException If there is an error creating the
+ * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
+ *
+ * @throws NullPointerException If the <code>null</code>
+ * <code>eprInfoset</code> value is given.
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
}
Modified: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/ServiceDelegate.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/ServiceDelegate.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/ServiceDelegate.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -26,8 +26,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.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.HandlerResolver;
/**
@@ -105,6 +107,163 @@
public abstract <T> T getPort(Class<T> serviceEndpointInterface);
/**
+ * The getPort method returns a proxy. A service client
+ * uses this proxy to invoke operations on the target
+ * service endpoint. The <code>serviceEndpointInterface</code>
+ * specifies the service endpoint interface that is supported by
+ * the created dynamic proxy instance.
+ *
+ * @param portName Qualified name of the service endpoint in
+ * the WSDL service description
+ * @param serviceEndpointInterface Service endpoint interface
+ * supported by the dynamic proxy or instance
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that
+ * supports the specified service endpoint
+ * interface
+ * @throws javax.xml.ws.WebServiceException This exception is thrown in the
+ * following cases:
+ * <UL>
+ * <LI>If there is an error in creation of
+ * the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * or <code>portName</code> is specified
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ * @see java.lang.reflect.Proxy
+ * @see java.lang.reflect.InvocationHandler
+ * @see javax.xml.ws.WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(QName portName,
+ Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ /**
+ * The getPort method returns a proxy.
+ * The parameter <code>endpointReference</code> specifies the
+ * endpoint that will be invoked by the returned proxy. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * The returned proxy should not be reconfigured by the client.
+ * If this <code>Service</code> instance has a known proxy
+ * port that matches the information contained in
+ * the WSDL,
+ * then that proxy is returned, otherwise a WebServiceException
+ * is thrown.
+ * <p>
+ * Calling this method has the same behavior as the following
+ * <pre>
+ * port = service.getPort(portName, serviceEndpointInterface);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpontName</code> attribute of the
+ * <code>wsaw:ServiceName</code> element in the
+ * metadata of the <code>endpointReference</code> or from the
+ * <code>serviceEndpointInterface</code> and the WSDL
+ * associated with this <code>Service</code> instance.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned proxy.
+ * @param serviceEndpointInterface Service endpoint interface.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface.
+ * @throws javax.xml.ws.WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy.
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <LI>If the <code>wsaw:EndpointName</code> is
+ * missing from the <code>endpointReference</code>
+ * or does not match a wsdl:Port
+ * in the WSDL metadata.
+ * <LI>If the <code>wsaw:ServiceName</code> in the
+ * <code>endpointReference</code> metadata does not
+ * match the <code>serviceName</code> of this
+ * <code>Service</code> instance.
+ * <LI>If an invalid
+ * <code>endpointReference</code>
+ * is specified.
+ * <LI>If an invalid
+ * <code>serviceEndpointInterface</code>
+ * is specified.
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(EndpointReference endpointReference,
+ Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ /**
+ * The getPort method returns a proxy. The parameter
+ * <code>serviceEndpointInterface</code> specifies the service
+ * endpoint interface that is supported by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly.
+ * The returned proxy should not be reconfigured by the client.
+ *
+ * @param serviceEndpointInterface Service endpoint interface
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object instance that supports the
+ * specified service endpoint interface
+ * @throws javax.xml.ws.WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified
+ * <LI>If a feature is enabled that is not compatible
+ * with this port or is unsupported.
+ * </UL>
+ *
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(Class<T> serviceEndpointInterface,
+ WebServiceFeature... features);
+
+ /**
* Creates a new port for the service. Ports created in this way contain
* no WSDL port type information and can only be used for creating
* <code>Dispatch</code>instances.
@@ -166,6 +325,223 @@
public abstract Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode);
/**
+ * Creates a <code>Dispatch</code> instance for use with objects of
+ * the users choosing.
+ *
+ * @param portName Qualified name for the target service endpoint
+ * @param type The class of object used for messages or message
+ * payloads. Implementations are required to support
+ * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
+ * when type is SOAPMessage.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws javax.xml.ws.WebServiceException If any error in the creation of
+ * the <code>Dispatch</code> object or if a
+ * feature is enabled that is not compatible with
+ * this port or is unsupported.
+ *
+ * @see javax.xml.transform.Source
+ * @see javax.xml.soap.SOAPMessage
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
+ Service.Mode mode, WebServiceFeature... features);
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with objects of
+ * the users choosing. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the dispatch accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * <p>
+ * This method behaves the same as calling
+ * <pre>
+ * dispatch = service.createDispatch(portName, type, mode, features);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
+ * element in the
+ * metadata of the <code>endpointReference</code>.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned <code>Dispatch</code> object.
+ * @param type The class of object used to messages or message
+ * payloads. Implementations are required to support
+ * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
+ * when type is SOAPMessage.
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws javax.xml.ws.WebServiceException
+ * <UL>
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method.
+ * <li>If the <code>wsaw:ServiceName</code> element
+ * or the <code>wsaw:EndpointName</code> attribute
+ * is missing in the metdata of the
+ * <code>endpointReference</code>.
+ * <li>If the <code>wsaw:ServiceName</code> does not
+ * match the <code>serviceName</code> of this instance.
+ * <li>If the <code>wsaw:EndpointName</code> does not
+ * match a valid wsdl:Port in the WSDL metadata.
+ * <li>If any error in the creation of
+ * the <code>Dispatch</code> object.
+ * <li>if a feature is enabled that is not
+ * compatible with this port or is unsupported.
+ * </UL>
+ *
+ * @see javax.xml.transform.Source
+ * @see javax.xml.soap.SOAPMessage
+ * @see WebServiceFeature;
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
+ Class<T> type, Service.Mode mode,
+ WebServiceFeature... features);
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with JAXB
+ * generated objects.
+ *
+ * @param portName Qualified name for the target service endpoint
+ * @param context The JAXB context used to marshall and unmarshall
+ * messages or message payloads.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body.
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws javax.xml.ws.WebServiceException If any error in the creation of
+ * the <code>Dispatch</code> object or if a
+ * feature is enabled that is not compatible with
+ * this port or is unsupported.
+ *
+ * @see javax.xml.bind.JAXBContext
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract Dispatch<Object> createDispatch(QName portName,
+ JAXBContext context, Service.Mode mode, WebServiceFeature... features);
+
+ /**
+ * Creates a <code>Dispatch</code> instance for use with JAXB
+ * generated objects. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The <code>endpointReference's</code> address MUST be used
+ * for invocations on the endpoint.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the dispatch accordingly from
+ * the WSDL associated with this <code>Service</code> instance or
+ * from the WSDL Metadata from the <code>endpointReference</code>.
+ * If this <code>Service</code> instance has a WSDL and
+ * the <code>endpointReference</code>
+ * also has a WSDL, then the WSDL from this instance will be used.
+ * If this <code>Service</code> instance does not have a WSDL and
+ * the <code>endpointReference</code> does have a WSDL, then the
+ * WSDL from the <code>endpointReference</code> will be used.
+ * <p>
+ * This method behavies the same as calling
+ * <pre>
+ * dispatch = service.createDispatch(portName, context, mode, features);
+ * </pre>
+ * where the <code>portName</code> is retrieved from the
+ * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
+ * element in the
+ * metadata of the <code>endpointReference</code>.
+ * <br>
+ * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
+ * </a>.
+ *
+ * @param endpointReference The <code>EndpointReference</code>
+ * for the target service endpoint that will be invoked by the
+ * returned <code>Dispatch</code> object.
+ * @param context The JAXB context used to marshall and unmarshall
+ * messages or message payloads.
+ * @param mode Controls whether the created dispatch instance is message
+ * or payload oriented, i.e. whether the user will work with complete
+ * protocol messages or message payloads. E.g. when using the SOAP
+ * protocol, this parameter controls whether the user will work with
+ * SOAP messages or the contents of a SOAP body.
+ * @param features An array of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ *
+ * @return Dispatch instance
+ * @throws javax.xml.ws.WebServiceException
+ * @throws javax.xml.ws.WebServiceException
+ * <UL>
+ * <li>If there is any missing WSDL metadata
+ * as required by this method.
+ * <li>If the <code>wsaw:ServiceName</code> element
+ * or the <code>wsaw:EndpointName</code> attribute
+ * is missing in the metdata of the
+ * <code>endpointReference</code>.
+ * <li>If the <code>wsaw:ServiceName</code> does not
+ * match the <code>serviceName</code> of this instance.
+ * <li>If the <code>wsaw:EndpointName</code> does not
+ * match a valid wsdl:Port in the WSDL metadata.
+ * <li>If any error in the creation of
+ * the <code>Dispatch</code> object.
+ * <li>if a feature is enabled that is not
+ * compatible with this port or is unsupported.
+ * </UL>
+ *
+ * @see javax.xml.bind.JAXBContext
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference,
+ JAXBContext context, Service.Mode mode,
+ WebServiceFeature... features);
+
+ /**
* Gets the name of this service.
* @return Qualified name of this service
**/
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.spi;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * Annotation used to identify other annotations
+ * as a <code>WebServiceFeature</code>.
+ *
+ * Each <code>WebServiceFeature</code> annotation annotated with
+ * this annotation MUST contain an
+ * <code>enabled</code> property of type
+ * <code>boolean</code> with a default value of <code>true</code>.
+ * JAX-WS defines the following
+ * <code>WebServiceFeature</code> annotations, however, an implementation
+ * may define vendors specific annotations for other features.
+ * If a JAX-WS implementation encounters an annotation annotated
+ * with the <code>WebServiceFeatureAnnotation</code> that is does not
+ * recognize/support an error MUST be given.
+ *
+ * @see javax.xml.ws.soap.WSAddressing
+ * @see javax.xml.ws.soap.MTOM
+ * @see javax.xml.ws.RespectBinding
+ *
+ * @since JAX-WS 2.1
+ */
+(a)Target(ElementType.ANNOTATION_TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface WebServiceFeatureAnnotation {
+ /**
+ * Unique identifier for the WebServiceFeature. This
+ * identifier MUST be unique across all implementations
+ * of JAX-WS.
+ */
+ String id();
+
+ /**
+ * The <code>WebServiceFeature</code> bean that is associated
+ * with the <code>WebServiceFeature</code> annotation
+ */
+ Class<? extends WebServiceFeature> bean();
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,306 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.wsaddressing;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * This class represents a W3C Addressing EndpointReferece which is
+ * a remote reference to a web service endpoint that supports the
+ * W3C WS-Addressing 1.0 - Core Recommendation.
+ * <p>
+ * Developers should use this class in their SEIs if they want to
+ * pass/return endpoint references that represent the W3C WS-Addressing
+ * recommendation.
+ * <p>
+ * JAXB will use the JAXB annotations and bind this class to XML infoset
+ * that is consistent with that defined by WS-Addressing. See
+ * <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
+ * WS-Addressing</a>
+ * for more information on WS-Addressing EndpointReferences.
+ *
+ * @since JAX-WS 2.1
+ */
+
+// XmlRootElement allows this class to be marshalled on its own
+@XmlRootElement(name = "EndpointReference", namespace = W3CEndpointReference.NS)
+@XmlType(name = "EndpointReferenceType", namespace = W3CEndpointReference.NS)
+public final class W3CEndpointReference extends EndpointReference
+{
+ protected static final String NS = "http://www.w3.org/2005/08/addressing";
+
+ private final static JAXBContext w3cjc = getW3CJaxbContext();
+
+ // private but necessary properties for databinding
+ @XmlElement(name = "Address", namespace = NS)
+ private Address address;
+ @XmlElement(name = "ReferenceParameters", namespace = NS)
+ private Elements referenceParameters;
+ @XmlElement(name = "Metadata", namespace = NS)
+ private Elements metadata;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+ @XmlAnyElement
+ List<Element> elements;
+
+ // not marshalled
+ private QName serviceName;
+ private QName endpointName;
+ private URL wsdlLocation;
+
+ protected W3CEndpointReference()
+ {
+ }
+
+ /**
+ * Creates an EPR from infoset representation
+ *
+ * @param source A source object containing valid XmlInfoset
+ * instance consistent with the W3C WS-Addressing Core
+ * recommendation.
+ *
+ * @throws WebServiceException
+ * If the source does NOT contain a valid W3C WS-Addressing
+ * EndpointReference.
+ * @throws NullPointerException
+ * If the <code>null</code> <code>source</code> value is given
+ */
+ public W3CEndpointReference(Source source)
+ {
+ try
+ {
+ W3CEndpointReference epr = w3cjc.createUnmarshaller().unmarshal(source, W3CEndpointReference.class).getValue();
+ this.address = epr.address;
+ this.metadata = epr.metadata;
+ this.referenceParameters = epr.referenceParameters;
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error unmarshalling W3CEndpointReference ", e);
+ }
+ catch (ClassCastException e)
+ {
+ throw new WebServiceException("Source did not contain W3CEndpointReference", e);
+ }
+ }
+
+ @XmlTransient
+ public String getAddress()
+ {
+ return address != null ? address.getUri() : null;
+ }
+
+ void setAddress(String address)
+ {
+ this.address = new Address(address);
+ }
+
+ @XmlTransient
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setServiceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ @XmlTransient
+ public QName getEndpointName()
+ {
+ return endpointName;
+ }
+
+ public void setEndpointName(QName endpointName)
+ {
+ this.endpointName = endpointName;
+ }
+
+ @XmlTransient
+ public List<Element> getMetadata()
+ {
+ return metadata != null ? metadata.getElements() : null;
+ }
+
+ public void setMetadata(List<Element> metadata)
+ {
+ this.metadata = new Elements(metadata);
+ }
+
+ @XmlTransient
+ public URL getWsdlLocation()
+ {
+ return wsdlLocation;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ try
+ {
+ this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
+ }
+ }
+
+ @XmlTransient
+ public List<Element> getReferenceParameters()
+ {
+ return referenceParameters != null ? referenceParameters.getElements() : null;
+ }
+
+ public void setReferenceParameters(List<Element> metadata)
+ {
+ this.referenceParameters = new Elements(metadata);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeTo(Result result)
+ {
+ try
+ {
+ Marshaller marshaller = w3cjc.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+ marshaller.marshal(this, result);
+ }
+ catch (JAXBException e)
+ {
+ throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
+ }
+ }
+
+ private static JAXBContext getW3CJaxbContext()
+ {
+ try
+ {
+ return JAXBContext.newInstance(new Class[] { W3CEndpointReference.class });
+ }
+ catch (JAXBException ex)
+ {
+ throw new WebServiceException("Cannot obtain JAXB context", ex);
+ }
+ }
+
+ private static class Address
+ {
+ @XmlValue
+ String uri;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Address()
+ {
+ }
+
+ public Address(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+
+ private static class Elements
+ {
+ @XmlAnyElement
+ List<Element> elements;
+ @XmlAnyAttribute
+ Map<QName, String> attributes;
+
+ protected Elements()
+ {
+ }
+
+ public Elements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public List<Element> getElements()
+ {
+ return elements;
+ }
+
+ public void setElements(List<Element> elements)
+ {
+ this.elements = elements;
+ }
+
+ @XmlTransient
+ public Map<QName, String> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(Map<QName, String> attributes)
+ {
+ this.attributes = attributes;
+ }
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java (rev 0)
+++ stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -0,0 +1,272 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package javax.xml.ws.wsaddressing;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * This class is used to build <code>W3CEndpointReference</code>
+ * instances. The intended use of this clsss is for
+ * an application component, for example a factory component,
+ * to create an <code>W3CEndpointReference</code> for a
+ * web service endpoint published by the same
+ * Java EE application. It can also be used to create
+ * <code>W3CEndpointReferences</code> for an Java SE based
+ * endpoint by providing the <code>address</code> property.
+ * <p>
+ * When creating a <code>W3CEndpointReference</code> for an
+ * endpoint that is not published by the same Java EE application,
+ * the <code>address</code> property MUST be specified.
+ * <p>
+ * When creating a <code>W3CEndpointReference</code> for an endpoint
+ * published by the same Java EE application, the <code>address</code>
+ * property MAY be <code>null</code> but then the <code>serviceName</code>
+ * and <code>endpointName</code> MUST specify an endpoint published by
+ * the same Java EE application.
+ * <p>
+ * When the <code>wsdlDocumentLocation</code> is specified it MUST refer
+ * to a valid WSDL document and the <code>serviceName</code> and
+ * <code>endpointName</code> (if specified) MUST match a service and port
+ * in the WSDL document.
+ *
+ * @since JAX-WS 2.1
+ */
+public final class W3CEndpointReferenceBuilder
+{
+
+ private String address;
+ private List<Element> parameters;
+ private List<Element> metadata;
+ private QName serviceName;
+ private QName endpointName;
+ private String wsdlLocation;
+
+ public W3CEndpointReferenceBuilder()
+ {
+ parameters = new ArrayList<Element>();
+ metadata = new ArrayList<Element>();
+ }
+
+ /**
+ * Sets the <code>address</code> to the
+ * <code>W3CEndpointReference</code> instance's
+ * <code>wsa:Address</code>.
+ * <p>
+ * The <code>address</code> MUST be set to a non-<code>null</code>
+ * value when building a <code>W3CEndpointReference</code> for a
+ * web service endpoint that is not published by the same
+ * Java EE application or when running on Java SE.
+ *
+ * @param address The address of the endpoint to be targeted
+ * by the returned <code>W3CEndpointReference<code>.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>address</code> set to the <code>wsa:Address</code>.
+ */
+ public W3CEndpointReferenceBuilder address(String address)
+ {
+ this.address = address;
+ return this;
+ }
+
+ /**
+ * Sets the <code>serviceName</code> as the
+ * <code>wsaw:ServiceName</code> element in the
+ * <code>wsa:Metadata</code> element.
+ *
+ * @param serviceName The service name of the endpoint to be targeted
+ * by the returned <code>W3CEndpointReference<code>. This property
+ * may also be used with the <code>endpointName</code> (portName)
+ * property to lookup the <code>address</code> of a web service
+ * endpoint that is published by the same Java EE application.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>serviceName</code> element added to the
+ * <code>wsa:Metadata</code> element.
+ *
+ */
+ public W3CEndpointReferenceBuilder serviceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ return this;
+ }
+
+ /**
+ * Sets the <code>endpointName</code> as and attribute on
+ * <code>wsaw:ServiceName</code> element in the
+ * <code>wsa:Metadata</code> element. This method can only
+ * be called after the {@link #serviceName} method has been called.
+ *
+ * @param endpointName The name of the endpoint to be targeted
+ * by the returned <code>W3CEndpointReference<code>. The
+ * <code>endpointName</code> (portName) property may also be
+ * used with the <code>serviceName</code> property to lookup
+ * the <code>address</code> of a web service
+ * endpoint published by the same Java EE application.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>endpointName</code> atrribute added to the
+ * <code>wsaw:ServiceName</code> element in the
+ * <code>wsa:Metadata</code> element.
+ *
+ * @throws javax.lang.IllegalStateException If the <code>serviceName</code> has not
+ * been set.
+ */
+ public W3CEndpointReferenceBuilder endpointName(QName endpointName)
+ {
+ if (serviceName == null)
+ {
+ throw new IllegalStateException("The W3CEndpointReferenceBuilder's serviceName must be set before setting the endpointName: " + endpointName);
+ }
+
+ this.endpointName = endpointName;
+ return this;
+ }
+
+ /**
+ * Sets the <code>wsdlDocumentLocation</code> that will be inlined
+ * in the <code>W3CEndpointReferenc</code> instance's
+ * <code>wsa:Metadata</code>.
+ *
+ * @param wsdlDocumentLocation The location of the WSDL document to
+ * be inlined in the <code>wsa:Metadata</code> of the
+ * <code>W3CEndpointReference<code>.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>wsdlDocumentLocation</code> that is to be inlined.
+ *
+ */
+ public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation)
+ {
+ this.wsdlLocation = wsdlDocumentLocation;
+ return this;
+ }
+
+ /**
+ * Adds the <code>referenceParameter</code> to the
+ * <code>W3CEndpointReference</code> instance
+ * <code>wsa:ReferenceParameters</code> element.
+ *
+ * @param referenceParameter The element to be added to the
+ * <code>wsa:ReferenceParameters</code> element.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>referenceParameter</code> added to the
+ * <code>wsa:ReferenceParameters</code> element.
+ *
+ * @throws java.lang.IllegalArgumentException if <code>referenceParameter</code>
+ * is <code>null</code>.
+ */
+ public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)
+ {
+ if (referenceParameter == null)
+ throw new java.lang.IllegalArgumentException("The referenceParameter cannot be null.");
+ parameters.add(referenceParameter);
+ return this;
+ }
+
+ /**
+ * Adds the <code>metadataElement</code> to the
+ * <code>W3CEndpointReference</code> instance's
+ * <code>wsa:Metadata</code> element.
+ *
+ * @param metadataElement The element to be added to the
+ * <code>wsa:Metadata</code> element.
+ *
+ * @return A <code>W3CEndpointReferenceBuilder</code> instance with
+ * the <code>metadataElement</code> added to the
+ * <code>wsa:Metadata</code> element.
+ *
+ * @throws java.lang.IllegalArgumentException if <code>metadataElement</code>
+ * is <code>null</code>.
+ */
+ public W3CEndpointReferenceBuilder metadata(Element metadataElement)
+ {
+ if (metadataElement == null)
+ throw new java.lang.IllegalArgumentException("The metadataElement cannot be null.");
+ metadata.add(metadataElement);
+ return this;
+ }
+
+ /**
+ * Builds a <code>W3CEndpointReference</code> from the accumulated
+ * properties set on this <code>W3CEndpointReferenceBuilder</code>
+ * instance.
+ * <p>
+ * This method can be used to create a <code>W3CEndpointReference</code>
+ * for any endpoint by specifying the <code>address</code> property along
+ * with any other desired properties. This method
+ * can also be used to create a <code>W3CEndpointReference</code> for
+ * an endpoint that is published by the same Java EE application.
+ * This method can automatically determine the <code>address</code> of
+ * an endpoint published by the same Java EE application that is identified by the
+ * <code>serviceName</code> and
+ * <code>endpointName</code> properties. If the <code>address</code> is
+ * <code>null</code> and the <code>serviceName</code> and
+ * <code>endpointName</code>
+ * do not identify an endpoint published by the same Java EE application, a
+ * <code>javax.lang.IllegalStateException</code> MUST be thrown.
+ *
+ *
+ * @return <code>W3CEndpointReference</code> from the accumulated
+ * properties set on this <code>W3CEndpointReferenceBuilder</code>
+ * instance. This method never returns <code>null</code>.
+ *
+ * @throws javax.lang.IllegalStateException
+ * <ul>
+ * <li>If the <code>address</code>, <code>serviceName</code> and
+ * <code>endpointName</code> are all <code>null</code>.
+ * <li>If the <code>serviceName</code> service is <code>null</code> and the
+ * <code>endpointName</code> is NOT <code>null</code>.
+ * <li>If the <code>address</code> property is <code>null</code> and
+ * the <code>serviceName</code> and <code>endpointName</code> do not
+ * specify a valid endpoint published by the same Java EE
+ * application.
+ * <li>If the <code>serviceName</code>is NOT <code>null</code>
+ * and is not present in the specified WSDL.
+ * <li>If the <code>endpointName</code> port is not <code>null<code> and it
+ * is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code> Pr
+ * and does not represent a valid WSDL.
+ * </ul>
+ * @throws WebServiceException If an error occurs while creating the
+ * <code>W3CEndpointReference</code>.
+ *
+ */
+ public W3CEndpointReference build()
+ {
+ W3CEndpointReference epr = new W3CEndpointReference();
+ epr.setAddress(address);
+ epr.setServiceName(serviceName);
+ epr.setEndpointName(endpointName);
+ epr.setMetadata(metadata);
+ epr.setWsdlLocation(wsdlLocation);
+ epr.setReferenceParameters(parameters);
+ return epr;
+ }
+}
Property changes on: stack/native/branches/jaxws21/modules/jaxws/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Action.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Action.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Action.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,142 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * The <code>Action</code> annotation allows explicit association of <code>Action</code>
- * message addressing property with <code>input</code>, <code>output</code>, and
- * <code>fault</code> messages of the mapped WSDL operation.
- * <p>
- * This annotation can be specified on each method of a service endpoint interface.
- * For such a method, the mapped operation in the generated WSDL
- * contains explicit <code>wsaw:Action</code> attribute on the WSDL <code>input</code>,
- * <code>output</code> and <code>fault</code> messages of the WSDL <code>operation</code>
- * based upon which attributes of the <code>Action</code> annotation have been specified.
- * <p>
- * <b>Example 1</b>: Specify explicit values for <code>Action</code> message addressing property
- * for <code>input</code> and <code>output</code> messages.
- *
- * <pre>
- * @javax.jws.WebService
- * public class AddNumbersImpl {
- * @javax.xml.ws.Action(
- * input="http://example.com/inputAction",
- * output="http://example.com/outputAction")
- * public int addNumbers(int number1, int number2) {
- * return number1 + number2;
- * }
- * }
- * </pre>
- *
- * The generated WSDL looks like:
- * <pre>
- * <definitions targetNamespace="http://example.com/numbers" ...>
- * ...
- * <portType name="AddNumbersPortType">
- * <operation name="AddNumbers">
- * <input message="tns:AddNumbersInput" name="Parameters"
- * wsaw:Action="http://example.com/inputAction"/>
- * <output message="tns:AddNumbersOutput" name="Result"
- * wsaw:Action="http://example.com/outputAction"/>
- * </operation>
- * <portType>
- * ...
- * <definitions>
- * </pre>
- *
- * <p>
- * <b>Example 2</b>: Specify explicit value for <code>Action</code> message addressing property
- * for only the <code>input</code> message. The default values are used for the
- * <code>output</code> message.
- *
- * <pre>
- * @javax.jws.WebService
- * public class AddNumbersImpl {
- * @javax.xml.ws.Action(input="http://example.com/inputAction")
- * public int addNumbers(int number1, int number2) {
- * return number1 + number2;
- * }
- * }
- * </pre>
- *
- * The generated WSDL looks like:
- *
- * <pre>
- * <definitions targetNamespace="http://example.com/numbers" ...>
- * ...
- * <portType name="AddNumbersPortType">
- * <operation name="AddNumbers">
- * <input message="tns:AddNumbersInput" name="Parameters"
- * wsaw:Action="http://example.com/inputAction"/>
- * <output message="tns:AddNumbersOutput" name="Result"/>
- * </operation>
- * <portType>
- * ...
- * <definitions>
- * </pre>
- *
- * It is legitimate to specify an explicit value for <code>Action</code> message addressing property for
- * <code>output</code> message only. In this case, a default value of <code>wsaw:Action</code> is used
- * for the <code>input</code> message.
- *
- * <p>
- * <b>Example 3</b>: See <a href="FaultAction.html">FaultAction</a> annotation for an example of
- * how to specify an explicit value for <code>Action</code> message addressing property for the
- * <code>fault</code> message.
- *
- * @see FaultAction
- *
- * @since JAX-WS 2.1
- */
-
-@Documented
-(a)Retention(RetentionPolicy.RUNTIME)
-(a)Target(ElementType.METHOD)
-public @interface Action {
- /**
- * Explicit value of <code>Action</code> message addressing property for the <code>input</code>
- * message of the operation. If the value is "", then no <code>wsaw:Action</code>
- * is generated.
- */
- String input() default "";
-
- /**
- * Explicit value of <code>Action</code> message addressing property for the <code>output</code>
- * message of the operation. If the value is "", then no <code>wsaw:Action</code>
- * is generated.
- */
- String output() default "";
-
- /**
- * Explicit value of <code>Action</code> message addressing property for the <code>fault</code>
- * message(s) of the operation. Each exception that is mapped to a fault and requires explicit
- * <code>Action</code> message addressing property, need to be specified as a value in this property
- * using <a href="FaultAction.html">FaultAction</a> annotation.
- */
- FaultAction[] fault() default {};
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Binding21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Binding21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Binding21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public interface Binding21 extends Binding
-{
- /**
- * Get the URI for this binding instance.
- *
- * @return String The binding identifier for the port.
- * Never returns <code>null</code>
- *
- * @since JAX-WS 2.1
- */
- String getBindingID();
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Endpoint21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Endpoint21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Endpoint21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import org.w3c.dom.Element;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public abstract class Endpoint21 extends Endpoint
-{
- /**
- * Returns the <code>EndpointReference</code> associated with
- * this <code>Endpoint</code> instance.
- * <p>
- * If the Binding for this <code>bindingProvider</code> is
- * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
- * <code>W3CEndpointReference</code> MUST be returned.
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- * @return EndpointReference of this <code>Endpoint</code> instance.
- * If the returned <code>EndpointReference</code> is of type
- * <code>W3CEndpointReference</code> then it MUST contain the
- * the specified <code>referenceParameters</code>.
-
- * @throws WebServiceException If any error in the creation of
- * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
- * not in the published state.
- * @throws UnsupportedOperationException If this <code>BindingProvider</code>
- * uses the XML/HTTP binding.
- *
- * @see javax.xml.ws.wsaddressing.W3CEndpointReference
- *
- * @since JAX-WS 2.1
- **/
- public abstract EndpointReference getEndpointReference(Element... referenceParameters);
-
- /**
- * Returns the <code>EndpointReference</code> associated with
- * this <code>Endpoint</code> instance.
- * <p>
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- * @return EndpointReference of type <code>clazz</code> of this
- * <code>Endpoint<code> instance.
- * If the returned <code>EndpointReference</code> is of type
- * <code>W3CEndpointReference</code> then it MUST contain the
- * the specified <code>referenceParameters</code>.
-
- * @throws WebServiceException If any error in the creation of
- * the <code>EndpointReference</code> or if the <code>Endpoint</code> is
- * not in the published state or if the <code>clazz</code> is not a supported
- * <code>EndpointReference</code> type.
- * @throws UnsupportedOperationException If this <code>BindingProvider</code>
- * uses the XML/HTTP binding.
- *
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters);
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/EndpointReference.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/EndpointReference.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/EndpointReference.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import java.io.StringWriter;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.ws.spi.Provider;
-import javax.xml.ws.spi.Provider21;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-
-/**
- * This class represents an WS-Addressing EndpointReference
- * which is a remote reference to a web service endpoint.
- * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
- * WS-Addressing</a>
- * for more information on WS-Addressing EndpointReferences.
- * <p>
- * This class is immutable as the typical web service developer
- * need not be concerned with its contents. The web service
- * developer should use this class strictly as a mechanism to
- * reference a remote web service endpoint. See the {@link Service} APIs
- * that clients can use to that utilize an <code>EndpointReference</code>.
- * See the {@link javax.xml.ws.Endpoint}, and
- * {@link javax.xml.ws.BindingProvider} APIs on how
- * <code>EndpointReferences</code> can be created for published
- * endpoints.
- * <p>
- * Concrete implementations of this class will represent
- * an <code>EndpointReference</code> for a particular version of Addressing.
- * For example the {@link W3CEndpointReference} is for use
- * with W3C WS-Addressing 1.0 - Core Recommendation.
- * If JAX-WS implementors need to support different versions
- * of addressing, they should write their own
- * <code>EndpointReference</code> subclass for that version.
- * This will allow a JAX-WS implementation to createEndpointReference
- * vendor specific <code>EndpointReferences</code> that that
- * vendor can use to flag a different version of
- * addressing.
- * <p>
- * Web service developers that wish to pass or return
- * <code>EndpointReferences</code> in Java methods in an
- * SEI should use
- * concrete instances of an <code>EndpointReference</code> such
- * as the <code>W3CEndpointReferendce</code>. This way the
- * schema mapped from the SEI will be more descriptive of the
- * type of endpoint reference being passed.
- * <p>
- * JAX-WS implementors are expected to extract the XML infoset
- * from an <CODE>EndpointReferece</CODE> using the
- * <code>{@link EndpointReference#writeTo}</code>
- * method.
- * <p>
- * JAXB will bind this class to xs:anyType. If a better binding
- * is desired, web services developers should use a concrete
- * subclass such as {@link W3CEndpointReference}.
- *
- * @see W3CEndpointReference
- * @see Service
- * @since JAX-WS 2.1
- */
-//@XmlTransient // to treat this class like Object as far as databinding is concerned (proposed JAXB 2.1 feature)
-public abstract class EndpointReference
-{
- //
- //Default constructor to be only called by derived types.
- //
- protected EndpointReference()
- {
- };
-
- /**
- * Factory method to read an EndpointReference from the infoset contained in
- * <code>eprInfoset</code>. This method delegates to the vendor specific
- * implementation of the {@link javax.xml.ws.spi.Provider#readEndpointReference} method.
- *
- * @param eprInfoset The <code>EndpointReference<code> infoset to be unmarshalled
- *
- * @return the EndpointReference unmarshalled from <code>eprInfoset</code>
- * never <code>null</code>
- * @throws WebServiceException
- * if an error occurs while creating the
- * <code>EndpointReference</code> from the <CODE>eprInfoset</CODE>
- * @throws java.lang.IllegalArgumentException
- * if the null <code>eprInfoset</tt> value is given.
- */
- public static EndpointReference readFrom(Source eprInfoset)
- {
- return ((Provider21)Provider.provider()).readEndpointReference(eprInfoset);
- }
-
- /**
- * write this EndpointReference to the specified infoset format
- * @throws WebServiceException
- * if there is an error writing the
- * EndpointReference to the specified <code>result</code>.
- *
- * @throws java.lang.IllegalArgumentException
- * If the null <code>result</tt> value is given.
- */
- public abstract void writeTo(Result result);
-
- /**
- * The getPort method returns a proxy. If there
- * are any reference parameters in the
- * <code>EndpointReference</code> instance, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * The <code>EndpointReference</code> instance specifies the
- * endpoint that will be invoked by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL Metadata from this <code>EndpointReference</code> or from
- * annotations on the <code>serviceEndpointInterface</code>.
- * <p>
- * Because this port is not created from a Service object, handlers
- * will not automatically be configured, and the HandlerResolver
- * and Executor cannot be get or set for this port. The
- * <code>BindingProvider().getBinding().setHandlerChain()</code>
- * method can be used to manually configure handlers for this port.
- *
- *
- * @param serviceEndpointInterface Service endpoint interface
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface
- * @throws WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If this
- * <code>endpointReference</code>
- * is invalid
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified
- * <LI>If feature is enabled that is not compatible with
- * this port or is unsupported.
- * </UL>
- *
- * @see java.lang.reflect.Proxy
- * @see WebServiceFeature
- **/
- public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return ((Provider21)Provider.provider()).getPort(this, serviceEndpointInterface, features);
- }
-
- /**
- * Displays EPR infoset for debugging convenience.
- */
- public String toString()
- {
- StringWriter w = new StringWriter();
- writeTo(new StreamResult(w));
- return w.toString();
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/FaultAction.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/FaultAction.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/FaultAction.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,169 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * The <code>FaultAction</code> annotation is used inside an <a href="Action.html">
- * Action</a> annotation to allow an explicit association of <code>Action</code> message
- * addressing property with the <code>fault</code> messages of the WSDL operation mapped from
- * the exception class.
- * <p>
- * The <code>fault</code> message in the generated WSDL operation mapped for <code>className</code>
- * class contains explicit <code>wsaw:Action</code> attribute.
- *
- * <p>
- * <b>Example 1</b>: Specify explicit values for <code>Action</code> message addressing
- * property for the <code>input</code>, <code>output</code> and <code>fault</code> message
- * if the Java method throws only one service specific exception.
- *
- * <pre>
- * @javax.jws.WebService
- * public class AddNumbersImpl {
- * @javax.xml.ws.Action(
- * input="http://example.com/inputAction",
- * output="http://example.com/outputAction",
- * fault = {
- * @javax.xml.ws.FaultAction(className=AddNumbersException.class, value="http://example.com/faultAction")
- * })
- * public int addNumbers(int number1, int number2)
- * throws AddNumbersException {
- * return number1 + number2;
- * }
- * }
- * </pre>
- *
- * The generated WSDL looks like:
- *
- * <pre>
- * <definitions targetNamespace="http://example.com/numbers" ...>
- * ...
- * <portType name="AddNumbersPortType">
- * <operation name="AddNumbers">
- * <input message="tns:AddNumbersInput" name="Parameters"
- * wsaw:Action="http://example.com/inputAction"/>
- * <output message="tns:AddNumbersOutput" name="Result"
- * wsaw:Action="http://example.com/outputAction"/>
- * <fault message="tns:AddNumbersException" name="AddNumbersException"
- * wsaw:Action="http://example.com/faultAction"/>
- * </operation>
- * <portType>
- * ...
- * <definitions>
- * </pre>
- *
- * <p>
- * Example 2: Here is an example that shows how to specify explicit values for <code>Action</code>
- * message addressing property if the Java method throws only one service specific exception,
- * without specifying the values for <code>input</code> and <code>output</code> messages.
- *
- * <pre>
- * @javax.jws.WebService
- * public class AddNumbersImpl {
- * @javax.xml.ws.Action(
- * fault = {
- * @javax.xml.ws.FaultAction(className=AddNumbersException.class, value="http://example.com/faultAction")
- * })
- * public int addNumbers(int number1, int number2)
- * throws AddNumbersException {
- * return number1 + number2;
- * }
- * }
- * </pre>
- *
- * The generated WSDL looks like:
- *
- * <pre>
- * <definitions targetNamespace="http://example.com/numbers" ...>
- * ...
- * <portType name="AddNumbersPortType">
- * <operation name="AddNumbers">
- * <input message="tns:AddNumbersInput" name="Parameters"/>
- * <output message="tns:AddNumbersOutput" name="Result"/>
- * <fault message="tns:addNumbersFault" name="InvalidNumbers"
- * wsa:Action="http://example.com/addnumbers/fault"/>
- * </operation>
- * <portType>
- * ...
- * <definitions>
- * </pre>
- *
- * <p>
- * Example 3: Here is an example that shows how to specify explicit values for <code>Action</code>
- * message addressing property if the Java method throws more than one service specific exception.
- *
- * <pre>
- * @javax.jws.WebService
- * public class AddNumbersImpl {
- * @javax.xml.ws.Action(
- * fault = {
- * @javax.xml.ws.FaultAction(className=AddNumbersException.class, value="http://example.com/addFaultAction")
- * @javax.xml.ws.FaultAction(className=TooBigNumbersException.class, value="http://example.com/toobigFaultAction")
- * })
- * public int addNumbers(int number1, int number2)
- * throws AddNumbersException, TooBigNumbersException {
- * return number1 + number2;
- * }
- * }
- * </pre>
- *
- * The generated WSDL looks like:
- *
- * <pre>
- * <definitions targetNamespace="http://example.com/numbers" ...>
- * ...
- * <portType name="AddNumbersPortType">
- * <operation name="AddNumbers">
- * <input message="tns:AddNumbersInput" name="Parameters"/>
- * <output message="tns:AddNumbersOutput" name="Result"/>
- * <fault message="tns:addNumbersFault" name="AddNumbersException"
- * wsa:Action="http://example.com/addnumbers/fault"/>
- * <fault message="tns:tooBigNumbersFault" name="TooBigNumbersException"
- * wsa:Action="http://example.com/toobigFaultAction"/>
- * </operation>
- * <portType>
- * ...
- * <definitions>
- * </pre>
- *
- * @since JAX-WS 2.1
- */
-
-@Documented
-(a)Retention(RetentionPolicy.RUNTIME)
-(a)Target(ElementType.METHOD)
-public @interface FaultAction {
- /**
- * Name of the exception class
- */
- Class className();
-
- /**
- * Value of <code>Action</code> message addressing property for the exception
- */
- String value() default "";
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBinding.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBinding.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBinding.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,105 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import javax.xml.ws.spi.WebServiceFeatureAnnotation;
-
-/**
- * This feature clarifies the use of the <code>wsdl:binding</code>
- * in a JAX-WS runtime.
- * <p>
- * This feature is only useful with web services that have an
- * associated WSDL. Enabling this feature requires that a JAX-WS
- * implementation inspect the <code>wsdl:binding</code> for an
- * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
- * that have the <code>required</code> attribute set to <code>true</code>
- * are understood and are being used.
- * <p>
- * The following describes the affects of this feature with respect
- * to be enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
- * required <code>wsdl:binding</code> extensions are either understood
- * and used by the runtime, or explicitly disabled by the web service
- * application. A web service application can disable a particular
- * extension that has a know <code>WebServiceFeature</code> using
- * either the {@link BindingType#features} element on the server
- * or one of the following methods on the client:
- * <ul>
- * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
- * <li>{@link Service#getPort(Class,WebServiceFeature...)}
- * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
- * <li>{@link Service#createDispatch(QName,Class,
- * Service.Mode mode,WebServiceFeature...)}
- * <li>{@link Service21#createDispatch(EndpointReference,
- * Class,Service.Mode,
- * WebServiceFeature...)}
- * <li>{@link Service#createDispatch(QName,
- * JAXBContext, Service.Mode, WebServiceFeature...)}
- * <li>{@link Service#createDispatch(EndpointReference,
- * JAXBContext, Service.Mode, WebServiceFeature...)}
- * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
- * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
- * generated <code>Service</code>.
- * </ul>
- * The runtime MUST also make sure that binding of
- * SEI parameters/return values respect the <code>wsdl:binding</code>.
- * With this feature enabled, if a required
- * <code>wsdl:binding</code> extension is in the WSDL and it is not
- * supported by a JAX-WS runtime and it has not
- * been explicitly turned off by the web service developer, then
- * that JAX-WS runtime MUST behave appropriately based on whether it is
- * on the client or server:
- * <UL>
- * <li>Client: runtime MUST throw a
- * <code>WebServiceException</code> no sooner than when one of the methods
- * above is invoked but no later than the first invocation of an endpoint
- * operation.
- * <li>throw a WebServiceException and the endpoint MUST fail to start
- * </ul>
- * <li> DISABLED: In this Mode, an implementation may choose whether
- * to inspect the <code>wsdl:binding<code> or not and to what degree
- * the <code>wsdl:binding</code> will be inspected. For example,
- * one implementation may choose to behave as if this feature is enabled,
- * another implementation may only choose to verify the SEI's
- * parameter/return type bindings.
- * </ul>
- *
- * @see javax.xml.ws.RespectBindingFeature
- *
- * @since JAX-WS 2.1
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Documented
-@WebServiceFeatureAnnotation(id = RespectBindingFeature.ID, bean = RespectBindingFeature.class)
-public @interface RespectBinding {
- /**
- * Specifies if this feature is enabled or disabled.
- */
- boolean enabled() default true;
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBindingFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/RespectBindingFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * This feature clarifies the use of the <code>wsdl:binding</code>
- * in a JAX-WS runtime.
- * <p>
- * This feature is only useful with web services that have an
- * associated WSDL. Enabling this feature requires that a JAX-WS
- * implementation inspect the <code>wsdl:binding</code> for an
- * endpoint at runtime to make sure that all <code>wsdl:extensions</code>
- * that have the <code>required</code> attribute set to <code>true</code>
- * are understood and are being used.
- * <p>
- * The following describes the affects of this feature with respect
- * to be enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, a JAX-WS runtime MUST assure that all
- * required <code>wsdl:binding</code> extensions are either understood
- and used by the runtime, or explicitly disabled by the web service
- * application. A web service application can disable a particular
- * extension that has a know <code>WebServiceFeature</code> using
- * either the {@link BindingType#features} element on the server
- * or one of the following methods on the client:
- * <ul>
- * <li>{@link Service#getPort(QName,Class,WebServiceFeature...)}
- * <li>{@link Service#getPort(Class,WebServiceFeature...)}
- * <li>{@link Service#getPort(EndpointReference,Class,WebServiceFeature...)}
- * <li>{@link Service#createDispatch(QName,Class,
- * Service.Mode mode,WebServiceFeature...)}
- * <li>{@link Service21#createDispatch(EndpointReference,
- * Class,Service.Mode,
- * WebServiceFeature...)}
- * <li>{@link Service#createDispatch(QName,
- * JAXBContext, Service.Mode, WebServiceFeature...)}
- * <li>{@link Service#createDispatch(EndpointReference,
- * JAXBContext, Service.Mode, WebServiceFeature...)}
- * <li>{@link EndpointReference#getPort(Class,WebServiceFeature...)}
- * <li>One of the <code>getXXXPort(WebServiceFeatures...)</code> methods on a
- * generated <code>Service</code>.
- * </ul>
- * The runtime MUST also make sure that binding of
- * SEI parameters/return values respect the <code>wsdl:binding</code>.
- * With this feature enabled, if a required
- * <code>wsdl:binding</code> extension is in the WSDL and it is not
- * supported by a JAX-WS runtime and it has not
- * been explicitly turned off by the web service developer, then
- * that JAX-WS runtime MUST behave appropriately based on whether it is
- * on the client or server:
- * <UL>
- * <li>Client: runtime MUST throw a
- * <code>WebServiceException</code> no sooner than when one of the methods
- * above is invoked but no later than the first invocation of an endpoint
- * operation.
- * <li>throw a WebServiceException and the endpoint MUST fail to start
- * </ul>
- * <li> DISABLED: In this Mode, an implementation may choose whether
- * to inspect the <code>wsdl:binding<code> or not and to what degree
- * the <code>wsdl:binding</code> will be inspected. For example,
- * one implementation may choose to behave as if this feature is enabled,
- * another implementation may only choose to verify the SEI's
- * parameter/return type bindings.
- * </ul>
- *
- * @see javax.xml.ws.soap.AddressingFeature
- *
- * @since JAX-WS 2.1
- */
-public final class RespectBindingFeature extends WebServiceFeature
-{
- /**
- *
- * Constant value identifying the RespectBindingFeature
- */
- public static final String ID = "javax.xml.ws.InspectBindingFeature";
-
- /**
- * Create an <code>RespectBindingFeature</code>.
- * The instance created will be enabled.
- */
- public RespectBindingFeature()
- {
- this.enabled = true;
- }
-
- /**
- * Create an RespectBindingFeature
- *
- * @param enabled specifies whether this feature should
- * be enabled or not.
- */
- public RespectBindingFeature(boolean enabled)
- {
- this.enabled = enabled;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getID()
- {
- return ID;
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Service21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Service21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/Service21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,455 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.spi.ServiceDelegate21;
-import javax.xml.bind.JAXBContext;
-import java.net.URL;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public class Service21 extends Service
-{
-
- protected Service21(URL wsdlDocumentLocation, QName serviceName)
- {
- super(wsdlDocumentLocation, serviceName);
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * The specified WSDL document location and service qualified name MUST
- * uniquely identify a <code>wsdl:service</code> element.
- *
- * @param wsdlLocation URL for the WSDL document location
- * for the service
- * @param serviceName QName for the service
- * @throws WebServiceException If any error in creation of the
- * specified service.
- **/
- public static Service21 create(URL wsdlLocation, QName serviceName)
- {
- return new Service21(wsdlLocation, serviceName);
- }
-
- /**
- * Create a <code>Service</code> instance.
- *
- * @param serviceName QName for the service
- * @throws WebServiceException If any error in creation of the
- * specified service
- */
- public static Service21 create(QName serviceName)
- {
- return create(null, serviceName);
- }
-
- /**
- * Creates a <code>Dispatch</code> instance for use with objects of
- * the users choosing. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the dispatch accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * <p>
- * This method behaves the same as calling
- * <pre>
- * dispatch = service.createDispatch(portName, type, mode, features);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
- * element in the
- * metadata of the <code>endpointReference</code>.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned <code>Dispatch</code> object.
- * @param type The class of object used to messages or message
- * payloads. Implementations are required to support
- * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
- * when type is SOAPMessage.
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws WebServiceException
- * <UL>
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <li>If the <code>wsaw:ServiceName</code> element
- * or the <code>wsaw:EndpointName</code> attribute
- * is missing in the metdata of the
- * <code>endpointReference</code>.
- * <li>If the <code>wsaw:ServiceName</code> does not
- * match the <code>serviceName</code> of this instance.
- * <li>If the <code>wsaw:EndpointName</code> does not
- * match a valid wsdl:Port in the WSDL metadata.
- * <li>If any error in the creation of
- * the <code>Dispatch</code> object.
- * <li>if a feature is enabled that is not
- * compatible with this port or is unsupported.
- * </UL>
- *
- * @see javax.xml.transform.Source
- * @see javax.xml.soap.SOAPMessage
- * @see WebServiceFeature;
- *
- * @since JAX-WS 2.1
- **/
- public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).createDispatch(endpointReference, type, mode, features);
- }
-
- /**
- * Creates a <code>Dispatch</code> instance for use with JAXB
- * generated objects. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the dispatch accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * <p>
- * This method behavies the same as calling
- * <pre>
- * dispatch = service.createDispatch(portName, context, mode, features);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
- * element in the
- * metadata of the <code>endpointReference</code>.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned <code>Dispatch</code> object.
- * @param context The JAXB context used to marshall and unmarshall
- * messages or message payloads.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body.
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws WebServiceException
- * @throws WebServiceException
- * <UL>
- * <li>If there is any missing WSDL metadata
- * as required by this method.
- * <li>If the <code>wsaw:ServiceName</code> element
- * or the <code>wsaw:EndpointName</code> attribute
- * is missing in the metdata of the
- * <code>endpointReference</code>.
- * <li>If the <code>wsaw:ServiceName</code> does not
- * match the <code>serviceName</code> of this instance.
- * <li>If the <code>wsaw:EndpointName</code> does not
- * match a valid wsdl:Port in the WSDL metadata.
- * <li>If any error in the creation of
- * the <code>Dispatch</code> object.
- * <li>if a feature is enabled that is not
- * compatible with this port or is unsupported.
- * </UL>
- *
- * @see javax.xml.bind.JAXBContext
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).createDispatch(endpointReference, context, mode, features);
- }
-
- /**
- * Creates a <code>Dispatch</code> instance for use with objects of
- * the users choosing.
- *
- * @param portName Qualified name for the target service endpoint
- * @param type The class of object used for messages or message
- * payloads. Implementations are required to support
- * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
- * when type is SOAPMessage.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance.
- * @throws WebServiceException If any error in the creation of
- * the <code>Dispatch</code> object or if a
- * feature is enabled that is not compatible with
- * this port or is unsupported.
- *
- * @see javax.xml.transform.Source
- * @see javax.xml.soap.SOAPMessage
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).createDispatch(portName, type, mode, features);
- }
-
- /**
- * Creates a <code>Dispatch</code> instance for use with JAXB
- * generated objects.
- *
- * @param portName Qualified name for the target service endpoint
- * @param context The JAXB context used to marshall and unmarshall
- * messages or message payloads.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance.
- * @throws WebServiceException If any error in the creation of
- * the <code>Dispatch</code> object or if a
- * feature is enabled that is not compatible with
- * this port or is unsupported.
- *
- * @see javax.xml.bind.JAXBContext
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).createDispatch(portName, context, mode, features);
- }
-
-
- /**
- * The getPort method returns a proxy. The parameter
- * <code>serviceEndpointInterface</code> specifies the service
- * endpoint interface that is supported by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly.
- * The returned proxy should not be reconfigured by the client.
- *
- * @param serviceEndpointInterface Service endpoint interface.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object instance that supports the
- * specified service endpoint interface.
- * @throws WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy.
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified.
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- *
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).getPort(serviceEndpointInterface, features);
- }
-
- /**
- * The getPort method returns a proxy.
- * The parameter <code>endpointReference</code> specifies the
- * endpoint that will be invoked by the returned proxy. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * The returned proxy should not be reconfigured by the client.
- * If this <code>Service</code> instance has a known proxy
- * port that matches the information contained in
- * the WSDL,
- * then that proxy is returned, otherwise a WebServiceException
- * is thrown.
- * <p>
- * Calling this method has the same behavior as the following
- * <pre>
- * port = service.getPort(portName, serviceEndpointInterface);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpontName</code> attribute of the
- * <code>wsaw:ServiceName</code> element in the
- * metadata of the <code>endpointReference</code> or from the
- * <code>serviceEndpointInterface</code> and the WSDL
- * associated with this <code>Service</code> instance.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned proxy.
- * @param serviceEndpointInterface Service endpoint interface.
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface.
- * @throws WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy.
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <LI>If the <code>wsaw:EndpointName</code> is
- * missing from the <code>endpointReference</code>
- * or does not match a wsdl:Port
- * in the WSDL metadata.
- * <LI>If the <code>wsaw:ServiceName</code> in the
- * <code>endpointReference</code> metadata does not
- * match the <code>serviceName</code> of this
- * <code>Service</code> instance.
- * <LI>If an invalid
- * <code>endpointReference</code>
- * is specified.
- * <LI>If an invalid
- * <code>serviceEndpointInterface</code>
- * is specified.
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- *
- * @since JAX-WS 2.1
- **/
- public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).getPort(endpointReference, serviceEndpointInterface, features);
- }
-
- /**
- * The getPort method returns a proxy. A service client
- * uses this proxy to invoke operations on the target
- * service endpoint. The <code>serviceEndpointInterface</code>
- * specifies the service endpoint interface that is supported by
- * the created dynamic proxy instance.
- *
- * @param portName Qualified name of the service endpoint in
- * the WSDL service description.
- * @param serviceEndpointInterface Service endpoint interface
- * supported by the dynamic proxy instance.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that
- * supports the specified service endpoint
- * interface.
- * @throws WebServiceException This exception is thrown in the
- * following cases:
- * <UL>
- * <LI>If there is an error in creation of
- * the proxy.
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * or <code>portName</code> is specified.
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- * @see java.lang.reflect.Proxy
- * @see java.lang.reflect.InvocationHandler
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features)
- {
- return ((ServiceDelegate21)delegate).getPort(portName, serviceEndpointInterface, features);
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceContext21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceContext21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceContext21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-import org.w3c.dom.Element;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public interface WebServiceContext21 extends WebServiceContext
-{
- /**
- * Returns the <code>WEndpointReference</code> for this
- * endpoint.
- * <p>
- * If the Binding for this <code>bindingProvider</code> is
- * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
- * <code>W3CEndpointReference</code> MUST be returned.
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- * @return EndpointReference of the endpoint associated with this
- * <code>WebServiceContext</code>.
- * If the returned <code>EndpointReference</code> is of type
- * <code>W3CEndpointReference</code> then it MUST contain the
- * the specified <code>referenceParameters</code>.
- *
- * @throws IllegalStateException This exception is thrown
- * if the method is called while no request is
- * being serviced.
- *
- * @see javax.xml.ws.wsaddressing.W3CEndpointReference
- *
- * @since JAX-WS 2.1
- */
- public EndpointReference getEndpointReference(Element... referenceParameters);
-
- /**
- * Returns the <code>EndpointReference</code> associated with
- * this endpoint.
- * <p>
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @param clazz The type of <code>EndpointReference</code> that
- * MUST be returned.
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- * @return EndpointReference of type <code>clazz</code> of the endpoint
- * associated with this <code>WebServiceContext</code> instance.
- * If the returned <code>EndpointReference</code> is of type
- * <code>W3CEndpointReference</code> then it MUST contain the
- * the specified <code>referenceParameters</code>.
- *
- * @throws IllegalStateException This exception is thrown
- * if the method is called while no request is
- * being serviced.
- * @throws WebServiceException If the <code>clazz</code> type of
- * <code>EndpointReference</code> is not supported.
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters);
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceFeature.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/WebServiceFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws;
-
-/**
- * A WebServiceFeature is used to represent a feature that can be
- * enabled or disabled for a web service.
- * <p>
- * The JAX-WS specification will define some standard features and
- * JAX-WS implementors are free to define additional features if
- * necessary. Vendor specific features may not be portable so
- * caution should be used when using them. Each Feature definition
- * MUST define a <code>public static final String ID</code>
- * that can be used in the Feature annotation to refer
- * to the feature. This ID MUST be unique across all features
- * of all vendors. When defining a vendor specific feature ID,
- * use a vendor specific namespace in the ID string.
- *
- * @see javax.xml.ws.RespectBindingFeature
- * @see javax.xml.ws.soap.AddressingFeature
- * @see javax.xml.ws.soap.MTOMFeature
- *
- * @since 2.1
- */
-public abstract class WebServiceFeature
-{
- /**
- * Each Feature definition MUST define a public static final
- * String ID that can be used in the Feature annotation to refer
- * to the feature.
- */
- // public static final String ID = "some unique feature Identifier";
- /**
- * Get the unique identifier for this WebServiceFeature.
- *
- * @return the unique identifier for this feature.
- */
- public abstract String getID();
-
- /**
- * Specifies if the feature is enabled or disabled
- */
- protected boolean enabled = false;
-
- protected WebServiceFeature()
- {
- }
-
- /**
- * Returns <code>true</code> if this feature is enabled.
- *
- * @return <code>true</code> if and only if the feature is enabled .
- */
- public boolean isEnabled()
- {
- return enabled;
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/handler/MessageContext21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/handler/MessageContext21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/handler/MessageContext21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.handler;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public interface MessageContext21 extends MessageContext
-{
- /**
- * Standard property: WS Addressing Reference Parameters.
- * The list MUST include all SOAP headers marked with the
- * wsa:IsReferenceParameter="true" attribute.
- * <p>Type: List<Element>
- *
- * @since JAX-WS 2.1
- */
- public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters";
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/Addressing.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/Addressing.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/Addressing.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.soap;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.xml.ws.spi.WebServiceFeatureAnnotation;
-
-/**
- * This feature represents the use of WS-Addressing with either
- * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature
- * with any other binding is NOT required.
- * <p>
- * Enabling this feature will result in the
- * <code>wsaw:UsingAddressing</code> element being added to the
- * <code>wsdl:Binding</code> for
- * the endpoint and in the runtime being capable of responding to
- * WS-Addressing headers.
- * <p>
- * The following describes the affects of this feature with respect
- * to be enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, Addressing will be enabled.
- * If there is not a WSDL associated with the Endpoint and
- * a WSDL is to be generated, it MUST be generated with the
- * wsaw:UsingAddressing element. At runtime, Addressing headers
- * MUST be consumed by the receiver and generated by the
- * sender even if the WSDL declares otherwise. The
- * mustUnderstand="0" attribute MUST be used on the Addressing
- * headers.
- * <li> DISABLED: In this Mode, Addressing will be disabled
- * even if an associated WSDL specifies otherwise. At runtime,
- * Addressing headers MUST NOT be used.
- * </ul>
- * <p>
- * The {@link #required} property can be used to
- * specify if the <code>required</code> attribute on the
- * <code>wsaw:UsingAddressing</code> element should
- * be <code>true</code> or <code>false</code>. By default the
- * <code>wsdl:required</code> parameter is <code>false</code>.
- *
- * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">WS-Addressing</a>
- * for more information on WS-Addressing.
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a> for more information on <code>wsaw:UsingAddressing</code>.
- *
- * @since JAX-WS 2.1
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Documented
-(a)WebServiceFeatureAnnotation(id=AddressingFeature.ID,bean=AddressingFeature.class)
-public @interface Addressing {
- /**
- * Specifies if this feature is enabled or disabled.
- */
- boolean enabled() default true;
-
- /**
- * Property to determine the value of the
- * <code>wsdl:required</code> attribute on
- * <code>wsaw:UsingAddressing</code> element in the WSDL.
- */
- boolean required() default false;
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/AddressingFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/AddressingFeature.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/AddressingFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.soap;
-
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * This feature represents the use of WS-Addressing with either
- * the SOAP 1.1/HTTP or SOAP 1.2/HTTP binding. Using this feature
- * with any other binding is NOT required.
- * <p>
- * Enabling this feature on the server will result in the
- * <code>wsaw:UsingAddressing</code> element being added to the
- * <code>wsdl:Binding</code> for
- * the endpoint and in the runtime being capable of responding to
- * WS-Addressing headers.
- * <p>
- * Enabling this feature on the client will cause the JAX-WS runtime
- * to include WS-Addressing headers in SOAP messages.
- * <p>
- * If the web service developer has not explicitly enabled this feature,
- * it may be automatically enabled if the associated WSDL enables
- * WS-Addressing via the <code>wsaw:UsingAddressing</code> element with
- * the <code>wsdl:required</code> attribute set to <code>true</code>.
- * <br>
- * See {@link javax.xml.ws.RespectBindingFeature} for more information
- * on required WSDL extensions.
- * <p>
- * The following describes the affects of this feature with respect
- * to be enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, Addressing will be enabled.
- * If there is not a WSDL associated with the Endpoint and
- * a WSDL is to be generated, it MUST be generated with the
- * wsaw:UsingAddressing element. At runtime, Addressing headers
- * MUST be consumed by the receiver and generated by the
- * sender even if the WSDL declares otherwise. The
- * mustUnderstand="0" attribute MUST be used on the Addressing
- * headers.
- * <li> DISABLED: In this Mode, Addressing will be disabled
- * even if an associated WSDL specifies otherwise. At runtime,
- * Addressing headers MUST NOT be used.
- * </ul>
- * <p>
- * The {@link #required} property can be used to
- * specify if the <code>required</code> attribute on the
- * <code>wsaw:UsingAddressing</code> element should
- * be <code>true</code> or <code>false</code>. By default the
- * <code>wsdl:required</code> parameter is <code>false</code>.
- *
- * See <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">WS-Addressing</a>
- * for more information on WS-Addressing.
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a> for more information on <code>wsaw:UsingAddressing</code>.
- *
- * @since JAX-WS 2.1
- */
-public final class AddressingFeature extends WebServiceFeature {
- /**
- * Constant value identifying the AddressingFeature
- */
- public static final String ID = "http://www.w3.org/2005/08/addressing/module";
-
- /**
- * Property for <code>required</code> feature parameter. When Addressing
- * is enabled, the value of this property will be set to the
- * <code>wsdl:required</code> attribute on
- * <code>wsaw:UsingAddressing</code> element in the WSDL.
- */
- protected boolean required = false;
-
- /**
- * Create an <code>AddressingFeature</code>.
- * The instance created will be enabled.
- */
- public AddressingFeature() {
- this.enabled = true;
- }
-
- /**
- * Create an <code>AddressingFeature</code>
- *
- * @param enabled specifies whether this feature should
- * be enabled or not.
- */
- public AddressingFeature(boolean enabled) {
- this.enabled = enabled;
- }
-
- /**
- * Create an <code>AddressingFeature</code>
- *
- * @param enabled specifies whether this feature should
- * be enabled or not.
- * @param required specifies the value that will be used
- * for the <code>wsdl:required</code> attribute on the
- * <code>wsaw:UsingAddressing</code> element.
- */
- public AddressingFeature(boolean enabled, boolean required) {
- this.enabled = enabled;
- this.required = required;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getID() {
- return ID;
- }
-
- /**
- * Gets the boolean value used to set the
- * <code>wsdl:required</code> attribute on
- * <code>wsaw:UsingAddressing</code> element
- * in the WSDL.
- *
- * @return the current required value
- */
- public boolean isRequired() {
- return required;
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOM.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOM.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOM.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.soap;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.xml.ws.spi.WebServiceFeatureAnnotation;
-
-/**
- * This feature represents the use of MTOM with a
- * web service.
- *
- * <p>
- * The following describes the affects of this feature with respect
- * to being enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, MTOM will be enabled.
- * <li> DISABLED: In this Mode, MTOM will be disabled
- * </ul>
- * <p>
- * The {@link #threshold} property can be used to set the threshold
- * value used to determine when binary data should be XOP encoded.
- *
- * @since JAX-WS 2.1
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Documented
-(a)WebServiceFeatureAnnotation(id=MTOMFeature.ID,bean=MTOMFeature.class)
-public @interface MTOM {
- /**
- * Specifies if this feature is enabled or disabled.
- */
- boolean enabled() default true;
-
- /**
- * Property for MTOM threshold value. When MTOM is enabled, binary data above this
- * size in bytes will be XOP encoded or sent as attachment. The value of this property
- * MUST always be >= 0. Default value is 0.
- */
- int threshold() default 0;
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOMFeature.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOMFeature.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/soap/MTOMFeature.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.soap;
-
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * This feature represents the use of MTOM with a
- * web service.
- *
- * <p>
- * The following describes the affects of this feature with respect
- * to being enabled or disabled:
- * <ul>
- * <li> ENABLED: In this Mode, MTOM will be enabled.
- * <li> DISABLED: In this Mode, MTOM will be disabled
- * </ul>
- * <p>
- * The {@link #threshold} property can be used to set the threshold
- * value used to determine when binary data should be XOP encoded.
- *
- * @since JAX-WS 2.1
- */
-public final class MTOMFeature extends WebServiceFeature {
- /**
- * Constant value identifying the MTOMFeature
- */
- public static final String ID = "http://www.w3.org/2004/08/soap/features/http-optimization";
-
-
- /**
- * Property for MTOM threshold value. This property serves as a hint when
- * MTOM is enabled, binary data above this size in bytes SHOULD be sent
- * as attachment.
- * The value of this property MUST always be >= 0. Default value is 0.
- */
- protected int threshold = 0;
-
-
- /**
- * Create an <code>MTOMFeature</code>.
- * The instance created will be enabled.
- */
- public MTOMFeature() {
- this.enabled = true;
- }
-
- /**
- * Creates an <code>MTOMFeature</code>.
- *
- * @param enabled specifies if this feature should be enabled or not
- */
- public MTOMFeature(boolean enabled) {
- this.enabled = enabled;
- }
-
-
- /**
- * Creates an <code>MTOMFeature</code>.
- * The instance created will be enabled.
- *
- * @param threshold the size in bytes that binary data SHOULD be before
- * being sent as an attachment.
- *
- * @throws WebServiceException if threshold is < 0
- */
- public MTOMFeature(int threshold) {
- if (threshold < 0)
- throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
- this.enabled = true;
- this.threshold = threshold;
- }
-
- /**
- * Creates an <code>MTOMFeature</code>.
- *
- * @param enabled specifies if this feature should be enabled or not
- * @param threshold the size in bytes that binary data SHOULD be before
- * being sent as an attachment.
- *
- * @throws WebServiceException if threshold is < 0
- */
- public MTOMFeature(boolean enabled, int threshold) {
- if (threshold < 0)
- throw new WebServiceException("MTOMFeature.threshold must be >= 0, actual value: "+threshold);
- this.enabled = enabled;
- this.threshold = threshold;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getID() {
- return ID;
- }
-
- /**
- * Gets the threshold value used to determine when binary data
- * should be sent as an attachment.
- *
- * @return the current threshold size in bytes
- */
- public int getThreshold() {
- return threshold;
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/Provider21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/Provider21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/Provider21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,193 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.spi;
-
-import org.w3c.dom.Element;
-
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import java.util.List;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public abstract class Provider21 extends Provider
-{
- /**
- * The getPort method returns a proxy. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * The parameter <code>endpointReference</code> specifies the
- * endpoint that will be invoked by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL Metadata from the <code>EndpointReference</code>.
- *
- *
- * @param endpointReference the EndpointReference that will
- * be invoked by the returned proxy.
- * @param serviceEndpointInterface Service endpoint interface
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If this
- * <code>endpointReference</code>
- * is illegal
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified
- * <LI>If feature is enabled that is not compatible with
- * this port or is unsupported.
- * </UL>
- *
- * @see javax.xml.ws.WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
-
- /**
- * Factory method to create a <code>W3CEndpointReference</code>.
- *
- * <p>
- * This method can be used to create a <code>W3CEndpointReference</code>
- * for any endpoint by specifying the <code>address</code> property along
- * with any other desired properties. This method
- * can also be used to create a <code>W3CEndpointReference</code> for
- * an endpoint that is published by the same Java EE application.
- * To do so the <code>address</code> property can be provided or this
- * method can automatically determine the <code>address</code> of
- * an endpoint that is published by the same Java EE application and is
- * identified by the <code>serviceName</code> and
- * <code>portName</code> propeties. If the <code>address</code> is
- * <code>null</code> and the <code>serviceName</code> and
- * <code>portName</code> do not identify an endpoint published by the
- * same Java EE application, a
- * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
- *
- * @param address Specifies the address of the target endpoint
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param metadata A list of elements that should be added to the
- * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
- * element.
- * @param wsdlDocumentLocation URL for the WSDL document location for
- * the service.
- * @param referenceParameters Reference parameters to be associated
- * with the returned <code>EndpointReference</code> instance.
- *
- * @return the <code>W3CEndpointReference<code> created from
- * <code>serviceName</code>, <code>portName</code>,
- * <code>metadata</code>, <code>wsdlDocumentLocation</code>
- * and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- *
- * @throws javax.lang.IllegalArgumentException
- * <ul>
- * <li>If the <code>address</code>, <code>serviceName</code> and
- * <code>portName</code> are all <code>null</code>.
- * <li>If the <code>serviceName</code> service is <code>null</code> and the
- * <code>portName> is NOT <code>null</code>.
- * <li>If the <code>address</code> property is <code>null</code> and
- * the <code>serviceName</code> and <code>portName</code> do not
- * specify a valid endpoint published by the same Java EE
- * application.
- * <li>If the <code>serviceName</code>is NOT <code>null</code>
- * and is not present in the specified WSDL.
- * <li>If the <code>portName</code> port is not <code>null<code> and it
- * is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
- * and does not represent a valid WSDL.
- * </ul>
- * @throws javax.xml.ws.WebServiceException If an error occurs while creating the
- * <code>W3CEndpointReference</code>.
- *
- * @since JAX-WS 2.1
- */
- public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata,
- String wsdlDocumentLocation, List<Element> referenceParameters);
-
- /**
- * read an EndpointReference from the infoset contained in
- * <code>eprInfoset</code>.
- *
- * @returns the <code>EndpointReference</code> unmarshalled from
- * <code>eprInfoset</code>. This method never returns <code>null</code>.
- *
- * @throws javax.xml.ws.WebServiceException If there is an error creating the
- * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
- *
- * @throws NullPointerException If the <code>null</code>
- * <code>eprInfoset</code> value is given.
- *
- * @since JAX-WS 2.1
- **/
- public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
-
- /**
- * Create an EndpointReference for <code>serviceName</code>
- * service and <code>portName</code> port from the WSDL <code>wsdlDocumentLocation</code>. The instance
- * returned will be of type <code>clazz</code> and contain the <code>referenceParameters</code>
- * reference parameters. This method delegates to the vendor specific
- * implementation of the {@link javax.xml.ws.spi.Provider#createEndpointReference(Class<T>, javax.xml.namespace.QName, javax.xml.namespace.QName, javax.xml.transform.Source, org.w3c.dom.Element...)} method.
- *
- * @param clazz Specifies the type of <code>EndpointReference</code> that MUST be returned.
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param wsdlDocumentLocation URL for the WSDL document location for the service.
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- *
- * @return the EndpointReference created from <code>serviceName</code>, <code>portName</code>,
- * <code>wsdlDocumentLocation</code> and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <li>If the <code>serviceName</code> service is not present in the WSDL.
- * <li>If the <code>portName</code> port is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> does not represent a valid WSDL.
- * <li>If an error occurs while creating the <code>EndpointReference</code>.
- * <li>If the Class <code>clazz</code> is not supported by this implementation.
- * </UL>
- * @throws java.lang.IllegalArgumentException
- * if any of the <code>clazz</code>, <code>serviceName</code>, <code>portName</code> and <code>wsdlDocumentLocation</code> is null.
- */
- public abstract <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation,
- Element... referenceParameters);
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/ServiceDelegate21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/ServiceDelegate21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/ServiceDelegate21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,410 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.spi;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.Service;
-import javax.xml.ws.EndpointReference;
-import javax.xml.bind.JAXBContext;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public abstract class ServiceDelegate21 extends ServiceDelegate
-{
- /**
- * The getPort method returns a proxy. A service client
- * uses this proxy to invoke operations on the target
- * service endpoint. The <code>serviceEndpointInterface</code>
- * specifies the service endpoint interface that is supported by
- * the created dynamic proxy instance.
- *
- * @param portName Qualified name of the service endpoint in
- * the WSDL service description
- * @param serviceEndpointInterface Service endpoint interface
- * supported by the dynamic proxy or instance
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that
- * supports the specified service endpoint
- * interface
- * @throws javax.xml.ws.WebServiceException This exception is thrown in the
- * following cases:
- * <UL>
- * <LI>If there is an error in creation of
- * the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * or <code>portName</code> is specified
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- * @see java.lang.reflect.Proxy
- * @see java.lang.reflect.InvocationHandler
- * @see javax.xml.ws.WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(QName portName,
- Class<T> serviceEndpointInterface, WebServiceFeature... features);
-
- /**
- * The getPort method returns a proxy.
- * The parameter <code>endpointReference</code> specifies the
- * endpoint that will be invoked by the returned proxy. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * The returned proxy should not be reconfigured by the client.
- * If this <code>Service</code> instance has a known proxy
- * port that matches the information contained in
- * the WSDL,
- * then that proxy is returned, otherwise a WebServiceException
- * is thrown.
- * <p>
- * Calling this method has the same behavior as the following
- * <pre>
- * port = service.getPort(portName, serviceEndpointInterface);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpontName</code> attribute of the
- * <code>wsaw:ServiceName</code> element in the
- * metadata of the <code>endpointReference</code> or from the
- * <code>serviceEndpointInterface</code> and the WSDL
- * associated with this <code>Service</code> instance.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned proxy.
- * @param serviceEndpointInterface Service endpoint interface.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface.
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy.
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <LI>If the <code>wsaw:EndpointName</code> is
- * missing from the <code>endpointReference</code>
- * or does not match a wsdl:Port
- * in the WSDL metadata.
- * <LI>If the <code>wsaw:ServiceName</code> in the
- * <code>endpointReference</code> metadata does not
- * match the <code>serviceName</code> of this
- * <code>Service</code> instance.
- * <LI>If an invalid
- * <code>endpointReference</code>
- * is specified.
- * <LI>If an invalid
- * <code>serviceEndpointInterface</code>
- * is specified.
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(EndpointReference endpointReference,
- Class<T> serviceEndpointInterface, WebServiceFeature... features);
-
- /**
- * The getPort method returns a proxy. The parameter
- * <code>serviceEndpointInterface</code> specifies the service
- * endpoint interface that is supported by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly.
- * The returned proxy should not be reconfigured by the client.
- *
- * @param serviceEndpointInterface Service endpoint interface
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object instance that supports the
- * specified service endpoint interface
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified
- * <LI>If a feature is enabled that is not compatible
- * with this port or is unsupported.
- * </UL>
- *
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(Class<T> serviceEndpointInterface,
- WebServiceFeature... features);
-
- /**
- * Creates a <code>Dispatch</code> instance for use with objects of
- * the users choosing.
- *
- * @param portName Qualified name for the target service endpoint
- * @param type The class of object used for messages or message
- * payloads. Implementations are required to support
- * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
- * when type is SOAPMessage.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws javax.xml.ws.WebServiceException If any error in the creation of
- * the <code>Dispatch</code> object or if a
- * feature is enabled that is not compatible with
- * this port or is unsupported.
- *
- * @see javax.xml.transform.Source
- * @see javax.xml.soap.SOAPMessage
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> Dispatch<T> createDispatch(QName portName, Class<T> type,
- Service.Mode mode, WebServiceFeature... features);
-
- /**
- * Creates a <code>Dispatch</code> instance for use with objects of
- * the users choosing. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the dispatch accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * <p>
- * This method behaves the same as calling
- * <pre>
- * dispatch = service.createDispatch(portName, type, mode, features);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
- * element in the
- * metadata of the <code>endpointReference</code>.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned <code>Dispatch</code> object.
- * @param type The class of object used to messages or message
- * payloads. Implementations are required to support
- * javax.xml.transform.Source and javax.xml.soap.SOAPMessage.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body. Mode MUST be MESSAGE
- * when type is SOAPMessage.
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <LI>If there is any missing WSDL metadata
- * as required by this method.
- * <li>If the <code>wsaw:ServiceName</code> element
- * or the <code>wsaw:EndpointName</code> attribute
- * is missing in the metdata of the
- * <code>endpointReference</code>.
- * <li>If the <code>wsaw:ServiceName</code> does not
- * match the <code>serviceName</code> of this instance.
- * <li>If the <code>wsaw:EndpointName</code> does not
- * match a valid wsdl:Port in the WSDL metadata.
- * <li>If any error in the creation of
- * the <code>Dispatch</code> object.
- * <li>if a feature is enabled that is not
- * compatible with this port or is unsupported.
- * </UL>
- *
- * @see javax.xml.transform.Source
- * @see javax.xml.soap.SOAPMessage
- * @see WebServiceFeature;
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> Dispatch<T> createDispatch(EndpointReference endpointReference,
- Class<T> type, Service.Mode mode,
- WebServiceFeature... features);
-
- /**
- * Creates a <code>Dispatch</code> instance for use with JAXB
- * generated objects.
- *
- * @param portName Qualified name for the target service endpoint
- * @param context The JAXB context used to marshall and unmarshall
- * messages or message payloads.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body.
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws javax.xml.ws.WebServiceException If any error in the creation of
- * the <code>Dispatch</code> object or if a
- * feature is enabled that is not compatible with
- * this port or is unsupported.
- *
- * @see javax.xml.bind.JAXBContext
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract Dispatch<Object> createDispatch(QName portName,
- JAXBContext context, Service.Mode mode, WebServiceFeature... features);
-
- /**
- * Creates a <code>Dispatch</code> instance for use with JAXB
- * generated objects. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The <code>endpointReference's</code> address MUST be used
- * for invocations on the endpoint.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the dispatch accordingly from
- * the WSDL associated with this <code>Service</code> instance or
- * from the WSDL Metadata from the <code>endpointReference</code>.
- * If this <code>Service</code> instance has a WSDL and
- * the <code>endpointReference</code>
- * also has a WSDL, then the WSDL from this instance will be used.
- * If this <code>Service</code> instance does not have a WSDL and
- * the <code>endpointReference</code> does have a WSDL, then the
- * WSDL from the <code>endpointReference</code> will be used.
- * <p>
- * This method behavies the same as calling
- * <pre>
- * dispatch = service.createDispatch(portName, context, mode, features);
- * </pre>
- * where the <code>portName</code> is retrieved from the
- * <code>wsaw:EndpointName</code> attribute of the <code>wsaw:ServiceName</code>
- * element in the
- * metadata of the <code>endpointReference</code>.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">WS-Addressing - WSDL 1.0
- * </a>.
- *
- * @param endpointReference The <code>EndpointReference</code>
- * for the target service endpoint that will be invoked by the
- * returned <code>Dispatch</code> object.
- * @param context The JAXB context used to marshall and unmarshall
- * messages or message payloads.
- * @param mode Controls whether the created dispatch instance is message
- * or payload oriented, i.e. whether the user will work with complete
- * protocol messages or message payloads. E.g. when using the SOAP
- * protocol, this parameter controls whether the user will work with
- * SOAP messages or the contents of a SOAP body.
- * @param features An array of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- *
- * @return Dispatch instance
- * @throws javax.xml.ws.WebServiceException
- * @throws javax.xml.ws.WebServiceException
- * <UL>
- * <li>If there is any missing WSDL metadata
- * as required by this method.
- * <li>If the <code>wsaw:ServiceName</code> element
- * or the <code>wsaw:EndpointName</code> attribute
- * is missing in the metdata of the
- * <code>endpointReference</code>.
- * <li>If the <code>wsaw:ServiceName</code> does not
- * match the <code>serviceName</code> of this instance.
- * <li>If the <code>wsaw:EndpointName</code> does not
- * match a valid wsdl:Port in the WSDL metadata.
- * <li>If any error in the creation of
- * the <code>Dispatch</code> object.
- * <li>if a feature is enabled that is not
- * compatible with this port or is unsupported.
- * </UL>
- *
- * @see javax.xml.bind.JAXBContext
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract Dispatch<Object> createDispatch(EndpointReference endpointReference,
- JAXBContext context, Service.Mode mode,
- WebServiceFeature... features);
-
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/spi/WebServiceFeatureAnnotation.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.spi;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * Annotation used to identify other annotations
- * as a <code>WebServiceFeature</code>.
- *
- * Each <code>WebServiceFeature</code> annotation annotated with
- * this annotation MUST contain an
- * <code>enabled</code> property of type
- * <code>boolean</code> with a default value of <code>true</code>.
- * JAX-WS defines the following
- * <code>WebServiceFeature</code> annotations, however, an implementation
- * may define vendors specific annotations for other features.
- * If a JAX-WS implementation encounters an annotation annotated
- * with the <code>WebServiceFeatureAnnotation</code> that is does not
- * recognize/support an error MUST be given.
- *
- * @see javax.xml.ws.soap.WSAddressing
- * @see javax.xml.ws.soap.MTOM
- * @see javax.xml.ws.RespectBinding
- *
- * @since JAX-WS 2.1
- */
-(a)Target(ElementType.ANNOTATION_TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface WebServiceFeatureAnnotation {
- /**
- * Unique identifier for the WebServiceFeature. This
- * identifier MUST be unique across all implementations
- * of JAX-WS.
- */
- String id();
-
- /**
- * The <code>WebServiceFeature</code> bean that is associated
- * with the <code>WebServiceFeature</code> annotation
- */
- Class<? extends WebServiceFeature> bean();
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/BindingProvider21.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/BindingProvider21.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/BindingProvider21.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.wsaddressing;
-
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.EndpointReference;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- */
-public interface BindingProvider21 extends BindingProvider
-{
- /**
- * Returns the <code>EndpointReference</code> associated with
- * this <code>BindingProvider</code> instance.
- * <p>
- * If the Binding for this <code>bindingProvider</code> is
- * either SOAP1.1/HTTP or SOAP1.2/HTTP, then a
- * <code>W3CEndpointReference</code> MUST be returned.
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @return EndpointReference of the target endpoint associated with this
- * <code>BindingProvider</code> instance.
- *
- * @throws java.lang.UnsupportedOperationException If this
- * <code>BindingProvider</code> uses the XML/HTTP binding.
- *
- * @see W3CEndpointReference
- *
- * @since JAX-WS 2.1
- */
- public EndpointReference getEndpointReference();
-
- /**
- * Returns the <code>EndpointReference</code> associated with
- * this <code>BindingProvider</code> instance. The instance
- * returned will be of type <code>clazz</code>.
- * <p>
- * If the returned <code>EndpointReference</code> is a
- * <code>W3CEndpointReference</code> it MUST contain
- * the <code>wsaw:ServiceName</code> element and the
- * <code>wsaw:EndpointName</code> attribute on the
- * <code>wsaw:ServiceName</code>. It SHOULD contain
- * the embedded WSDL in the <code>wsa:Metadata</code> element
- * if there is an associated WSDL. The
- * <code>wsaw:InterfaceName</code> MAY also be present.
- * <br>
- * See <a href="http://www.w3.org/TR/2006/CR-ws-addr-wsdl-20060529/">
- * WS-Addressing - WSDL 1.0</a>.
- *
- * @param clazz Specifies the type of <code>EndpointReference</code>
- * that MUST be returned.
-
- * @return EndpointReference of the target endpoint associated with this
- * <code>BindingProvider</code> instance. MUST be of type
- * <code>clazz</code>.
-
- * @throws javax.xml.ws.WebServiceException If the Class <code>clazz</code>
- * is not supported by this implementation.
- * @throws java.lang.UnsupportedOperationException If this
- * <code>BindingProvider</code> uses the XML/HTTP binding.
- *
- * @since JAX-WS 2.1
- */
- public <T extends EndpointReference> T getEndpointReference(Class<T> clazz);
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,306 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.wsaddressing;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-
-import org.w3c.dom.Element;
-
-/**
- * This class represents a W3C Addressing EndpointReferece which is
- * a remote reference to a web service endpoint that supports the
- * W3C WS-Addressing 1.0 - Core Recommendation.
- * <p>
- * Developers should use this class in their SEIs if they want to
- * pass/return endpoint references that represent the W3C WS-Addressing
- * recommendation.
- * <p>
- * JAXB will use the JAXB annotations and bind this class to XML infoset
- * that is consistent with that defined by WS-Addressing. See
- * <a href="http://www.w3.org/TR/2006/REC-ws-addr-core-20060509/">
- * WS-Addressing</a>
- * for more information on WS-Addressing EndpointReferences.
- *
- * @since JAX-WS 2.1
- */
-
-// XmlRootElement allows this class to be marshalled on its own
-@XmlRootElement(name = "EndpointReference", namespace = W3CEndpointReference.NS)
-@XmlType(name = "EndpointReferenceType", namespace = W3CEndpointReference.NS)
-public final class W3CEndpointReference extends EndpointReference
-{
- protected static final String NS = "http://www.w3.org/2005/08/addressing";
-
- private final static JAXBContext w3cjc = getW3CJaxbContext();
-
- // private but necessary properties for databinding
- @XmlElement(name = "Address", namespace = NS)
- private Address address;
- @XmlElement(name = "ReferenceParameters", namespace = NS)
- private Elements referenceParameters;
- @XmlElement(name = "Metadata", namespace = NS)
- private Elements metadata;
- @XmlAnyAttribute
- Map<QName, String> attributes;
- @XmlAnyElement
- List<Element> elements;
-
- // not marshalled
- private QName serviceName;
- private QName endpointName;
- private URL wsdlLocation;
-
- protected W3CEndpointReference()
- {
- }
-
- /**
- * construct an EPR from infoset representation
- *
- * @param source A source object containing valid XmlInfoset
- * instance consistent with the W3C WS-Addressing Core
- * recommendation.
- *
- * @throws WebServiceException
- * If the source does NOT contain a valid W3C WS-Addressing
- * EndpointReference.
- * @throws NullPointerException
- * If the <code>null</code> <code>source</code> value is given
- */
- public W3CEndpointReference(Source source)
- {
- try
- {
- W3CEndpointReference epr = w3cjc.createUnmarshaller().unmarshal(source, W3CEndpointReference.class).getValue();
- this.address = epr.address;
- this.metadata = epr.metadata;
- this.referenceParameters = epr.referenceParameters;
- }
- catch (JAXBException e)
- {
- throw new WebServiceException("Error unmarshalling W3CEndpointReference ", e);
- }
- catch (ClassCastException e)
- {
- throw new WebServiceException("Source did not contain W3CEndpointReference", e);
- }
- }
-
- @XmlTransient
- public String getAddress()
- {
- return address != null ? address.getUri() : null;
- }
-
- void setAddress(String address)
- {
- this.address = new Address(address);
- }
-
- @XmlTransient
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public void setServiceName(QName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- @XmlTransient
- public QName getEndpointName()
- {
- return endpointName;
- }
-
- public void setEndpointName(QName endpointName)
- {
- this.endpointName = endpointName;
- }
-
- @XmlTransient
- public List<Element> getMetadata()
- {
- return metadata != null ? metadata.getElements() : null;
- }
-
- public void setMetadata(List<Element> metadata)
- {
- this.metadata = new Elements(metadata);
- }
-
- @XmlTransient
- public URL getWsdlLocation()
- {
- return wsdlLocation;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- try
- {
- this.wsdlLocation = wsdlLocation != null ? new URL(wsdlLocation) : null;
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Invalid URL: " + wsdlLocation);
- }
- }
-
- @XmlTransient
- public List<Element> getReferenceParameters()
- {
- return referenceParameters != null ? referenceParameters.getElements() : null;
- }
-
- public void setReferenceParameters(List<Element> metadata)
- {
- this.referenceParameters = new Elements(metadata);
- }
-
- /**
- * {@inheritDoc}
- */
- public void writeTo(Result result)
- {
- try
- {
- Marshaller marshaller = w3cjc.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
- marshaller.marshal(this, result);
- }
- catch (JAXBException e)
- {
- throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
- }
- }
-
- private static JAXBContext getW3CJaxbContext()
- {
- try
- {
- return JAXBContext.newInstance(new Class[] { W3CEndpointReference.class });
- }
- catch (JAXBException ex)
- {
- throw new WebServiceException("Cannot obtain JAXB context", ex);
- }
- }
-
- private static class Address
- {
- @XmlValue
- String uri;
- @XmlAnyAttribute
- Map<QName, String> attributes;
-
- protected Address()
- {
- }
-
- public Address(String uri)
- {
- this.uri = uri;
- }
-
- @XmlTransient
- public String getUri()
- {
- return uri;
- }
-
- public void setUri(String uri)
- {
- this.uri = uri;
- }
-
- @XmlTransient
- public Map<QName, String> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes(Map<QName, String> attributes)
- {
- this.attributes = attributes;
- }
- }
-
- private static class Elements
- {
- @XmlAnyElement
- List<Element> elements;
- @XmlAnyAttribute
- Map<QName, String> attributes;
-
- protected Elements()
- {
- }
-
- public Elements(List<Element> elements)
- {
- this.elements = elements;
- }
-
- @XmlTransient
- public List<Element> getElements()
- {
- return elements;
- }
-
- public void setElements(List<Element> elements)
- {
- this.elements = elements;
- }
-
- @XmlTransient
- public Map<QName, String> getAttributes()
- {
- return attributes;
- }
-
- public void setAttributes(Map<QName, String> attributes)
- {
- this.attributes = attributes;
- }
- }
-}
Deleted: stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java
===================================================================
--- stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/jaxws-ext/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReferenceBuilder.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -1,272 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package javax.xml.ws.wsaddressing;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
-
-import org.w3c.dom.Element;
-
-/**
- * This class is used to build <code>W3CEndpointReference</code>
- * instances. The intended use of this clsss is for
- * an application component, for example a factory component,
- * to create an <code>W3CEndpointReference</code> for a
- * web service endpoint published by the same
- * Java EE application. It can also be used to create
- * <code>W3CEndpointReferences</code> for an Java SE based
- * endpoint by providing the <code>address</code> property.
- * <p>
- * When creating a <code>W3CEndpointReference</code> for an
- * endpoint that is not published by the same Java EE application,
- * the <code>address</code> property MUST be specified.
- * <p>
- * When creating a <code>W3CEndpointReference</code> for an endpoint
- * published by the same Java EE application, the <code>address</code>
- * property MAY be <code>null</code> but then the <code>serviceName</code>
- * and <code>endpointName</code> MUST specify an endpoint published by
- * the same Java EE application.
- * <p>
- * When the <code>wsdlDocumentLocation</code> is specified it MUST refer
- * to a valid WSDL document and the <code>serviceName</code> and
- * <code>endpointName</code> (if specified) MUST match a service and port
- * in the WSDL document.
- *
- * @since JAX-WS 2.1
- */
-public final class W3CEndpointReferenceBuilder
-{
-
- private String address;
- private List<Element> parameters;
- private List<Element> metadata;
- private QName serviceName;
- private QName endpointName;
- private String wsdlLocation;
-
- public W3CEndpointReferenceBuilder()
- {
- parameters = new ArrayList<Element>();
- metadata = new ArrayList<Element>();
- }
-
- /**
- * Sets the <code>address</code> to the
- * <code>W3CEndpointReference</code> instance's
- * <code>wsa:Address</code>.
- * <p>
- * The <code>address</code> MUST be set to a non-<code>null</code>
- * value when building a <code>W3CEndpointReference</code> for a
- * web service endpoint that is not published by the same
- * Java EE application or when running on Java SE.
- *
- * @param address The address of the endpoint to be targeted
- * by the returned <code>W3CEndpointReference<code>.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>address</code> set to the <code>wsa:Address</code>.
- */
- public W3CEndpointReferenceBuilder address(String address)
- {
- this.address = address;
- return this;
- }
-
- /**
- * Sets the <code>serviceName</code> as the
- * <code>wsaw:ServiceName</code> element in the
- * <code>wsa:Metadata</code> element.
- *
- * @param serviceName The service name of the endpoint to be targeted
- * by the returned <code>W3CEndpointReference<code>. This property
- * may also be used with the <code>endpointName</code> (portName)
- * property to lookup the <code>address</code> of a web service
- * endpoint that is published by the same Java EE application.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>serviceName</code> element added to the
- * <code>wsa:Metadata</code> element.
- *
- */
- public W3CEndpointReferenceBuilder serviceName(QName serviceName)
- {
- this.serviceName = serviceName;
- return this;
- }
-
- /**
- * Sets the <code>endpointName</code> as and attribute on
- * <code>wsaw:ServiceName</code> element in the
- * <code>wsa:Metadata</code> element. This method can only
- * be called after the {@link #serviceName} method has been called.
- *
- * @param endpointName The name of the endpoint to be targeted
- * by the returned <code>W3CEndpointReference<code>. The
- * <code>endpointName</code> (portName) property may also be
- * used with the <code>serviceName</code> property to lookup
- * the <code>address</code> of a web service
- * endpoint published by the same Java EE application.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>endpointName</code> atrribute added to the
- * <code>wsaw:ServiceName</code> element in the
- * <code>wsa:Metadata</code> element.
- *
- * @throws javax.lang.IllegalStateException If the <code>serviceName</code> has not
- * been set.
- */
- public W3CEndpointReferenceBuilder endpointName(QName endpointName)
- {
- if (serviceName == null)
- {
- throw new IllegalStateException("The W3CEndpointReferenceBuilder's serviceName must be set before setting the endpointName: " + endpointName);
- }
-
- this.endpointName = endpointName;
- return this;
- }
-
- /**
- * Sets the <code>wsdlDocumentLocation</code> that will be inlined
- * in the <code>W3CEndpointReferenc</code> instance's
- * <code>wsa:Metadata</code>.
- *
- * @param wsdlDocumentLocation The location of the WSDL document to
- * be inlined in the <code>wsa:Metadata</code> of the
- * <code>W3CEndpointReference<code>.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>wsdlDocumentLocation</code> that is to be inlined.
- *
- */
- public W3CEndpointReferenceBuilder wsdlDocumentLocation(String wsdlDocumentLocation)
- {
- this.wsdlLocation = wsdlDocumentLocation;
- return this;
- }
-
- /**
- * Adds the <code>referenceParameter</code> to the
- * <code>W3CEndpointReference</code> instance
- * <code>wsa:ReferenceParameters</code> element.
- *
- * @param referenceParameter The element to be added to the
- * <code>wsa:ReferenceParameters</code> element.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>referenceParameter</code> added to the
- * <code>wsa:ReferenceParameters</code> element.
- *
- * @throws java.lang.IllegalArgumentException if <code>referenceParameter</code>
- * is <code>null</code>.
- */
- public W3CEndpointReferenceBuilder referenceParameter(Element referenceParameter)
- {
- if (referenceParameter == null)
- throw new java.lang.IllegalArgumentException("The referenceParameter cannot be null.");
- parameters.add(referenceParameter);
- return this;
- }
-
- /**
- * Adds the <code>metadataElement</code> to the
- * <code>W3CEndpointReference</code> instance's
- * <code>wsa:Metadata</code> element.
- *
- * @param metadataElement The element to be added to the
- * <code>wsa:Metadata</code> element.
- *
- * @return A <code>W3CEndpointReferenceBuilder</code> instance with
- * the <code>metadataElement</code> added to the
- * <code>wsa:Metadata</code> element.
- *
- * @throws java.lang.IllegalArgumentException if <code>metadataElement</code>
- * is <code>null</code>.
- */
- public W3CEndpointReferenceBuilder metadata(Element metadataElement)
- {
- if (metadataElement == null)
- throw new java.lang.IllegalArgumentException("The metadataElement cannot be null.");
- metadata.add(metadataElement);
- return this;
- }
-
- /**
- * Builds a <code>W3CEndpointReference</code> from the accumulated
- * properties set on this <code>W3CEndpointReferenceBuilder</code>
- * instance.
- * <p>
- * This method can be used to create a <code>W3CEndpointReference</code>
- * for any endpoint by specifying the <code>address</code> property along
- * with any other desired properties. This method
- * can also be used to create a <code>W3CEndpointReference</code> for
- * an endpoint that is published by the same Java EE application.
- * This method can automatically determine the <code>address</code> of
- * an endpoint published by the same Java EE application that is identified by the
- * <code>serviceName</code> and
- * <code>endpointName</code> properties. If the <code>address</code> is
- * <code>null</code> and the <code>serviceName</code> and
- * <code>endpointName</code>
- * do not identify an endpoint published by the same Java EE application, a
- * <code>javax.lang.IllegalStateException</code> MUST be thrown.
- *
- *
- * @return <code>W3CEndpointReference</code> from the accumulated
- * properties set on this <code>W3CEndpointReferenceBuilder</code>
- * instance. This method never returns <code>null</code>.
- *
- * @throws javax.lang.IllegalStateException
- * <ul>
- * <li>If the <code>address</code>, <code>serviceName</code> and
- * <code>endpointName</code> are all <code>null</code>.
- * <li>If the <code>serviceName</code> service is <code>null</code> and the
- * <code>endpointName</code> is NOT <code>null</code>.
- * <li>If the <code>address</code> property is <code>null</code> and
- * the <code>serviceName</code> and <code>endpointName</code> do not
- * specify a valid endpoint published by the same Java EE
- * application.
- * <li>If the <code>serviceName</code>is NOT <code>null</code>
- * and is not present in the specified WSDL.
- * <li>If the <code>endpointName</code> port is not <code>null<code> and it
- * is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code> Pr
- * and does not represent a valid WSDL.
- * </ul>
- * @throws WebServiceException If an error occurs while creating the
- * <code>W3CEndpointReference</code>.
- *
- */
- public W3CEndpointReference build()
- {
- W3CEndpointReference epr = new W3CEndpointReference();
- epr.setAddress(address);
- epr.setServiceName(serviceName);
- epr.setEndpointName(endpointName);
- epr.setMetadata(metadata);
- epr.setWsdlLocation(wsdlLocation);
- epr.setReferenceParameters(parameters);
- return epr;
- }
-}
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -25,7 +25,6 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import javax.xml.ws.Service21;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
@@ -75,7 +74,7 @@
builder.referenceParameter(DOMUtils.parse("<fabrikam:ShoppingCart xmlns:fabrikam='http://example.com/fabrikam'>ABCDEFG</fabrikam:ShoppingCart>"));
W3CEndpointReference epr = builder.build();
- Service21 service = Service21.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName);
TestEndpoint port = service.getPort(epr, TestEndpoint.class);
((StubExt)port).setConfigName("Standard WSAddressing Client");
String retStr = port.echo("hello");
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/fastinfoset/FastInfosetTestCase.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -28,7 +28,7 @@
import java.net.URLConnection;
import javax.xml.namespace.QName;
-import javax.xml.ws.Service21;
+import javax.xml.ws.Service;
import junit.framework.Test;
@@ -85,7 +85,7 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-fastinfoset?wsdl");
QName serviceName = new QName("http://org.jboss.ws/fastinfoset", "FastInfosetEndpointService");
- Service21 service = Service21.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName);
FastInfosetFeature feature = new FastInfosetFeature();
FastInfoset port = service.getPort(FastInfoset.class, feature);
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1172/JBWS1172TestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1172/JBWS1172TestCase.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1172/JBWS1172TestCase.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.ws.jaxws.jbws1172;
-import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import javax.xml.ws.Service21;
import junit.framework.Test;
@@ -96,7 +94,7 @@
URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");
URL xsdURL = new SchemaExtractor().getSchemaUrl(wsdlURL);
- Service21 service = Service21.create(wsdlURL, SERVICE_NAME);
+ Service service = Service.create(wsdlURL, SERVICE_NAME);
SchemaValidationFeature feature = new SchemaValidationFeature(xsdURL.toString());
MyTest port = service.getPort(MyTest.class, feature);
try
@@ -117,7 +115,7 @@
URL wsdlURL = getResourceURL("jaxws/jbws1172/WEB-INF/wsdl/TestService.wsdl");
URL xsdURL = new SchemaExtractor().getSchemaUrl(wsdlURL);
- Service21 service = Service21.create(wsdlURL, SERVICE_NAME);
+ Service service = Service.create(wsdlURL, SERVICE_NAME);
SchemaValidationFeature feature = new SchemaValidationFeature(xsdURL.toString());
TestErrorHandler errorHandler = new TestErrorHandler();
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/json/JsonTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/json/JsonTestCase.java 2009-01-12 14:36:00 UTC (rev 9009)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/json/JsonTestCase.java 2009-01-12 16:01:56 UTC (rev 9010)
@@ -24,7 +24,7 @@
import java.net.URL;
import javax.xml.namespace.QName;
-import javax.xml.ws.Service21;
+import javax.xml.ws.Service;
import junit.framework.Test;
@@ -49,7 +49,7 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-json?wsdl");
QName serviceName = new QName("http://org.jboss.ws/json", "JsonEndpointService");
- Service21 service = Service21.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName);
JsonEncodingFeature feature = new JsonEncodingFeature();
JsonPort port = service.getPort(JsonPort.class, feature);
15 years, 11 months
JBossWS SVN: r9009 - in stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws: handler and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-12 09:36:00 -0500 (Mon, 12 Jan 2009)
New Revision: 9009
Modified:
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
Log:
Allow faultCode and faultString to be passed from WS-Security handler to calling client.
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 14:06:42 UTC (rev 9008)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
@@ -171,7 +171,7 @@
protected boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 14:06:42 UTC (rev 9008)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2009-01-12 14:36:00 UTC (rev 9009)
@@ -595,7 +595,7 @@
private boolean callRequestHandlerChain(QName portName, HandlerType type)
{
BindingExt binding = (BindingExt)bindingProvider.getBinding();
- HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+ HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type), false);
executorMap.put(type, executor);
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12 14:06:42 UTC (rev 9008)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java 2009-01-12 14:36:00 UTC (rev 9009)
@@ -61,10 +61,14 @@
protected int falseIndex = -1;
// True if the current direction is outbound
protected Boolean isOutbound;
+ // True if this is for the server/endpoint side, used to determine client side specific
+ // conformance requirements.
+ private boolean serverSide;
- public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler> unsortedChain)
+ public HandlerChainExecutor(EndpointMetaData epMetaData, List<Handler> unsortedChain, boolean serverSide)
{
this.epMetaData = epMetaData;
+ this.serverSide = serverSide;
// Sort handler logical handlers first
List<Handler> sortedChain = new ArrayList<Handler>();
@@ -264,9 +268,17 @@
// the client MUST be passed on to the application. If the exception in question is a subclass of WebService-
// Exception then an implementation MUST rethrow it as-is, without any additional wrapping, otherwise it
// MUST throw a WebServiceException whose cause is set to the exception that was thrown during handler processing.
- private void processHandlerFailure(Exception ex)
+ private void processHandlerFailure(RuntimeException ex)
{
log.error("Exception during handler processing", ex);
+
+ // If this call is server side then the conformance requirement specific to
+ // clients can be avoided.
+ if (serverSide == true)
+ {
+ throw ex;
+ }
+
if (ex instanceof WebServiceException)
{
throw (WebServiceException)ex;
Modified: stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12 14:06:42 UTC (rev 9008)
+++ stack/native/branches/dlofthouse/JBWS-1999/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2009-01-12 14:36:00 UTC (rev 9009)
@@ -161,8 +161,8 @@
{
if (type == HandlerType.ALL)
throw new IllegalArgumentException("Invalid handler type: " + type);
-
- HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData, getHandlerChain(sepMetaData, type));
+
+ HandlerChainExecutor executor = new HandlerChainExecutor(sepMetaData, getHandlerChain(sepMetaData, type), true);
if (type == HandlerType.PRE)
preExecutor.set(executor);
else if (type == HandlerType.ENDPOINT)
15 years, 11 months