You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/05/29 22:23:49 UTC
svn commit: r542643 [2/3] - in
/webservices/axis2/branches/java/jaxws21/modules: jaxws-api/
jaxws-api/src/javax/xml/ws/ jaxws-api/src/javax/xml/ws/handler/
jaxws-api/src/javax/xml/ws/soap/ jaxws-api/src/javax/xml/ws/spi/
jaxws-api/src/javax/xml/ws/wsad...
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressing.java Tue May 29 13:23:45 2007
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.addressing;
+
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.Documented;
+
+import javax.xml.ws.spi.WebServiceFeatureAnnotation;
+
+@Documented
+@Retention(value=RetentionPolicy.RUNTIME)
+@Target(value=ElementType.TYPE)
+@WebServiceFeatureAnnotation(id=SubmissionAddressingFeature.ID, bean=SubmissionAddressingFeature.class)
+
+public @interface SubmissionAddressing {
+
+ public boolean enabled() default true;
+
+ public boolean required() default false;
+
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionAddressingFeature.java Tue May 29 13:23:45 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.addressing;
+
+import javax.xml.ws.WebServiceFeature;
+
+public final class SubmissionAddressingFeature extends WebServiceFeature {
+ public static final String ID = "org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature";
+
+ protected boolean required;
+
+ public SubmissionAddressingFeature() {
+ this(true, false);
+ }
+
+ public SubmissionAddressingFeature(boolean enabled) {
+ this(enabled, false);
+ }
+
+ public SubmissionAddressingFeature(boolean enabled, boolean required) {
+ this.enabled = enabled;
+ this.required = required;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ @Override
+ public String getID() {
+ return ID;
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/SubmissionEndpointReference.java Tue May 29 13:23:45 2007
@@ -0,0 +1,305 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.addressing;
+
+import java.util.HashMap;
+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.Unmarshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+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;
+
+/**
+ * <p>Java class for EndpointReferenceType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="EndpointReferenceType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Address" type="{http://schemas.xmlsoap.org/ws/2004/08/addressing}AttributedURI"/>
+ * <element name="ReferenceProperties" type="{http://schemas.xmlsoap.org/ws/2004/08/addressing}ReferencePropertiesType" minOccurs="0"/>
+ * <element name="ReferenceParameters" type="{http://schemas.xmlsoap.org/ws/2004/08/addressing}ReferenceParametersType" minOccurs="0"/>
+ * <element name="PortType" type="{http://schemas.xmlsoap.org/ws/2004/08/addressing}AttributedQName" minOccurs="0"/>
+ * <element name="ServiceName" type="{http://schemas.xmlsoap.org/ws/2004/08/addressing}ServiceNameType" minOccurs="0"/>
+ * <any/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EndpointReferenceType", propOrder = {
+ "address",
+ "referenceProperties",
+ "referenceParameters",
+ "portType",
+ "serviceName",
+ "any"
+})
+public class SubmissionEndpointReference extends EndpointReference {
+ @XmlTransient
+ private static volatile JAXBContext jaxbContext;
+ @XmlTransient
+ protected static final String NS = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+
+
+ @XmlElement(name = "Address", required = true)
+ protected AttributedURI address;
+ @XmlElement(name = "ReferenceProperties")
+ protected ReferencePropertiesType referenceProperties;
+ @XmlElement(name = "ReferenceParameters")
+ protected ReferenceParametersType referenceParameters;
+ @XmlElement(name = "PortType")
+ protected AttributedQName portType;
+ @XmlElement(name = "ServiceName")
+ protected ServiceNameType serviceName;
+ @XmlAnyElement(lax = true)
+ protected List<Object> any;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+ protected SubmissionEndpointReference() {
+ }
+
+ public SubmissionEndpointReference(Source eprInfoset) {
+ super();
+
+ try {
+ JAXBContext jaxbContext = getJAXBContext();
+ Unmarshaller um = jaxbContext.createUnmarshaller();
+ SubmissionEndpointReference subEPR =
+ (SubmissionEndpointReference) um.unmarshal(eprInfoset);
+
+ address = subEPR.address;
+ referenceParameters = subEPR.referenceParameters;
+ referenceProperties = subEPR.referenceProperties;
+ portType = subEPR.portType;
+ serviceName = subEPR.serviceName;
+ any = subEPR.any;
+ otherAttributes.putAll(subEPR.otherAttributes);
+ }
+ catch (Exception e) {
+ throw new WebServiceException("Unable to create W3C endpoint reference.", e);
+ }
+ }
+
+ @Override
+ public void writeTo(Result result) {
+ if (result == null) {
+ //TODO NLS enable
+ throw new IllegalArgumentException("Null is not allowed.");
+ }
+
+ try {
+ JAXBContext jaxbContext = getJAXBContext();
+ Marshaller m = jaxbContext.createMarshaller();
+ m.marshal(this, result);
+ }
+ catch (Exception e) {
+ //TODO NLS enable
+ throw new WebServiceException("writeTo failure.", e);
+ }
+ }
+
+ private JAXBContext getJAXBContext() throws JAXBException {
+ //This is an implementation of double-checked locking.
+ //It works because jaxbContext is volatile.
+ if (jaxbContext == null) {
+ synchronized (SubmissionEndpointReference.class) {
+ if (jaxbContext == null)
+ jaxbContext = JAXBContext.newInstance(SubmissionEndpointReference.class);
+ }
+ }
+
+ return jaxbContext;
+ }
+
+ /**
+ * <p>Java class for AttributedURI complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="AttributedURI">
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "AttributedURI", propOrder = {
+ "value"
+ })
+ private class AttributedURI {
+
+ @XmlValue
+ @XmlSchemaType(name = "anyURI")
+ protected String value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+ }
+
+ /**
+ * <p>Java class for ReferenceParametersType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ReferenceParametersType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <any/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "ReferenceParametersType", propOrder = {
+ "any"
+ })
+ private class ReferenceParametersType {
+
+ @XmlAnyElement(lax = true)
+ protected List<Object> any;
+ }
+
+ /**
+ * <p>Java class for ReferencePropertiesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ReferencePropertiesType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <any/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "ReferencePropertiesType", propOrder = {
+ "any"
+ })
+ private class ReferencePropertiesType {
+
+ @XmlAnyElement(lax = true)
+ protected List<Object> any;
+ }
+
+ /**
+ * <p>Java class for ServiceNameType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ServiceNameType">
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>QName">
+ * <attribute name="PortName" type="{http://www.w3.org/2001/XMLSchema}NCName" />
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "ServiceNameType", propOrder = {
+ "value"
+ })
+ private class ServiceNameType {
+
+ @XmlValue
+ protected QName value;
+ @XmlAttribute(name = "PortName")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlSchemaType(name = "NCName")
+ protected String portName;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+ }
+
+ /**
+ * <p>Java class for AttributedQName complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="AttributedQName">
+ * <simpleContent>
+ * <extension base="<http://www.w3.org/2001/XMLSchema>QName">
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "AttributedQName", propOrder = {
+ "value"
+ })
+ private class AttributedQName {
+
+ @XmlValue
+ protected QName value;
+ @XmlAnyAttribute
+ private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/package-info.java Tue May 29 13:23:45 2007
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.xmlsoap.org/ws/2004/08/addressing", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.axis2.jaxws.addressing;
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java Tue May 29 13:23:45 2007
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.addressing.util;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.apache.axis2.addressing.metadata.ServiceName;
+import org.apache.axis2.addressing.metadata.WSDLLocation;
+
+public final class EndpointReferenceBuilder {
+
+ public EndpointReferenceBuilder() {
+ }
+
+ public static EndpointReference createEndpointReference(String address) {
+ return new EndpointReference(address);
+ }
+
+ public static EndpointReference createEndpointReference(QName serviceName, QName endpoint, String wsdlDocumentLocation) {
+ return null;
+ }
+
+ public static EndpointReference createEndpointReference(String address,
+ QName serviceName,
+ QName endpoint,
+ List<OMElement> metadata,
+ String wsdlDocumentLocation,
+ List<OMElement> referenceParameters,
+ String addressingNamespace) throws AxisFault {
+ EndpointReference epr = new EndpointReference(address);
+ ServiceName service = new ServiceName(serviceName, endpoint.getLocalPart());
+ WSDLLocation wsdlLocation = new WSDLLocation(endpoint.getNamespaceURI(), wsdlDocumentLocation);
+ EndpointReferenceHelper.setServiceNameMetadata(epr, addressingNamespace, service);
+ EndpointReferenceHelper.setWSDLLocationMetadata(epr, addressingNamespace, wsdlLocation);
+
+ return epr;
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceConverter.java Tue May 29 13:23:45 2007
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.addressing.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.EndpointReference;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants.Final;
+import org.apache.axis2.addressing.AddressingConstants.Submission;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+import org.apache.axis2.jaxws.spi.Provider;
+import org.apache.axis2.util.XMLUtils;
+import org.w3c.dom.Node;
+
+public final class EndpointReferenceConverter {
+
+ private static OMFactory omFactory = DOOMAbstractFactory.getOMFactory();
+ private static QName eprType = new QName("namespace", "epr", "prefix");
+ private static Provider provider = new Provider();
+
+ private EndpointReferenceConverter() {
+ }
+
+ /**
+ * Convert from a {@link org.apache.axis2.addressing.EndpointReference} to a
+ * subclass of {@link EndpointReference}.
+ *
+ * @param <T>
+ * @param axis2EPR
+ * @param clazz
+ * @return
+ * @throws AxisFault
+ */
+ public static <T extends EndpointReference> T convertFromAxis2(org.apache.axis2.addressing.EndpointReference axis2EPR, Class<T> clazz)
+ throws AxisFault {
+ String addressingNamespace =
+ SubmissionEndpointReference.class.isAssignableFrom(clazz) ? Submission.WSA_NAMESPACE : Final.WSA_NAMESPACE;
+ OMElement om = EndpointReferenceHelper.toOM(omFactory, axis2EPR, eprType, addressingNamespace);
+ Source source = new DOMSource((Node) om);
+ EndpointReference jaxwsEPR = provider.readEndpointReference(source);
+
+ return clazz.cast(jaxwsEPR);
+ }
+
+ /**
+ * Convert from a {@link EndpointReference} to a an instance of
+ * {@link org.apache.axis2.addressing.EndpointReference}.
+ *
+ * @param jaxwsEPR
+ * @return
+ * @throws AxisFault
+ * @throws XMLStreamException
+ */
+ public static org.apache.axis2.addressing.EndpointReference convertToAxis2(EndpointReference jaxwsEPR)
+ throws AxisFault, XMLStreamException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ jaxwsEPR.writeTo(new StreamResult(baos));
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ OMElement eprElement = (OMElement) XMLUtils.toOM(bais);
+
+ return EndpointReferenceHelper.fromOM(eprElement);
+ }
+}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java Tue May 29 13:23:45 2007
@@ -1,20 +1,21 @@
/*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
package org.apache.axis2.jaxws.binding;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -23,7 +24,6 @@
import javax.xml.ws.Binding;
import javax.xml.ws.handler.Handler;
-import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -77,4 +77,10 @@
this.handlers = list;
}
+ /**
+ * @since JAX-WS 2.1
+ */
+ public String getBindingID() {
+ return this.bindingId;
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/BaseDispatch.java Tue May 29 13:23:45 2007
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.client.dispatch;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.jaxws.BindingProvider;
import org.apache.axis2.jaxws.ExceptionFactory;
@@ -29,6 +30,7 @@
import org.apache.axis2.jaxws.core.controller.AxisInvocationController;
import org.apache.axis2.jaxws.core.controller.InvocationController;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigUtil;
import org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils;
import org.apache.axis2.jaxws.message.Message;
import org.apache.axis2.jaxws.spi.Constants;
@@ -39,9 +41,9 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
import javax.xml.ws.ProtocolException;
import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.http.HTTPBinding;
@@ -60,8 +62,12 @@
protected Mode mode;
- protected BaseDispatch(ServiceDelegate svcDelgate, EndpointDescription epDesc) {
- super(svcDelgate, epDesc);
+ protected BaseDispatch(ServiceDelegate svcDelgate,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelgate, epDesc, epr, addressingNamespace, features);
ic = new AxisInvocationController();
}
@@ -116,7 +122,6 @@
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvalidParam"));
}
- setupMessageProperties(requestMsg);
requestMsgCtx.setMessage(requestMsg);
// Migrate the properties from the client request context bag to
@@ -125,6 +130,11 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the client-side configuration, as specified during the invocation.
+ WebServiceFeatureConfigUtil.performConfiguration(
+ Constants.WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID,
+ requestMsgCtx, this);
+
// Send the request using the InvocationController
ic.invoke(invocationContext);
@@ -187,7 +197,6 @@
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvalidParam"));
}
- setupMessageProperties(requestMsg);
requestMsgCtx.setMessage(requestMsg);
// Migrate the properties from the client request context bag to
@@ -196,6 +205,11 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the client-side configuration, as specified during the invocation.
+ WebServiceFeatureConfigUtil.performConfiguration(
+ Constants.WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID,
+ requestMsgCtx, this);
+
// Send the request using the InvocationController
ic.invokeOneWay(invocationContext);
@@ -241,7 +255,6 @@
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvalidParam"));
}
- setupMessageProperties(requestMsg);
requestMsgCtx.setMessage(requestMsg);
// Migrate the properties from the client request context bag to
@@ -250,6 +263,11 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the client-side configuration, as specified during the invocation.
+ WebServiceFeatureConfigUtil.performConfiguration(
+ Constants.WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID,
+ requestMsgCtx, this);
+
// Setup the Executor that will be used to drive async responses back to
// the client.
// FIXME: We shouldn't be getting this from the ServiceDelegate, rather each
@@ -306,7 +324,6 @@
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvalidParam"));
}
- setupMessageProperties(requestMsg);
requestMsgCtx.setMessage(requestMsg);
// Migrate the properties from the client request context bag to
@@ -315,6 +332,11 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), requestMsgCtx);
+ // Perform the client-side configuration, as specified during the invocation.
+ WebServiceFeatureConfigUtil.performConfiguration(
+ Constants.WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID,
+ requestMsgCtx, this);
+
// Setup the Executor that will be used to drive async responses back to
// the client.
// FIXME: We shouldn't be getting this from the ServiceDelegate, rather each
@@ -393,29 +415,6 @@
return true;
else
return false;
- }
-
- /*
- * Configure any properties that will be needed on the Message
- */
- private void setupMessageProperties(Message msg) {
- // If the user has enabled MTOM on the SOAPBinding, we need
- // to make sure that gets pushed to the Message object.
- Binding binding = getBinding();
- if (binding != null && binding instanceof SOAPBinding) {
- SOAPBinding soapBinding = (SOAPBinding)binding;
- if (soapBinding.isMTOMEnabled())
- msg.setMTOMEnabled(true);
- }
-
- // Check if the user enabled MTOM using the SOAP binding
- // properties for MTOM
- String bindingID = endpointDesc.getClientBindingID();
- if ((bindingID.equalsIgnoreCase(SOAPBinding.SOAP11HTTP_MTOM_BINDING) ||
- bindingID.equalsIgnoreCase(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) &&
- !msg.isMTOMEnabled()) {
- msg.setMTOMEnabled(true);
- }
}
/*
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java Tue May 29 13:23:45 2007
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.client.dispatch;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -28,9 +29,6 @@
import org.apache.axis2.jaxws.message.factory.BlockFactory;
import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
import org.apache.axis2.jaxws.message.factory.MessageFactory;
-import org.apache.axis2.jaxws.message.factory.SOAPEnvelopeBlockFactory;
-import org.apache.axis2.jaxws.message.factory.SourceBlockFactory;
-import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.spi.ServiceDelegate;
import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
@@ -40,16 +38,26 @@
import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import javax.xml.transform.Source;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
public class JAXBDispatch<T> extends BaseDispatch<T> {
private static final Log log = LogFactory.getLog(JAXBDispatch.class);
private JAXBContext jaxbContext;
- public JAXBDispatch(ServiceDelegate svcDelegate, EndpointDescription epDesc) {
- super(svcDelegate, epDesc);
+ public JAXBDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription epDesc,
+ WebServiceFeature... features) {
+ this(svcDelegate, epDesc, null, null, features);
+ }
+
+ public JAXBDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelegate, epDesc, epr, addressingNamespace, features);
}
public JAXBContext getJAXBContext() {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java Tue May 29 13:23:45 2007
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.client.dispatch;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -40,14 +41,25 @@
import javax.xml.transform.Source;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
public class XMLDispatch<T> extends BaseDispatch<T> {
private static final Log log = LogFactory.getLog(XMLDispatch.class);
private Class type;
private Class blockFactoryType;
- public XMLDispatch(ServiceDelegate svcDelegate, EndpointDescription enpdointDesc) {
- super(svcDelegate, enpdointDesc);
+ public XMLDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription endpointDesc,
+ WebServiceFeature... features) {
+ this(svcDelegate, endpointDesc, null, null, features);
+ }
+
+ public XMLDispatch(ServiceDelegate svcDelegate,
+ EndpointDescription endpointDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(svcDelegate, endpointDesc, epr, addressingNamespace, features);
}
public Class getType() {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Tue May 29 13:23:45 2007
@@ -18,7 +18,7 @@
*/
package org.apache.axis2.jaxws.client.proxy;
-import javax.xml.ws.handler.HandlerResolver;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.BindingProvider;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.client.async.AsyncResponse;
@@ -30,6 +30,7 @@
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigUtil;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
import org.apache.axis2.jaxws.message.Message;
@@ -40,9 +41,8 @@
import org.apache.commons.logging.LogFactory;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Binding;
import javax.xml.ws.Response;
-import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceFeature;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -84,9 +84,21 @@
private Method method = null;
- public JAXWSProxyHandler(ServiceDelegate delegate, Class seiClazz, EndpointDescription epDesc) {
- super(delegate, epDesc);
+ public JAXWSProxyHandler(ServiceDelegate delegate,
+ Class seiClazz,
+ EndpointDescription epDesc,
+ WebServiceFeature... features) {
+ this(delegate, seiClazz, epDesc, null, null, features);
+ }
+ public JAXWSProxyHandler(ServiceDelegate delegate,
+ Class seiClazz,
+ EndpointDescription epDesc,
+ EndpointReference epr,
+ String addressingNamespace,
+ WebServiceFeature... features) {
+ super(delegate, epDesc, epr, addressingNamespace, features);
+
this.seiClazz = seiClazz;
this.serviceDesc = delegate.getServiceDescription();
}
@@ -160,15 +172,6 @@
request.setEndpointDescription(getEndpointDescription());
request.setOperationDescription(operationDesc);
- // Enable MTOM on the Message if the property was set on the SOAPBinding.
- Binding bnd = getBinding();
- if (bnd != null && bnd instanceof SOAPBinding) {
- if (((SOAPBinding)bnd).isMTOMEnabled()) {
- Message requestMsg = request.getMessage();
- requestMsg.setMTOMEnabled(true);
- }
- }
-
/*
* TODO: review: make sure the handlers are set on the InvocationContext
* This implementation of the JAXWS runtime does not use Endpoint, which
@@ -183,19 +186,9 @@
// be sure to use whatever handlerresolver is registered on the Service
//HandlerResolver handlerResolver = serviceDelegate.getHandlerResolver();
//bnd.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
- requestIC.setHandlers(bnd.getHandlerChain());
-
- // Before we invoke, copy all of the properties from the client request
- // context to the MessageContext
- // TODO: Add the plug point for property migration
- request.getProperties().putAll(getRequestContext());
-
+ requestIC.setHandlers(getBinding().getHandlerChain());
requestIC.setRequestMessageContext(request);
requestIC.setServiceClient(serviceDelegate.getServiceClient(endpointDesc.getPortQName()));
-
- // TODO: Change this to some form of factory so that we can change the IC to
- // a more simple one for marshaller/unmarshaller testing.
- InvocationController controller = new AxisInvocationController();
// Migrate the properties from the client request context bag to
// the request MessageContext.
@@ -203,6 +196,15 @@
Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
getRequestContext(), request);
+ // Perform the client-side configuration, as specified during the invocation.
+ WebServiceFeatureConfigUtil.performConfiguration(
+ Constants.WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID,
+ request, this);
+
+ // TODO: Change this to some form of factory so that we can change the IC to
+ // a more simple one for marshaller/unmarshaller testing.
+ InvocationController controller = new AxisInvocationController();
+
// Check if the call is OneWay, Async or Sync
if (operationDesc.isOneWay()) {
if (log.isDebugEnabled()) {
@@ -294,7 +296,7 @@
return null;
}
-
+
private AsyncResponse createProxyListener(Object[] args, OperationDescription operationDesc) {
ProxyAsyncListener listener = new ProxyAsyncListener(operationDesc);
listener.setHandler(this);
@@ -334,9 +336,6 @@
MessageContext request = new MessageContext();
request.setMessage(message);
-
- // TODO: What happens here might be affected by the property migration plugpoint.
- request.getProperties().putAll(getRequestContext());
if (log.isDebugEnabled()) {
log.debug("Request MessageContext created successfully.");
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java Tue May 29 13:23:45 2007
@@ -18,8 +18,15 @@
*/
package org.apache.axis2.jaxws.context;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
+import org.w3c.dom.Element;
+
import java.security.Principal;
public class WebServiceContextImpl implements WebServiceContext {
@@ -58,4 +65,18 @@
this.soapMessageContext = soapMessageContext;
}
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
+ if (!SubmissionEndpointReference.class.isAssignableFrom(clazz) &&
+ !W3CEndpointReference.class.isAssignableFrom(clazz))
+ throw ExceptionFactory.makeWebServiceException("Unrecognized class type " + clazz.getCanonicalName());
+
+ T jaxwsEPR = null;
+
+
+ return jaxwsEPR;
+ }
+
+ public EndpointReference getEndpointReference(Element... arg0) {
+ return getEndpointReference(W3CEndpointReference.class, arg0);
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java Tue May 29 13:23:45 2007
@@ -373,19 +373,22 @@
protected void prepareResponse(MessageContext responseMsgCtx) {
}
-
+
private void initOperationClient(OperationClient opClient, MessageContext requestMsgCtx) {
org.apache.axis2.context.MessageContext axisRequest = requestMsgCtx.getAxisMessageContext();
setupProperties(requestMsgCtx, axisRequest.getOptions());
- Options options = opClient.getOptions();
if (opClient != null) {
+ Options options = opClient.getOptions();
+
// Get the target endpoint address and setup the TO endpoint
// reference. This tells us where the request is going.
- String targetUrl = (String)requestMsgCtx.getProperties().get(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
- EndpointReference toEPR = new EndpointReference(targetUrl);
- options.setTo(toEPR);
+ if (options.getTo() == null) {
+ String targetUrl = (String)requestMsgCtx.getProperties().get(
+ BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+ EndpointReference toEPR = new EndpointReference(targetUrl);
+ options.setTo(toEPR);
+ }
// Get the SOAP Action (if needed)
String soapAction = ClientUtils.findSOAPAction(requestMsgCtx);
@@ -476,6 +479,7 @@
ops.setProperty(key, value);
}
+ //TODO Do I have to leave this here or can I move it to the MTOMConfigurator.
// Enable MTOM
Message msg = mc.getMessage();
if (msg.isMTOMEnabled()) {
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/WebServiceFeatureValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/WebServiceFeatureValidator.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/WebServiceFeatureValidator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/WebServiceFeatureValidator.java Tue May 29 13:23:45 2007
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature;
+
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+
+import javax.xml.ws.RespectBindingFeature;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.MTOMFeature;
+
+import java.util.IdentityHashMap;
+import java.util.Map;
+
+public class WebServiceFeatureValidator {
+ private static final WebServiceFeature DEFAULT_ADDRESSING_FEATURE = new AddressingFeature();
+ private static final WebServiceFeature DEFAULT_SUBMISSION_ADDRESSING_FEATURE = new SubmissionAddressingFeature();
+ private static final WebServiceFeature DEFAULT_MTOM_FEATURE = new MTOMFeature();
+ private static final WebServiceFeature DEFAULT_RESPECT_BINDING_FEATURE = new RespectBindingFeature();
+
+ private static final WebServiceFeature DEFAULT_CLIENT_SIDE_ADDRESSING_FEATURE = new AddressingFeature(false);
+ private static final WebServiceFeature DEFAULT_CLIENT_SIDE_SUBMISSION_ADDRESSING_FEATURE = new SubmissionAddressingFeature(false);
+ private static final WebServiceFeature DEFAULT_CLIENT_SIDE_MTOM_FEATURE = new MTOMFeature(false);
+
+ private static final WebServiceFeature[] ZERO_LENGTH_ARRAY = new WebServiceFeature[0];
+
+ private Map<String, WebServiceFeature> featureMap;
+
+ public WebServiceFeatureValidator(boolean isServerSide) {
+ //Set up default WebServiceFeatures.
+ featureMap = new IdentityHashMap<String, WebServiceFeature>();
+
+ if (isServerSide) {
+ featureMap.put(AddressingFeature.ID, DEFAULT_ADDRESSING_FEATURE);
+ featureMap.put(SubmissionAddressingFeature.ID, DEFAULT_SUBMISSION_ADDRESSING_FEATURE);
+ featureMap.put(MTOMFeature.ID, DEFAULT_MTOM_FEATURE);
+ }
+ else {
+ featureMap.put(AddressingFeature.ID, DEFAULT_CLIENT_SIDE_ADDRESSING_FEATURE);
+ featureMap.put(SubmissionAddressingFeature.ID, DEFAULT_CLIENT_SIDE_SUBMISSION_ADDRESSING_FEATURE);
+ featureMap.put(MTOMFeature.ID, DEFAULT_CLIENT_SIDE_MTOM_FEATURE);
+ }
+
+ featureMap.put(RespectBindingFeature.ID, DEFAULT_RESPECT_BINDING_FEATURE);
+ }
+
+ public WebServiceFeatureValidator(boolean isServerSide, WebServiceFeature... features) {
+ this(isServerSide);
+
+ if (features != null) {
+ for (WebServiceFeature feature : features) {
+ put(feature);
+ }
+ }
+ }
+
+ public boolean isValid(WebServiceFeature feature) {
+ return featureMap.containsKey(feature.getID());
+ }
+
+ public void put(WebServiceFeature feature) {
+ if (feature != null) {
+ //TODO NLS enable.
+ if (!isValid(feature))
+ throw ExceptionFactory.makeWebServiceException("Unrecognized WebServiceFeature " + feature.getID());
+
+ featureMap.put(feature.getID(), feature);
+ }
+ }
+
+ public WebServiceFeature get(String featureID) {
+ return featureMap.get(featureID);
+ }
+
+ public WebServiceFeature[] getAll() {
+ return featureMap.values().toArray(ZERO_LENGTH_ARRAY);
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/MTOMConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/MTOMConfigurator.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/MTOMConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/MTOMConfigurator.java Tue May 29 13:23:45 2007
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature.config;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.apache.axis2.jaxws.binding.SOAPBinding;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.WebServiceFeatureValidator;
+import org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator;
+import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class MTOMConfigurator implements WebServiceFeatureConfigurator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+ */
+ public void performConfiguration(MessageContext messageContext, BindingProvider provider) {
+ Binding bnd = provider.getBinding();
+ if (bnd instanceof SOAPBinding) {
+ WebServiceFeatureValidator validator = provider.getWebServiceFeatureValidator();
+ MTOMFeature mtomFeature = (MTOMFeature) validator.get(MTOMFeature.ID);
+ Message requestMsg = messageContext.getMessage();
+
+ if (mtomFeature.isEnabled()) {
+ requestMsg.setMTOMEnabled(true);
+
+ //TODO: Make use of the threshold somehow.
+ int threshold = mtomFeature.getThreshold();
+ }
+
+ // If the user has enabled MTOM on the SOAPBinding, we need
+ // to make sure that gets pushed to the Message object.
+ if (((SOAPBinding)bnd).isMTOMEnabled()) {
+ requestMsg.setMTOMEnabled(true);
+ }
+
+ // Check if the user enabled MTOM using the SOAP binding
+ // properties for MTOM
+ String bindingID = messageContext.getEndpointDescription().getClientBindingID();
+ if ((bindingID.equalsIgnoreCase(SOAPBinding.SOAP11HTTP_MTOM_BINDING) ||
+ bindingID.equalsIgnoreCase(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) &&
+ !requestMsg.isMTOMEnabled()) {
+ requestMsg.setMTOMEnabled(true);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.description.ServiceDescription)
+ */
+ public void performConfiguration(ServiceDescription serviceDescription) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/RespectBindingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/RespectBindingConfigurator.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/RespectBindingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/RespectBindingConfigurator.java Tue May 29 13:23:45 2007
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature.config;
+
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.WebServiceFeatureValidator;
+import org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class RespectBindingConfigurator implements WebServiceFeatureConfigurator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+ */
+ public void performConfiguration(MessageContext messageContext, BindingProvider provider) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.description.ServiceDescription)
+ */
+ public void performConfiguration(ServiceDescription serviceDescription) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/W3CAndSubmissionAddressingConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/W3CAndSubmissionAddressingConfigurator.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/W3CAndSubmissionAddressingConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/config/W3CAndSubmissionAddressingConfigurator.java Tue May 29 13:23:45 2007
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature.config;
+
+import java.util.Map;
+
+import javax.xml.ws.Binding;
+import javax.xml.ws.soap.AddressingFeature;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.AddressingConstants.Final;
+import org.apache.axis2.addressing.AddressingConstants.Submission;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.addressing.SubmissionAddressingFeature;
+import org.apache.axis2.jaxws.binding.SOAPBinding;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.feature.WebServiceFeatureValidator;
+import org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public class W3CAndSubmissionAddressingConfigurator implements WebServiceFeatureConfigurator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.core.MessageContext, org.apache.axis2.jaxws.spi.BindingProvider)
+ */
+ public void performConfiguration(MessageContext messageContext, BindingProvider provider) {
+ Binding bnd = provider.getBinding();
+ if (bnd instanceof SOAPBinding) {
+ WebServiceFeatureValidator validator = provider.getWebServiceFeatureValidator();
+ AddressingFeature addressingFeature =
+ (AddressingFeature) validator.get(AddressingFeature.ID);
+ SubmissionAddressingFeature submissionAddressingFeature =
+ (SubmissionAddressingFeature) validator.get(SubmissionAddressingFeature.ID);
+ Map<String, Object> properties = messageContext.getProperties();
+
+ if (addressingFeature.isEnabled() || submissionAddressingFeature.isEnabled()) {
+ String addressingNamespace = provider.getAddressingNamespace();
+
+ //Make sure that the feature that has been enabled and the addressing namespace
+ //are consistent with each other.
+ if (addressingFeature.isEnabled() && !submissionAddressingFeature.isEnabled()) {
+ //TODO NLS enable.
+ if (!Final.WSA_NAMESPACE.equals(addressingNamespace))
+ throw ExceptionFactory.makeWebServiceException("The namespace of the endpoint reference is different to the namespace of the addressing WebServiceFeature.");
+ }
+
+ if (submissionAddressingFeature.isEnabled() && !addressingFeature.isEnabled()) {
+ //TODO NLS enable.
+ if (!Submission.WSA_NAMESPACE.equals(addressingNamespace))
+ throw ExceptionFactory.makeWebServiceException("The namespace of the endpoint reference is different to the namespace of the submission addressing WebServiceFeature.");
+ }
+
+ org.apache.axis2.context.MessageContext msgContext = messageContext.getAxisMessageContext();
+ msgContext.setTo(provider.getAxis2EndpointReference());
+
+ try {
+ ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
+ AxisConfiguration axisConfig = sd.getAxisConfigContext().getAxisConfiguration();
+ if (!axisConfig.isEngaged(Constants.MODULE_ADDRESSING))
+ axisConfig.engageModule(Constants.MODULE_ADDRESSING);
+ }
+ catch (Exception e) {
+ //TODO NLS enable.
+ throw ExceptionFactory.makeWebServiceException("Unable to engage the addressing module.", e);
+ }
+
+ properties.put(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
+ properties.put(AddressingConstants.WS_ADDRESSING_VERSION, addressingNamespace);
+ }
+ else {
+ properties.put(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.axis2.jaxws.feature.util.WebServiceFeatureConfigurator#performConfiguration(org.apache.axis2.jaxws.description.ServiceDescription)
+ */
+ public void performConfiguration(ServiceDescription serviceDescription) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigUtil.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigUtil.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigUtil.java Tue May 29 13:23:45 2007
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature.util;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+public class WebServiceFeatureConfigUtil {
+
+ private static final Log log = LogFactory.getLog(WebServiceFeatureConfigUtil.class);
+
+ /**
+ *
+ * @param configurationContext
+ * @param contextConfiguratorListID
+ * @param configurator
+ */
+ public static void addWebServiceFeatureConfigurator(ConfigurationContext configurationContext,
+ String contextConfiguratorListID,
+ WebServiceFeatureConfigurator configurator) {
+ List<WebServiceFeatureConfigurator> migratorList =
+ (List<WebServiceFeatureConfigurator>)configurationContext
+ .getProperty(contextConfiguratorListID);
+
+ if (migratorList == null) {
+ migratorList = new LinkedList<WebServiceFeatureConfigurator>();
+ configurationContext.setProperty(contextConfiguratorListID, migratorList);
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Adding WebServiceFeatureConfigurator: " + configurator.getClass().getName());
+ }
+ migratorList.add(configurator);
+ }
+
+ /**
+ *
+ * @param contextConfiguratorListID
+ * @param messageContext
+ * @param provider
+ */
+ public static void performConfiguration(String contextConfiguratorListID,
+ MessageContext messageContext,
+ BindingProvider provider) {
+ if (messageContext == null) {
+ throw ExceptionFactory.makeWebServiceException("Null MessageContext");
+ }
+
+ ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
+ if (sd != null) {
+ ConfigurationContext configCtx = sd.getAxisConfigContext();
+ List<WebServiceFeatureConfigurator> migratorList =
+ (List<WebServiceFeatureConfigurator>)configCtx.getProperty(contextConfiguratorListID);
+
+ if (migratorList != null) {
+ ListIterator<WebServiceFeatureConfigurator> itr = migratorList.listIterator();
+ while (itr.hasNext()) {
+ WebServiceFeatureConfigurator con = itr.next();
+ if (log.isDebugEnabled()) {
+ log.debug("configurator: " + con.getClass().getName() +
+ ".performConfiguration");
+ }
+ con.performConfiguration(messageContext, provider);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @param contextConfiguratorListID
+ * @param messageContext
+ * @param provider
+ */
+ public static void performConfiguration(String contextConfiguratorListID,
+ ServiceDescription serviceDescription) {
+ if (serviceDescription == null) {
+ throw ExceptionFactory.makeWebServiceException("Null Service Description");
+ }
+
+ ConfigurationContext configCtx = serviceDescription.getAxisConfigContext();
+ List<WebServiceFeatureConfigurator> migratorList =
+ (List<WebServiceFeatureConfigurator>)configCtx.getProperty(contextConfiguratorListID);
+
+ if (migratorList != null) {
+ ListIterator<WebServiceFeatureConfigurator> itr = migratorList.listIterator();
+ while (itr.hasNext()) {
+ WebServiceFeatureConfigurator con = itr.next();
+ if (log.isDebugEnabled()) {
+ log.debug("configurator: " + con.getClass().getName() +
+ ".performConfiguration");
+ }
+ con.performConfiguration(serviceDescription);
+ }
+ }
+ }
+}
Added: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigurator.java?view=auto&rev=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigurator.java (added)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/feature/util/WebServiceFeatureConfigurator.java Tue May 29 13:23:45 2007
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.jaxws.feature.util;
+
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.spi.BindingProvider;
+
+/**
+ *
+ */
+public interface WebServiceFeatureConfigurator {
+
+ /**
+ * Perform client-side configuration for a <code>WebServiceFeature</code>.
+ *
+ * @param messageContext
+ * @param provider
+ */
+ public void performConfiguration(MessageContext messageContext, BindingProvider provider);
+
+ /**
+ * Perform server-side configuration for a <code>WebServiceFeature</code>.
+ *
+ * @param serviceDescription
+ */
+ public void performConfiguration(ServiceDescription serviceDescription);
+}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java Tue May 29 13:23:45 2007
@@ -22,7 +22,7 @@
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.binding.BindingImpl;
+import org.apache.axis2.jaxws.addressing.SubmissionEndpointReference;
import org.apache.axis2.jaxws.binding.BindingUtils;
import org.apache.axis2.jaxws.description.DescriptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -30,9 +30,12 @@
import org.apache.axis2.transport.http.HTTPWorkerFactory;
import org.apache.axis2.transport.http.server.SimpleHttpServer;
import org.apache.axis2.transport.http.server.WorkerFactory;
+import org.w3c.dom.Element;
import javax.xml.transform.Source;
import javax.xml.ws.Binding;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
import java.io.IOException;
import java.util.List;
@@ -201,5 +204,23 @@
} catch (InterruptedException e) {
e.printStackTrace();
}
+ }
+
+ @Override
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters) {
+ if (!SubmissionEndpointReference.class.isAssignableFrom(clazz) &&
+ !W3CEndpointReference.class.isAssignableFrom(clazz))
+ throw ExceptionFactory.makeWebServiceException("Unrecognized class type " + clazz.getCanonicalName());
+
+ T jaxwsEPR = null;
+
+
+
+ return jaxwsEPR;
+ }
+
+ @Override
+ public EndpointReference getEndpointReference(Element... arg0) {
+ return getEndpointReference(W3CEndpointReference.class, arg0);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/BindingProvider.java Tue May 29 13:23:45 2007
@@ -18,7 +18,9 @@
*/
package org.apache.axis2.jaxws.spi;
+import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.feature.WebServiceFeatureValidator;
/**
*
@@ -28,4 +30,9 @@
public ServiceDelegate getServiceDelegate();
+ public EndpointReference getAxis2EndpointReference();
+
+ public String getAddressingNamespace();
+
+ public WebServiceFeatureValidator getWebServiceFeatureValidator();
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java?view=diff&rev=542643&r1=542642&r2=542643
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java Tue May 29 13:23:45 2007
@@ -50,6 +50,12 @@
public static final String APPLICATION_CONTEXT_MIGRATOR_LIST_ID =
"org.apache.axis2.jaxws.spi.ApplicationContextMigrators";
+ // Value = Colletion
+ // Usage: A list of WebServiceFeatureConfigurators that are called to configure the client or
+ // server as appropriate.
+ public static final String WEB_SERVICE_FEATURE_CONFIGURATOR_LIST_ID =
+ "org.apache.axis2.jaxws.spi.WebServiceFeatureConfigurators";
+
/** Intentionally Private */
private Constants() {
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org