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/10/30 13:11:15 UTC
svn commit: r590048 [9/9] - in /webservices/axis2/branches/java/jaxws21:
legal/ modules/adb-codegen/ modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/sch...
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Tue Oct 30 05:10:34 2007
@@ -295,6 +295,7 @@
}
} catch (AxisFault axisFault) {
log.error(axisFault.getMessage(), axisFault);
+ throw axisFault;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java Tue Oct 30 05:10:34 2007
@@ -155,7 +155,7 @@
}
}
- public static String getConstantFromHTTPLocation(String httpLocation) {
+ public static String getConstantFromHTTPLocation(String httpLocation, String httpMethod) {
if (httpLocation.charAt(0) != '?') {
httpLocation = "/" + httpLocation;
}
@@ -163,7 +163,7 @@
if (index > -1) {
httpLocation = httpLocation.substring(0, index);
}
- return httpLocation;
+ return httpMethod + httpLocation;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Counter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Counter.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Counter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Counter.java Tue Oct 30 05:10:34 2007
@@ -22,12 +22,32 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-// Counter uses java.util.concurrent.atomic.AtomicLong if present,
-// else falls back to the backport version
+/**
+ * This class provides a simple zero-based counter with synchronized access.
+ */
public class Counter {
+
private long value = 0L;
public synchronized long incrementAndGet() {
return ++value;
}
+
+ public synchronized long decrementAndGet() {
+ if (value > 0L) {
+ return --value;
+ }
+ else {
+ return value;
+ }
+ }
+
+ public synchronized void reset() {
+ value = 0L;
+ }
+
+ public synchronized long get() {
+ return value;
+ }
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/FileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/FileWriter.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/FileWriter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/FileWriter.java Tue Oct 30 05:10:34 2007
@@ -57,7 +57,7 @@
}
}
- if (!fileName.endsWith(extension)) {
+ if ((extension != null) && !fileName.endsWith(extension)) {
fileName = fileName + extension;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java Tue Oct 30 05:10:34 2007
@@ -188,6 +188,8 @@
WSDL2Constants.URI_WSDL2_SOAP));
binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap,
WSDL2Constants.SOAP_VERSION_1_1));
+ binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_PROTOCOL, wsoap,
+ WSDL2Constants.HTTP_PROTOCAL));
generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
return binding;
}
@@ -215,6 +217,8 @@
WSDL2Constants.URI_WSDL2_SOAP));
binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap,
WSDL2Constants.SOAP_VERSION_1_2));
+ binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_PROTOCOL, wsoap,
+ WSDL2Constants.HTTP_PROTOCAL));
generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
return binding;
}
@@ -281,14 +285,15 @@
* @param tns - The targetnamespace
* @param axisService - The AxisService
* @param disableREST only generate REST endpoint if this is false
+ * @param disableSOAP12 only generate SOAP 1.2 endpoint if this is false
* @return - The generated service element
* @throws AxisFault - Thrown in case an exception occurs
*/
public static OMElement generateServiceElement(OMFactory omFactory, OMNamespace wsdl,
OMNamespace tns, AxisService axisService,
- boolean disableREST)
+ boolean disableREST, boolean disableSOAP12)
throws AxisFault {
- return generateServiceElement(omFactory, wsdl, tns, axisService, disableREST, null);
+ return generateServiceElement(omFactory, wsdl, tns, axisService, disableREST, disableSOAP12, null);
}
/**
@@ -298,12 +303,13 @@
* @param tns - The targetnamespace
* @param axisService - The AxisService
* @param disableREST only generate REST endpoint if this is false
+ * @param disableSOAP12 only generate SOAP 1.2 endpoint if this is false
* @return - The generated service element
* @throws AxisFault - Thrown in case an exception occurs
*/
public static OMElement generateServiceElement(OMFactory omFactory, OMNamespace wsdl,
OMNamespace tns, AxisService axisService,
- boolean disableREST, String[] eprs)
+ boolean disableREST, boolean disableSOAP12, String[] eprs)
throws AxisFault {
if(eprs == null){
eprs = axisService.getEPRs();
@@ -324,6 +330,7 @@
if (epr.startsWith("https://")) {
name = WSDL2Constants.DEFAULT_HTTPS_PREFIX;
}
+
OMElement soap11EndpointElement =
omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
soap11EndpointElement.addAttribute(omFactory.createOMAttribute(
@@ -336,18 +343,23 @@
soap11EndpointElement.addAttribute(
omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));
serviceElement.addChild(soap11EndpointElement);
- OMElement soap12EndpointElement =
- omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
- soap12EndpointElement.addAttribute(omFactory.createOMAttribute(
- WSDL2Constants.ATTRIBUTE_NAME, null,
- name + WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME));
- soap12EndpointElement.addAttribute(omFactory.createOMAttribute(
- WSDL2Constants.BINDING_LOCAL_NAME, null,
- tns.getPrefix() + ":" + axisService.getName() +
- Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
- soap12EndpointElement.addAttribute(
- omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));
- serviceElement.addChild(soap12EndpointElement);
+
+ OMElement soap12EndpointElement = null;
+ if (!disableSOAP12) {
+ soap12EndpointElement =
+ omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
+ soap12EndpointElement.addAttribute(omFactory.createOMAttribute(
+ WSDL2Constants.ATTRIBUTE_NAME, null,
+ name + WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME));
+ soap12EndpointElement.addAttribute(omFactory.createOMAttribute(
+ WSDL2Constants.BINDING_LOCAL_NAME, null,
+ tns.getPrefix() + ":" + axisService.getName() +
+ Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
+ soap12EndpointElement.addAttribute(
+ omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));
+ serviceElement.addChild(soap12EndpointElement);
+ }
+
OMElement httpEndpointElement = null;
if (!disableREST) {
httpEndpointElement =
@@ -363,13 +375,16 @@
omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));
serviceElement.addChild(httpEndpointElement);
}
+
if (epr.startsWith("https://")) {
OMElement soap11Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
soap11Documentation.setText("This endpoint exposes a SOAP 11 binding over a HTTPS");
soap11EndpointElement.addChild(soap11Documentation);
- OMElement soap12Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
- soap12Documentation.setText("This endpoint exposes a SOAP 12 binding over a HTTPS");
- soap12EndpointElement.addChild(soap12Documentation);
+ if (!disableSOAP12) {
+ OMElement soap12Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
+ soap12Documentation.setText("This endpoint exposes a SOAP 12 binding over a HTTPS");
+ soap12EndpointElement.addChild(soap12Documentation);
+ }
if (!disableREST) {
OMElement httpDocumentation =
omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
@@ -380,9 +395,11 @@
OMElement soap11Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
soap11Documentation.setText("This endpoint exposes a SOAP 11 binding over a HTTP");
soap11EndpointElement.addChild(soap11Documentation);
- OMElement soap12Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
- soap12Documentation.setText("This endpoint exposes a SOAP 12 binding over a HTTP");
- soap12EndpointElement.addChild(soap12Documentation);
+ if (!disableSOAP12) {
+ OMElement soap12Documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
+ soap12Documentation.setText("This endpoint exposes a SOAP 12 binding over a HTTP");
+ soap12EndpointElement.addChild(soap12Documentation);
+ }
if (!disableREST) {
OMElement httpDocumentation =
omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/pom.xml Tue Oct 30 05:10:34 2007
@@ -140,6 +140,9 @@
<fileset dir="test-resources/">
<include name="**/*.properties"/>
</fileset>
+ <fileset dir="test">
+ <include name="org/apache/axis2/jaxws/description/HandlerConfigFile.xml"/>
+ </fileset>
</copy>
</tasks>
</configuration>
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java Tue Oct 30 05:10:34 2007
@@ -22,13 +22,23 @@
*/
package org.apache.axis2.jaxws.description.builder;
+import org.apache.axis2.jaxws.util.WSDL4JWrapper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
import javax.wsdl.Definition;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
public class DescriptionBuilderComposite implements TMAnnotationComposite, TMFAnnotationComposite {
+
+ private static final Log log = LogFactory.getLog(DescriptionBuilderComposite.class);
+
/*
* This structure contains the full reflected class, as well as, the
* possible annotations found for this class...the class description
@@ -42,6 +52,8 @@
fieldDescriptions = new ArrayList<FieldDescriptionComposite>();
webServiceRefAnnotList = new ArrayList<WebServiceRefAnnot>();
interfacesList = new ArrayList<String>();
+ genericAnnotationInstances = new ArrayList<CustomAnnotationInstance>();
+ genericAnnotationProcessors = new HashMap<String, CustomAnnotationProcessor>();
}
//Class type within the module
@@ -53,6 +65,7 @@
//Note: a WSDL is not necessary
private Definition wsdlDefinition = null;
private URL wsdlURL = null;
+ private WSDL4JWrapper wsdlWrapper = null;
// Class-level annotations
private WebServiceAnnot webServiceAnnot;
@@ -75,6 +88,13 @@
private List<MethodDescriptionComposite> methodDescriptions;
private List<FieldDescriptionComposite> fieldDescriptions;
+
+ // we can keep these in a singular list b/c for a given type-level annotation
+ // there can only one instance of the annotation
+ private List<CustomAnnotationInstance> genericAnnotationInstances;
+
+ // a map that stores all the type-targetted GenericAnnotationProcessor instances
+ private Map<String, CustomAnnotationProcessor> genericAnnotationProcessors;
private WsdlGenerator wsdlGenerator;
private ClassLoader classLoader;
@@ -166,6 +186,13 @@
/** @return Returns the wsdlDefinition */
public Definition getWsdlDefinition() {
+ if (wsdlDefinition != null) {
+ return wsdlDefinition;
+ } else if (wsdlWrapper != null) {
+ wsdlDefinition = wsdlWrapper.getDefinition();
+ } else {
+ wsdlDefinition = createWsdlDefinition(wsdlURL);
+ }
return wsdlDefinition;
}
@@ -318,10 +345,62 @@
public void setWebServiceRefAnnot(WebServiceRefAnnot webServiceRefAnnot) {
addWebServiceRefAnnot(webServiceRefAnnot);
}
+
+ public void addCustomAnnotationProcessor(CustomAnnotationProcessor processor) {
+ genericAnnotationProcessors.put(processor.getAnnotationInstanceClassName(), processor);
+ }
+
+ public Map<String, CustomAnnotationProcessor> getCustomAnnotationProcessors() {
+ return genericAnnotationProcessors;
+ }
+
+ public void addCustomAnnotationInstance(CustomAnnotationInstance annotation) {
+ genericAnnotationInstances.add(annotation);
+ }
+
+ public List<CustomAnnotationInstance> getCustomAnnotationInstances() {
+ return genericAnnotationInstances;
+ }
+
+
+ /**
+ * @param wsdlDefinition The wsdlDefinition to set.
+ */
+ public void setWsdlDefinition(Definition wsdlDef) {
+
+ Definition def = null;
+
+ if (wsdlDef != null) {
+ if (wsdlDef instanceof WSDL4JWrapper) {
+ wsdlWrapper = (WSDL4JWrapper) wsdlDef;
+
+ def = wsdlWrapper.getDefinition();
+ } else {
+ try {
+ wsdlWrapper = new WSDL4JWrapper(wsdlDef);
+ def = wsdlWrapper.getDefinition();
+ } catch (Exception ex) {
+ // absorb
+ }
+ }
+
+ if (def != null) {
+ String wsdlDefinitionBaseURI = def.getDocumentBaseURI();
- /** @param wsdlDefinition The wsdlDefinition to set. */
- public void setWsdlDefinition(Definition wsdlDefinition) {
- this.wsdlDefinition = wsdlDefinition;
+ if ((wsdlDefinitionBaseURI != null) && (wsdlURL == null)) {
+ try {
+ wsdlURL = new URL(wsdlDefinitionBaseURI);
+ } catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("DescriptionBuilderComposite:setWsdlDefinition(): "
+ +"Caught exception creating WSDL URL :"
+ + wsdlDefinitionBaseURI + "; exception: "
+ +e.toString(),e);
+ }
+ }
+ }
+ }
+ }
}
/** @param wsdlURL The wsdlURL to set. */
@@ -488,5 +567,35 @@
}
return sb.toString();
}
-
+
+
+ /**
+ * Create a wsdl definition from the supplied
+ * location.
+ *
+ * @param _wsdlURL The URL where the wsdl is located
+ * @return The WSDL Definition or NULL
+ */
+ private Definition createWsdlDefinition(URL _wsdlURL) {
+ if (_wsdlURL == null) {
+ return null;
+ }
+
+ Definition wsdlDef = null;
+ try {
+ wsdlWrapper = new WSDL4JWrapper(_wsdlURL);
+ if (wsdlWrapper != null) {
+ wsdlDef = wsdlWrapper.getDefinition();
+ }
+ } catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("DescriptionBuilderComposite:createWsdlDefinition("
+ + _wsdlURL.toString()
+ + "): Caught exception trying to create WSDL Definition: "
+ +e, e);
+ }
+ }
+
+ return wsdlDef;
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java Tue Oct 30 05:10:34 2007
@@ -26,8 +26,9 @@
public class FieldDescriptionComposite implements TMFAnnotationComposite {
//Method reflective information
- private String fieldName; //field name
- private String modifierType; //field modifier
+ private String fieldName; // field name
+ private String modifierType; // field modifier
+ private String fieldClassName; // fully qualified field class name
// indicates whether the field was annotated with @XmlList or not
private boolean isListType = false;
@@ -68,6 +69,11 @@
public String getModifierType() {
return modifierType;
}
+
+ /** @return Returns the fieldClassName. */
+ public String getFieldClassName() {
+ return fieldClassName;
+ }
/** @return Returns the webServiceRefAnnot. */
public WebServiceRefAnnot getWebServiceRefAnnot() {
@@ -101,6 +107,10 @@
public boolean isListType() {
return isListType;
}
+
+ public void setFieldClassName(String fieldClassName) {
+ this.fieldClassName = fieldClassName;
+ }
/**
* Convenience method for unit testing. We will print all of the
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java Tue Oct 30 05:10:34 2007
@@ -300,7 +300,7 @@
}
catch (IOException e) {
// report this since it was a valid URL but the openStream caused a problem
- ExceptionFactory.makeWebServiceException(Messages.getMessage("hcConfigLoadFail",
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("hcConfigLoadFail",
configFile, className,
e.toString()));
}
@@ -324,13 +324,13 @@
configStream = classLoader.getResourceAsStream(resolvedPath);
}
catch (URISyntaxException e) {
- ExceptionFactory.makeWebServiceException(Messages.getMessage("hcConfigLoadFail",
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("hcConfigLoadFail",
configFile, className,
e.toString()));
}
}
if (configStream == null) {
- ExceptionFactory.makeWebServiceException(Messages.getMessage("handlerChainNS",
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("handlerChainNS",
configFile, className));
} else {
if (log.isDebugEnabled()) {
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Tue Oct 30 05:10:34 2007
@@ -20,7 +20,10 @@
import java.io.InputStream;
import java.lang.annotation.Annotation;
+import java.net.URL;
import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -68,6 +71,8 @@
import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
+import org.apache.axis2.jaxws.description.builder.CustomAnnotationInstance;
+import org.apache.axis2.jaxws.description.builder.CustomAnnotationProcessor;
import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
import org.apache.axis2.jaxws.description.builder.MDQConstants;
import org.apache.axis2.jaxws.description.builder.WsdlComposite;
@@ -80,7 +85,7 @@
import org.apache.axis2.jaxws.server.config.RespectBindingConfigurator;
import org.apache.axis2.jaxws.util.ClassLoaderUtils;
import org.apache.axis2.jaxws.util.WSDL4JWrapper;
-import org.apache.axis2.jaxws.util.WSDLWrapper;
+import org.apache.axis2.wsdl.util.WSDLDefinitionWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -183,6 +188,10 @@
// and Sec 1.4 "SOAP Transport and Transfer Bindings" pg 119
public static final String BindingType_DEFAULT =
javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING;
+
+ private List<CustomAnnotationInstance> customAnnotations;
+
+ private Map<String, CustomAnnotationProcessor> customAnnotationProcessors;
// Supports WebServiceFeatureAnnotations
private ServerFramework framework = new ServerFramework();
@@ -203,6 +212,7 @@
EndpointDescriptionImpl(Class theClass, QName portName, boolean dynamicPort,
ServiceDescriptionImpl parent) {
+
// TODO: This and the other constructor will (eventually) take the same args, so the logic needs to be combined
// TODO: If there is WSDL, could compare the namespace of the defn against the portQName.namespace
this.parentServiceDescription = parent;
@@ -274,6 +284,11 @@
* don't use an SEI
*/
EndpointDescriptionImpl(ServiceDescriptionImpl parent, String serviceImplName) {
+
+ // initialize CustomAnnotationIntance list and CustomAnnotationProcessor map
+ customAnnotations = new ArrayList<CustomAnnotationInstance>();
+ customAnnotationProcessors = new HashMap<String, CustomAnnotationProcessor>();
+
// TODO: This and the other constructor will (eventually) take the same args, so the logic needs to be combined
// TODO: If there is WSDL, could compare the namespace of the defn against the portQName.namespace
@@ -294,6 +309,11 @@
else
webServiceProviderAnnotation = composite.getWebServiceProviderAnnot();
+
+ // now get the custom annotation and process information from the DBC
+ customAnnotations.addAll(composite.getCustomAnnotationInstances());
+ customAnnotationProcessors.putAll(composite.getCustomAnnotationProcessors());
+
// REVIEW: Maybe this should be an error if the name has already been set and it doesn't match
// Note that on the client side, the service QN should be set; on the server side it will not be.
if (DescriptionUtils.isEmpty(getServiceDescription().getServiceQName())) {
@@ -382,12 +402,31 @@
//We have a wsdl composite, so set these values for the generated wsdl
wsdlCompositeParameter.setValue(wsdlComposite);
wsdlLocationParameter.setValue(wsdlComposite.getWsdlFileName());
- wsdlDefParameter.setValue(
- getServiceDescriptionImpl().getGeneratedWsdlWrapper().getDefinition());
+
+ Definition def =
+ getServiceDescriptionImpl().getGeneratedWsdlWrapper().getDefinition();
+ URL wsdlUrl = getServiceDescriptionImpl().getGeneratedWsdlWrapper().getWSDLLocation();
+ if (def instanceof WSDLDefinitionWrapper) {
+ wsdlDefParameter.setValue(def);
+ } else {
+ WSDLDefinitionWrapper wrap = new WSDLDefinitionWrapper(def, wsdlUrl);
+ wsdlDefParameter.setValue(wrap);
+ }
+
} else if (getServiceDescriptionImpl().getWSDLWrapper() != null) {
//No wsdl composite because wsdl already exists
+
wsdlLocationParameter.setValue(getAnnoWebServiceWSDLLocation());
- wsdlDefParameter.setValue(getServiceDescriptionImpl().getWSDLWrapper().getDefinition());
+
+ Definition def = getServiceDescriptionImpl().getWSDLWrapper().getDefinition();
+ URL wsdlUrl = getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation();
+ if (def instanceof WSDLDefinitionWrapper) {
+ wsdlDefParameter.setValue(def);
+ } else {
+ WSDLDefinitionWrapper wrap = new WSDLDefinitionWrapper(def, wsdlUrl);
+ wsdlDefParameter.setValue(wrap);
+ }
+
} else {
//There is no wsdl composite and there is NOT a wsdl definition
wsdlLocationParameter.setValue(null);
@@ -414,8 +453,15 @@
wsdlLocationParameter.setName(MDQConstants.WSDL_LOCATION);
if (getServiceDescriptionImpl().getWSDLWrapper() != null) {
wsdlLocationParameter.setValue(getAnnoWebServiceWSDLLocation());
- wsdlDefParameter.setValue(getServiceDescriptionImpl().getWSDLWrapper()
- .getDefinition());
+
+ Definition def = getServiceDescriptionImpl().getWSDLWrapper().getDefinition();
+ URL wsdlUrl = getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation();
+ if (def instanceof WSDLDefinitionWrapper) {
+ wsdlDefParameter.setValue(def);
+ } else {
+ WSDLDefinitionWrapper wrap = new WSDLDefinitionWrapper(def, wsdlUrl);
+ wsdlDefParameter.setValue(wrap);
+ }
}
// No WSDL supplied and we do not generate for non-SOAP 1.1/HTTP
// endpoints
@@ -432,6 +478,25 @@
.makeWebServiceException("EndpointDescription: Unable to add parameters to AxisService");
}
}
+
+ // Before we leave we need to drive the CustomAnnotationProcessors if
+ // there were any CustomAnnotationInstance objects registered
+ Iterator<CustomAnnotationInstance> annotationIter = customAnnotations.iterator();
+ while(annotationIter.hasNext()) {
+ CustomAnnotationInstance annotation = annotationIter.next();
+ if(log.isDebugEnabled()) {
+ log.debug("Checking for CustomAnnotationProcessor for CustomAnnotationInstance " +
+ "class: " + annotation.getClass().getName());
+ }
+ CustomAnnotationProcessor processor = customAnnotationProcessors.get(annotation.getClass().getName());
+ if(processor != null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Found CustomAnnotationProcessor: " + processor.getClass().getName() +
+ " for CustomAnnotationInstance: " + annotation.getClass().getName());
+ }
+ processor.processTypeLevelAnnotation(this, annotation);
+ }
+ }
}
/**
@@ -775,15 +840,16 @@
// Note that the axis service builder takes only the localpart of the port qname.
// TODO:: This should check that the namespace of the definition matches the namespace of the portQName per JAXRPC spec
- WSDLWrapper wrapper = getServiceDescriptionImpl().getWSDLWrapper();
+ Definition def = getServiceDescriptionImpl().getWSDLWrapper().getUnwrappedDefinition();
+
WSDL11ToAxisServiceBuilder serviceBuilder =
- new WSDL11ToAxisServiceBuilder(
- wrapper.getDefinition(),
+ new WSDL11ToAxisServiceBuilder(def,
getServiceDescription().getServiceQName(),
getPortQName().getLocalPart());
- //TODO: Temporary, please change the following log.info to log.debug
- log.info("Building AxisService from wsdl: " + wrapper.getWSDLLocation());
+ if (log.isDebugEnabled()) {
+ log.debug("Building AxisService from wsdl: " + getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation());
+ }
if (getServiceDescriptionImpl().isDBCMap()) {
//this.class.getClass().getClassLoader();
@@ -1707,6 +1773,15 @@
}
}
return wsdlComposite;
+ }
+
+ List<CustomAnnotationInstance> getCustomAnnotationInstances() {
+ return customAnnotations;
+ }
+
+ CustomAnnotationProcessor getCustomAnnotationProcessor(String annotationInstanceClassName) {
+ return customAnnotationProcessors != null ?
+ customAnnotationProcessors.get(annotationInstanceClassName) : null;
}
public String toString() {
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java Tue Oct 30 05:10:34 2007
@@ -283,7 +283,7 @@
if (!Modifier.isPublic(method.getModifiers())) {
// JSR-181 says methods must be public (p14)
// TODO NLS
- ExceptionFactory.makeWebServiceException("SEI methods must be public");
+ throw ExceptionFactory.makeWebServiceException("SEI methods must be public");
}
// TODO: other validation per JSR-181
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java Tue Oct 30 05:10:34 2007
@@ -56,8 +56,9 @@
public InputSource resolveEntity(String namespace, String schemaLocation,
String baseUri) {
- //TODO: Temporary, please change the following log.info to log.debug
- log.info("resolveEntity: ["+ namespace + "]["+ schemaLocation + "][ " + baseUri+ "]");
+ if (log.isDebugEnabled()) {
+ log.debug("resolveEntity: ["+ namespace + "]["+ schemaLocation + "][ " + baseUri+ "]");
+ }
InputStream is = null;
URI pathURI = null;
@@ -180,8 +181,11 @@
// imported XSDs that have been read. If this value is null, then circular XSDs will
// cause infinite recursive reads.
returnInputSource.setSystemId(pathURIStr != null ? pathURIStr : schemaLocation);
- //TODO: Temporary, please change the following log.info to log.debug
- log.info("returnInputSource :" + returnInputSource.getSystemId());
+
+ if (log.isDebugEnabled()) {
+ log.debug("returnInputSource :" + returnInputSource.getSystemId());
+ }
+
return returnInputSource;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java Tue Oct 30 05:10:34 2007
@@ -24,6 +24,7 @@
import javax.xml.ws.spi.WebServiceFeatureAnnotation;
import java.lang.annotation.Annotation;
+import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
@@ -35,11 +36,12 @@
public ServerFramework() {
super();
- configuratorMap = new IdentityHashMap<String, ServerConfigurator>();
- annotationMap = new IdentityHashMap<String, Annotation>();
+ configuratorMap = new HashMap<String, ServerConfigurator>();
+ annotationMap = new HashMap<String, Annotation>();
}
public void addConfigurator(String id, ServerConfigurator configurator) {
+ System.out.println("[" + id + "], " + configurator.toString());
configuratorMap.put(id, configurator);
}
@@ -50,7 +52,13 @@
WebServiceFeatureAnnotation wsfAnnotation =
annotation.annotationType().getAnnotation(WebServiceFeatureAnnotation.class);
- return configuratorMap.containsKey(wsfAnnotation != null ? wsfAnnotation.id() : null);
+ String id = null;
+ if (wsfAnnotation != null)
+ id = wsfAnnotation.id();
+
+ System.out.println("[" + id + "]");
+
+ return configuratorMap.containsKey(id);
}
public void addAnnotation(Annotation annotation) {
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Tue Oct 30 05:10:34 2007
@@ -183,3 +183,4 @@
onewayAsync=The async listener property was set. A one way invocation cannot be performed using an async response channel.
soapBindingUseEncoded=The SEI {0} contains method {1} with an unsupported SOAPBinding annotation value. SOAPBinding.Use field cannot be set to ENCODED.
soapBindingStyle=The SEI {0} contains method {1} with annotation SOAPBinding.Style set to RPC.
+failureLogger=A {0} throwable was caught. The detail message is: {1}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/Constants.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/Constants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/Constants.java Tue Oct 30 05:10:34 2007
@@ -41,4 +41,8 @@
public static final String THREAD_CONTEXT_MIGRATOR_LIST_ID = "JAXWS-ThreadContextMigrator-List";
public static final String INVOCATION_PATTERN = "org.apache.axis2.jaxws.invocation.pattern";
+
+ public static final String METADATA_REGISTRY_CONFIG_FILE =
+ "META-INF/services/org.apache.axis2.metadata.registry.MetadataFactoryRegistry";
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDL4JWrapper.java Tue Oct 30 05:10:34 2007
@@ -25,6 +25,7 @@
import org.apache.axis2.metadata.factory.ResourceFinderFactory;
import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
import org.apache.axis2.metadata.resource.ResourceFinder;
+import org.apache.axis2.wsdl.util.WSDLDefinitionWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -63,8 +64,11 @@
public class WSDL4JWrapper implements WSDLWrapper {
private static final Log log = LogFactory.getLog(WSDL4JWrapper.class);
- private Definition wsdlDefinition = null;
+
+ private WSDLDefinitionWrapper wsdlDefinition = null;
+
private URL wsdlURL;
+ private String wsdlExplicitURL;
public WSDL4JWrapper(URL wsdlURL) throws FileNotFoundException, UnknownHostException,
ConnectException, IOException, WSDLException {
@@ -153,23 +157,8 @@
if(is != null) {
is.close();
}
- final String explicitWsdl = urlCon.getURL().toString();
- try {
- wsdlDefinition = (Definition)AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Object run() throws WSDLException {
- WSDLReader reader = getWSDLReader();
- return reader.readWSDL(explicitWsdl);
- }
- }
- );
- } catch (PrivilegedActionException e) {
- if (log.isDebugEnabled()) {
- log.debug("Exception thrown from AccessController: " + e);
- }
- throw ExceptionFactory.makeWebServiceException(e.getException());
- }
-
+ this.wsdlExplicitURL = urlCon.getURL().toString();
+ getDefinition();
} catch (FileNotFoundException ex) {
throw ex;
} catch (UnknownHostException ex) {
@@ -206,7 +195,7 @@
if(log.isDebugEnabled()){
log.debug("No URL's found in URL ClassLoader");
}
- ExceptionFactory.makeWebServiceException(Messages.getMessage("WSDL4JWrapperErr1"));
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("WSDL4JWrapperErr1"));
}
for (URL url : urlList) {
@@ -272,18 +261,99 @@
public WSDL4JWrapper(URL wsdlURL, Definition wsdlDefinition) throws WSDLException {
super();
this.wsdlURL = wsdlURL;
- this.wsdlDefinition = wsdlDefinition;
+ if ((wsdlDefinition != null) && !(wsdlDefinition instanceof WSDLDefinitionWrapper)) {
+ this.wsdlDefinition = new WSDLDefinitionWrapper(wsdlDefinition, wsdlURL);
+ } else {
+ this.wsdlDefinition = (WSDLDefinitionWrapper) wsdlDefinition;
+ }
+ }
+
+
+ public WSDL4JWrapper(Definition wsdlDefinition) throws WSDLException {
+ super();
+ if ((wsdlDefinition != null) && !(wsdlDefinition instanceof WSDLDefinitionWrapper)) {
+ this.wsdlDefinition = new WSDLDefinitionWrapper(wsdlDefinition);
+ } else {
+ this.wsdlDefinition = (WSDLDefinitionWrapper) wsdlDefinition;
+ }
+ if (this.wsdlDefinition != null) {
+ String baseURI = wsdlDefinition.getDocumentBaseURI();
+ try {
+ wsdlURL = new URL(baseURI);
+ } catch (Exception ex) {
+ // just absorb the error
+ }
+ }
}
+
//TODO: Perform validations for each method to check for null parameters on QName.
+ /*
+ * Returns a wrapped WSDL4J wSDL definition
+ */
public Definition getDefinition() {
+ if (wsdlDefinition == null) {
+ Definition def = loadDefinition();
+ if (def != null) {
+ wsdlDefinition = new WSDLDefinitionWrapper(def);
+ }
+ }
return wsdlDefinition;
}
+ /*
+ * Returns an unwrapped WSDL4J wSDL definition
+ */
+ public Definition getUnwrappedDefinition() {
+ Definition def;
+ if (wsdlDefinition == null) {
+ def = loadDefinition();
+ } else if (wsdlDefinition instanceof WSDLDefinitionWrapper) {
+ def = wsdlDefinition.getUnwrappedDefinition();
+ } else {
+ def = wsdlDefinition;
+ }
+ return def;
+ }
+
+
+ /*
+ * Load a WSDL4J WSDL definition from a URL
+ */
+ public Definition loadDefinition() {
+
+ Definition def = null;
+
+ if (wsdlExplicitURL != null) {
+ try {
+ def = (Definition) AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws WSDLException {
+ WSDLReader reader = getWSDLReader();
+ return reader.readWSDL(wsdlExplicitURL);
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Exception thrown from AccessController: " + e);
+ }
+ throw ExceptionFactory.makeWebServiceException(e.getException());
+ }
+ }
+
+
+ if (log.isDebugEnabled()) {
+ if (def != null) {
+ log.debug("loadDefinition() returning a NON-NULL definition");
+ } else {
+ log.debug("loadDefinition() returning a NULL definition");
+ }
+ }
+
+ return def;
+ }
public Binding getFirstPortBinding(QName serviceQname) {
- // TODO Auto-generated method stub
Service service = getService(serviceQname);
if (service == null) {
return null;
@@ -326,7 +396,6 @@
}
public ArrayList getPortBinding(QName serviceQname) {
- // TODO Auto-generated method stub
Map map = this.getService(serviceQname).getPorts();
if (map == null || map.isEmpty()) {
return null;
@@ -375,16 +444,19 @@
}
public Service getService(QName serviceQname) {
- // TODO Auto-generated method stub
if (serviceQname == null) {
return null;
}
- return wsdlDefinition.getService(serviceQname);
+ Definition def = getDefinition();
+ if (def != null) {
+ return def.getService(serviceQname);
+ } else {
+ return null;
+ }
}
public String getSOAPAction(QName serviceQname) {
- // TODO Auto-generated method stub
Binding binding = getFirstPortBinding(serviceQname);
if (binding == null) {
return null;
@@ -405,7 +477,6 @@
}
public String getSOAPAction(QName serviceQname, QName portQname) {
- // TODO Auto-generated method stub
Port port = getPort(serviceQname, portQname);
if (port == null) {
return null;
@@ -461,7 +532,6 @@
}
public URL getWSDLLocation() {
- // TODO Auto-generated method stub
return this.wsdlURL;
}
@@ -472,8 +542,12 @@
}
public String getTargetNamespace() {
- // TODO Auto-generated method stub
- return wsdlDefinition.getTargetNamespace();
+ Definition def = getDefinition();
+ if (def != null) {
+ return def.getTargetNamespace();
+ } else {
+ return null;
+ }
}
/**
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLWrapper.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLWrapper.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLWrapper.java Tue Oct 30 05:10:34 2007
@@ -65,4 +65,6 @@
public String getTargetNamespace();
public Definition getDefinition();
+
+ public Definition getUnwrappedDefinition();
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/metadata/registry/MetadataFactoryRegistry.java Tue Oct 30 05:10:34 2007
@@ -18,18 +18,40 @@
*/
package org.apache.axis2.metadata.registry;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.net.URL;
import java.util.Hashtable;
import java.util.Map;
import org.apache.axis2.jaxws.ClientConfigurationFactory;
+import org.apache.axis2.jaxws.util.ClassLoaderUtils;
+import org.apache.axis2.jaxws.util.Constants;
import org.apache.axis2.metadata.factory.ResourceFinderFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class MetadataFactoryRegistry {
+
+ private static Log log = LogFactory.getLog(MetadataFactoryRegistry.class);
+
+ private static String configurationFileLoc = null;
+
private final static Map<Class,Object> table;
static {
table = new Hashtable<Class,Object>();
table.put(ResourceFinderFactory.class, new ResourceFinderFactory());
table.put(ClientConfigurationFactory.class, new ClientConfigurationFactory());
+ if(configurationFileLoc == null) {
+ if(log.isDebugEnabled()) {
+ log.debug("A configuration file location was not set. The " +
+ "following location will be used: " +
+ Constants.METADATA_REGISTRY_CONFIG_FILE);
+ }
+ configurationFileLoc = Constants.METADATA_REGISTRY_CONFIG_FILE;
+ }
+ loadConfigFromFile();
}
/**
@@ -55,5 +77,98 @@
public static void setFactory(Class intface, Object factoryObject){
table.put(intface, factoryObject);
}
+
+ /**
+ * This method will load a file, if it exists, that contains a list
+ * of interfaces and custom implementations. This allows for non-
+ * programmatic registration of custom interface implementations
+ * with the MDQ layer.
+ */
+ private static void loadConfigFromFile() {
+ String pairSeparator = "|";
+ try {
+ ClassLoader classLoader = ClassLoaderUtils.getContextClassLoader();
+ URL url = null;
+ url = classLoader.getResource(configurationFileLoc);
+ if(url == null) {
+ File file = new File(configurationFileLoc);
+ url = file.toURL();
+ }
+ // the presence of this file is optional
+ if(url != null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Found URL to MetadataFactoryRegistry configuration file: " +
+ configurationFileLoc);
+ }
+ BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
+ String line = reader.readLine();
+
+ // the separator of the file is the '|' character
+ // to the left of the separator will be the interface and
+ // to the right will be the custom implementation
+ if(line != null &&
+ line.indexOf("|") != -1) {
+ String interfaceName = line.substring(0, line.indexOf(pairSeparator));
+ String implName = line.substring(line.indexOf(pairSeparator) + 1,
+ line.length());
+ if(log.isDebugEnabled()) {
+ log.debug("For registered class: " + interfaceName + " the " +
+ "following implementation was found: " + implName);
+ }
+ Class intf = classLoader.loadClass(interfaceName);
+ Class impl = classLoader.loadClass(implName);
+
+ // if we could load both we need to register them with our
+ // internal registry
+ if(intf != null && impl != null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Loaded both interface and implementation class: " +
+ interfaceName + ":" + implName);
+ }
+ if(impl.getEnclosingClass() == null) {
+ table.put(intf, impl.newInstance());
+ }else {
+ if(log.isWarnEnabled()) {
+ log.warn("The implementation class: " + impl.getClass().getName() +
+ " could not be lregistered because it is an inner class. " +
+ "In order to register file-based overrides, implementations " +
+ "must be public outer classes.");
+ }
+ }
+ }else {
+ if(log.isDebugEnabled()) {
+ log.debug("Could not load both interface and implementation class: " +
+ interfaceName + ":" + implName);
+ }
+ }
+ }else {
+ if(log.isDebugEnabled()) {
+ log.debug("Did not find File for MetadataFactoryRegistry configuration " +
+ "file: " + configurationFileLoc);
+ }
+ }
+ }else {
+ if(log.isDebugEnabled()) {
+ log.debug("Did not find URL for MetadataFactoryRegistry configuration " +
+ "file: " + configurationFileLoc);
+ }
+ }
+ }
+ catch(Throwable t) {
+ if(log.isWarnEnabled()) {
+ log.warn("The MetadataFactoryRegistry could not process the configuration file: " +
+ configurationFileLoc + " because of the following error: " + t.toString());
+ }
+ }
+ }
+ /**
+ * Package protected method to allow tests to set the location
+ * of the configuration file.
+ * @param configFileName
+ */
+ static void setConfigurationFileLocation(String configFileLoc) {
+ configurationFileLoc = configFileLoc;
+ loadConfigFromFile();
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/DescriptionTestUtils.java Tue Oct 30 05:10:34 2007
@@ -61,6 +61,7 @@
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
wsdlDefinition = reader.readWSDL(wsdlURL.toString());
+ wsdlDefinition.setDocumentBaseURI(wsdlURL.toString());
}
catch (Exception e) {
System.out.println(
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/builder/DescriptionBuilderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/builder/DescriptionBuilderTests.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/builder/DescriptionBuilderTests.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/builder/DescriptionBuilderTests.java Tue Oct 30 05:10:34 2007
@@ -20,10 +20,19 @@
package org.apache.axis2.jaxws.description.builder;
-import junit.framework.TestCase;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import javax.jws.WebService;
import javax.jws.WebParam.Mode;
+import java.lang.annotation.ElementType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
/**
* Directly test the Description classes built via annotations without a WSDL file. These tests
* focus on combinations of the following: - A generic service (no annotations) - A generated
@@ -199,5 +208,135 @@
assertEquals("Unable to convert string to parameterTypeClass",
pdc.getParameterTypeClass().getName(), "int");
}
+
+ public void testGenericAnnotationInstancesAndProcessor() {
+ TestProcessor annotationProcessor = new TestProcessor();
+ annotationProcessor.setAnnotationInstanceClassName(CustomAnnotation.class.getName());
+ DescriptionBuilderComposite dbc = new DescriptionBuilderComposite();
+ dbc.addCustomAnnotationProcessor(annotationProcessor);
+ Map<String, CustomAnnotationProcessor> processors = dbc.getCustomAnnotationProcessors();
+ assertNotNull(processors);
+ assertNotNull(processors.values());
+ assertEquals(processors.values().size(), 1);
+ CustomAnnotationProcessor instance = processors.get(CustomAnnotation.class.getName());
+ assertNotNull(instance);
+ assertEquals(instance.getClass().getName(), TestProcessor.class.getName());
+ assertEquals(instance.getAnnotationInstanceClassName(), CustomAnnotation.class.getName());
+ CustomAnnotation annotation = new CustomAnnotation();
+ annotation.setAnnotationClassName(Custom.class.getName());
+ annotation.setTarget(ElementType.TYPE);
+ annotation.addParameterData("name", annotation.getClass().getSimpleName());
+ dbc.addCustomAnnotationInstance(annotation);
+ List<CustomAnnotationInstance> gaiList = dbc.getCustomAnnotationInstances();
+ assertNotNull(gaiList);
+ assertEquals(1, gaiList.size());
+ CustomAnnotationInstance gai = gaiList.get(0);
+ assertNotNull(gai);
+ assertEquals(gai.getClass().getName(), CustomAnnotation.class.getName());
+ assertEquals(gai.getAnnotationClassName(), Custom.class.getName());
+ assertEquals(gai.getTarget(), ElementType.TYPE);
+ assertEquals(gai.getParameterData("name"), gai.getClass().getSimpleName());
+ IllegalArgumentException ex = null;
+ try {
+ gai.getParameterData("unknown");
+ }
+ catch(IllegalArgumentException iae) {
+ ex = iae;
+ }
+ assertNotNull(ex);
+ try {
+ gai.addParameterData("unknown", null);
+ }
+ catch(IllegalArgumentException iae) {
+ ex = iae;
+ }
+ assertNotNull(ex);
+ }
+
+ class TestProcessor implements CustomAnnotationProcessor {
+
+ private String annotationInstanceClassName;
+
+ public String getAnnotationInstanceClassName() {
+ return annotationInstanceClassName;
+ }
+
+ public void setAnnotationInstanceClassName(String annotationInstanceClassName) {
+ this.annotationInstanceClassName = annotationInstanceClassName;
+ }
+
+ public void processTypeLevelAnnotation(EndpointDescription ed, CustomAnnotationInstance annotation) {
+ // do nothing, testing purproses only
+ }
+
+ }
+
+ class CustomAnnotation implements CustomAnnotationInstance {
+ private Map<String, Object> dataMap = new HashMap<String, Object>();
+
+ private ElementType elementType;
+
+ List<String> knownParamNames;
+
+ private String annotationClassName;
+
+ CustomAnnotation(List<String> knownParamNames) {
+ this.knownParamNames = knownParamNames;
+ }
+
+ CustomAnnotation() {
+ knownParamNames = new ArrayList<String>();
+ knownParamNames.add("name");
+ }
+
+ public void setAnnotationClassName(String annotationClassName) {
+ this.annotationClassName = annotationClassName;
+ }
+
+ public String getAnnotationClassName() {
+ return annotationClassName;
+ }
+
+ public void addParameterData(String paramName, Object value) throws IllegalArgumentException {
+ checkParamName(paramName);
+ dataMap.put(paramName, value);
+ }
+
+ public Object getParameterData(String paramName) throws IllegalArgumentException {
+ checkParamName(paramName);
+ return dataMap.get(paramName);
+ }
+
+ public void setTarget(ElementType elementType) {
+ this.elementType = elementType;
+ }
+
+ public ElementType getTarget() {
+ return elementType;
+ }
+
+ private void checkParamName(String paramName) throws IllegalArgumentException {
+ if(knownParamNames != null
+ &&
+ !knownParamNames.isEmpty()
+ &&
+ !knownParamNames.contains(paramName)) {
+ throw new IllegalArgumentException("The parameter " + paramName +
+ " is an unknown parameter for the CustomAnnotation type.");
+ }
+ }
+ }
+
+ @interface Custom {
+ String name() default "";
+ }
+
+ @WebService
+ @Custom
+ class AnnotatedService {
+ public String echo(String echoString) {
+ return echoString;
+ }
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImplTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImplTests.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImplTests.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/test/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImplTests.java Tue Oct 30 05:10:34 2007
@@ -19,16 +19,30 @@
package org.apache.axis2.jaxws.description.impl;
+import java.lang.annotation.ElementType;
import java.lang.reflect.Field;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.jws.WebService;
import javax.xml.namespace.QName;
import junit.framework.TestCase;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.ClientConfigurationFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.description.builder.CustomAnnotationInstance;
+import org.apache.axis2.jaxws.description.builder.CustomAnnotationProcessor;
+import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
+import org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter;
import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
public class DescriptionFactoryImplTests extends TestCase {
@@ -119,6 +133,51 @@
}
}
+ public void testCustomAnnotationSupport() {
+ JavaClassToDBCConverter converter = new JavaClassToDBCConverter(AnnotatedService.class);
+ HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+ DescriptionBuilderComposite dbc = dbcMap.get(AnnotatedService.class.getName());
+ assertNotNull(dbc);
+ SampleAnnotation sampleAnnotation = new SampleAnnotation();
+ sampleAnnotation.setAnnotationClassName(Custom.class.getName());
+ dbc.addCustomAnnotationInstance(sampleAnnotation);
+ SampleAnnotationProcessor saProcessor = new SampleAnnotationProcessor();
+ saProcessor.setAnnotationInstanceClassName(sampleAnnotation.getClass().getName());
+ dbc.addCustomAnnotationProcessor(saProcessor);
+ WebServiceAnnot webService = dbc.getWebServiceAnnot();
+ assertNotNull(webService);
+ String pn = webService.portName();
+ String tns = webService.targetNamespace();
+ assertNotNull(pn);
+ assertNotNull(tns);
+ QName portQName = new QName(tns, pn);
+ List<ServiceDescription> sdList = DescriptionFactoryImpl.createServiceDescriptionFromDBCMap(dbcMap);
+ assertNotNull(sdList);
+ assertEquals(sdList.size(), 1);
+ ServiceDescription sd = sdList.get(0);
+ assertNotNull(sd);
+ EndpointDescription ed = sd.getEndpointDescription(portQName);
+ assertNotNull(ed);
+ // for testing purposes we want to make a cast b/c some of the methods
+ // we are accessing are protected in EndpointDescriptionImpl
+ if(ed instanceof EndpointDescriptionImpl) {
+ EndpointDescriptionImpl edImpl = (EndpointDescriptionImpl) ed;
+ List<CustomAnnotationInstance> customAnnotationList = edImpl.getCustomAnnotationInstances();
+ assertNotNull(customAnnotationList);
+ assertEquals(customAnnotationList.size(), 1);
+ CustomAnnotationInstance annotationInstance = customAnnotationList.get(0);
+ assertNotNull(annotationInstance);
+ assertEquals(annotationInstance.getClass().getName(), SampleAnnotation.class.getName());
+ CustomAnnotationProcessor processor = edImpl.getCustomAnnotationProcessor(annotationInstance.getClass().getName());
+ assertNotNull(processor);
+ AxisService axisService = ed.getAxisService();
+ assertNotNull(axisService);
+ String name = (String) axisService.getParameterValue(SampleAnnotation.class.getName());
+ assertNotNull(name);
+ assertEquals(SampleAnnotationProcessor.class.getName(), name);
+ }
+ }
+
private void resetClientConfigFactory() throws Exception {
Field field = DescriptionFactoryImpl.class.getDeclaredField("clientConfigFactory");
field.setAccessible(true);
@@ -148,4 +207,101 @@
}
}
+
+ class SampleAnnotation implements CustomAnnotationInstance {
+
+ private Map<String, Object> dataMap = new HashMap<String, Object>();
+
+ private ElementType elementType;
+
+ List<String> knownParamNames;
+
+ private String annotationClassName;
+
+ SampleAnnotation(List<String> knownParamNames) {
+ this.knownParamNames = knownParamNames;
+ }
+
+ public void setAnnotationClassName(String annotationClassName) {
+ this.annotationClassName = annotationClassName;
+ }
+
+ public String getAnnotationClassName() {
+ return annotationClassName;
+ }
+
+ SampleAnnotation() {
+ knownParamNames = new ArrayList<String>();
+ knownParamNames.add("name");
+ }
+
+ public void addParameterData(String paramName, Object value) throws IllegalArgumentException {
+ checkParamName(paramName);
+ dataMap.put(paramName, value);
+ }
+
+ public Object getParameterData(String paramName) throws IllegalArgumentException {
+ checkParamName(paramName);
+ return dataMap.get(paramName);
+ }
+
+ public void setTarget(ElementType elementType) {
+ this.elementType = elementType;
+ }
+
+ public ElementType getTarget() {
+ return elementType;
+ }
+
+ private void checkParamName(String paramName) throws IllegalArgumentException {
+ if(knownParamNames != null
+ &&
+ !knownParamNames.isEmpty()
+ &&
+ !knownParamNames.contains(paramName)) {
+ throw new IllegalArgumentException("The parameter " + paramName +
+ " is an unknown parameter for the CustomAnnotation type.");
+ }
+ }
+ }
+
+ class SampleAnnotationProcessor implements CustomAnnotationProcessor {
+
+ private String annotationInstanceClassName;
+
+ public String getAnnotationInstanceClassName() {
+ return annotationInstanceClassName;
+ }
+
+ public void setAnnotationInstanceClassName(String annotationInstanceClassName) {
+ this.annotationInstanceClassName = annotationInstanceClassName;
+ }
+
+ public void processTypeLevelAnnotation(EndpointDescription ed, CustomAnnotationInstance annotation) {
+ AxisService axisService = ed.getAxisService();
+ if(axisService != null) {
+ try {
+ axisService.addParameter(SampleAnnotation.class.getName(),
+ SampleAnnotationProcessor.class.getName());
+ }
+ catch(AxisFault af) {
+ // nothing here
+ }
+ }
+ }
+
+ }
+
+ @interface Custom {
+ String name() default "";
+ }
+
+ @WebService(targetNamespace="http://org.apache.example", serviceName="AnnotatedService", portName="AnnotatedPort")
+ @Custom(name="AnnotatedService")
+ class AnnotatedService {
+ public String echo(String echoString) {
+ return echoString;
+ }
+ }
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml Tue Oct 30 05:10:34 2007
@@ -736,7 +736,12 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
+ <version>${woden.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
<version>${woden.version}</version>
</dependency>
<dependency>
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/pom.xml Tue Oct 30 05:10:34 2007
@@ -72,7 +72,21 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
Modified: webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/pom.xml Tue Oct 30 05:10:34 2007
@@ -216,7 +216,7 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
<version>${woden.version}</version>
</dependency>
@@ -241,6 +241,10 @@
<version>${jibx.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
Modified: webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java Tue Oct 30 05:10:34 2007
@@ -201,6 +201,10 @@
WSDL11ToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(url.openConnection().getInputStream());
+ // Set the URI of the base document for the Definition.
+ // Note that this is the URI of the base document, not the imports.
+ builder.setDocumentBaseUri(url.toString());
+
builder.setBaseUri(getBaseUri(wsdlURI));
builder.setCodegen(true);
return builder.populateService();
Modified: webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/pom.xml Tue Oct 30 05:10:34 2007
@@ -111,8 +111,12 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
Modified: webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java Tue Oct 30 05:10:34 2007
@@ -287,6 +287,7 @@
WSDL11ToAxisServiceBuilder builder =
new WSDL11ToAxisServiceBuilder(url.openConnection().getInputStream());
+ builder.setDocumentBaseUri(url.toString());
builder.setBaseUri(getBaseUri(wsdlURI));
builder.setCodegen(true);
return builder.populateService();
@@ -407,6 +408,9 @@
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
wsdlDefinition = reader.readWSDL(WSDLFileName) ;
+ if (wsdlDefinition != null) {
+ wsdlDefinition.setDocumentBaseURI(WSDLFileName);
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/webapp/src/main/webapp/axis2-web/HappyAxis.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/webapp/src/main/webapp/axis2-web/HappyAxis.jsp?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/webapp/src/main/webapp/axis2-web/HappyAxis.jsp (original)
+++ webservices/axis2/branches/java/jaxws21/modules/webapp/src/main/webapp/axis2-web/HappyAxis.jsp Tue Oct 30 05:10:34 2007
@@ -372,7 +372,9 @@
}
}
- public String getFormatedSystemProperty(String systemProperty){
+ public String getFormatedSystemProperty(String systemProperty){
+ if (systemProperty == null)
+ return "";
return systemProperty.replaceAll(":", ": ");
}
%>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org