You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/07/27 23:59:00 UTC
svn commit: r560397 [5/5] - in /webservices/axis2/branches/java/jaxws21: ./
etc/ legal/ modules/adb-codegen/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/schema/typemap/
modules/adb-codegen/test-res...
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/nhttp/ServerWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/nhttp/ServerWorker.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/nhttp/ServerWorker.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/nhttp/ServerWorker.java Fri Jul 27 14:58:51 2007
@@ -296,11 +296,13 @@
try {
response.addHeader(CONTENT_TYPE, TEXT_XML);
serverHandler.commitResponse(conn, response);
- service.printWSDL2(os);
-
+ service.printWSDL2(os, getIpAddress());
} catch (AxisFault e) {
handleException("Axis2 fault writing ?wsdl2 output", e);
return;
+ } catch (SocketException e) {
+ handleException("Axis2 fault writing ?wsdl2 output", e);
+ return;
}
}
@@ -334,7 +336,14 @@
service.populateSchemaMappings();
//write out the correct schema
Map schemaTable = service.getSchemaMappingTable();
- final XmlSchema schema = (XmlSchema)schemaTable.get(schemaName);
+ XmlSchema schema = (XmlSchema)schemaTable.get(schemaName);
+ if (schema == null) {
+ int dotIndex = schemaName.indexOf('.');
+ if (dotIndex > 0) {
+ String schemaKey = schemaName.substring(0,dotIndex);
+ schema = (XmlSchema) schemaTable.get(schemaKey);
+ }
+ }
//schema found - write it to the stream
if (schema != null) {
response.addHeader(CONTENT_TYPE, TEXT_XML);
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java Fri Jul 27 14:58:51 2007
@@ -45,6 +45,8 @@
import java.util.Iterator;
import java.util.List;
+import com.ibm.wsdl.util.xml.DOM2Writer;
+
public class PolicyUtil {
public static String getSafeString(String unsafeString) {
@@ -151,9 +153,10 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Transformer tf;
try {
- tf = TransformerFactory.newInstance().newTransformer();
- tf.transform(new DOMSource(element), new StreamResult(baos));
- return new ByteArrayInputStream(baos.toByteArray());
+// tf = TransformerFactory.newInstance().newTransformer();
+// tf.transform(new DOMSource(element), new StreamResult(baos));
+ String nodeString =DOM2Writer.nodeToString(element);
+ return new ByteArrayInputStream(nodeString.getBytes());
} catch (Exception e) {
throw new RuntimeException("Unable to process policy");
}
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?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- 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 Fri Jul 27 14:58:51 2007
@@ -258,13 +258,19 @@
private static void generateDefaultSOAPBindingOperations(AxisService axisService, OMFactory omFactory, OMElement binding, OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap) { Iterator iterator = axisService.getChildren();
while (iterator.hasNext()) {
AxisOperation axisOperation = (AxisOperation) iterator.next();
+ if (axisOperation.isControlOperation()) {
+ continue;
+ }
OMElement opElement = omFactory.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
binding.addChild(opElement);
String name = axisOperation.getName().getLocalPart();
opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null,
tns.getPrefix() + ":" + name));
- opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ACTION, wsoap,
- axisOperation.getInputAction()));
+ String soapAction = axisOperation.getSoapAction();
+ if (soapAction != null) {
+ opElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ACTION, wsoap,
+ soapAction));
+ }
}
}
@@ -282,9 +288,28 @@
OMNamespace tns, AxisService axisService,
boolean disableREST)
throws AxisFault {
- String[] eprs = axisService.getEPRs();
- if (eprs == null) {
- eprs = new String[]{axisService.getName()};
+ return generateServiceElement(omFactory, wsdl, tns, axisService, disableREST, null);
+ }
+
+ /**
+ * Generates a default service element
+ * @param omFactory - The OMFactory
+ * @param wsdl the WSDL namespace
+ * @param tns - The targetnamespace
+ * @param axisService - The AxisService
+ * @param disableREST only generate REST 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)
+ throws AxisFault {
+ if(eprs == null){
+ eprs = axisService.getEPRs();
+ if (eprs == null) {
+ eprs = new String[]{axisService.getName()};
+ }
}
OMElement serviceElement;
serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/XMLPrettyPrinter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/XMLPrettyPrinter.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/XMLPrettyPrinter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/XMLPrettyPrinter.java Fri Jul 27 14:58:51 2007
@@ -21,7 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axis2.description.java2wsdl.Java2WSDLUtils;
+import org.apache.axiom.attachments.utils.IOUtils;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
@@ -36,58 +36,36 @@
import java.io.OutputStream;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
-import java.lang.reflect.Method;
/**
- * An XML pretty printer based on jtidy (http://sourceforge.net/projects/jtidy)
- * The Jtidy jar needs to be in classpath for this to work and can be found at
- * http://sourceforge.net/project/showfiles.php?group_id=13153
+ * An XML pretty printer based on xsl stylesheets
*/
public class XMLPrettyPrinter {
private static final Log log = LogFactory.getLog(XMLPrettyPrinter.class);
- private static final String PRETTIFIED_SUFFIX = ".prettyfied";
-
/**
- * Pretty prints contents of the java source file.
+ * Pretty prints contents of the xml file.
*
* @param file
*/
- public static void prettify(File file) {
+ public static void prettify(File file) {
try {
- //create the input stream
- InputStream input = new FileInputStream(file);
-
- //create a new file with "prettyfied" attached
- // to existing file name
- String existingFileName = file.getAbsolutePath();
- String tempFileName = existingFileName + PRETTIFIED_SUFFIX;
+ InputStream inputStream = new ByteArrayInputStream(IOUtils.getStreamAsByteArray(new FileInputStream(file)));
- File tempFile = new File(tempFileName);
- FileOutputStream tempFileOutputStream = new FileOutputStream(tempFile);
+ FileOutputStream outputStream = new FileOutputStream(file);
Source stylesheetSource = new StreamSource(new ByteArrayInputStream(prettyPrintStylesheet.getBytes()));
- Source xmlSource = new StreamSource(input);
+ Source xmlSource = new StreamSource(inputStream);
TransformerFactory tf = TransformerFactory.newInstance();
Templates templates = tf.newTemplates(stylesheetSource);
Transformer transformer = templates.newTransformer();
- transformer.transform(xmlSource, new StreamResult(tempFileOutputStream));
+ transformer.transform(xmlSource, new StreamResult(outputStream));
- //first close the streams. if not this may cause the
- // files not to be renamed
- input.close();
- tempFileOutputStream.close();
- //delete the original
- file.delete();
-
- if (!tempFile.renameTo(new File(existingFileName))) {
- throw new Exception("File renaming failed!" + existingFileName);
- }
+ inputStream.close();
+ outputStream.close();
log.debug("Pretty printed file : " + file);
- } catch (ClassNotFoundException e) {
- log.debug("Tidy not found - unable to pretty print " + file);
} catch (Exception e) {
log.warn("Exception occurred while trying to pretty print file " + file, e);
} catch (Throwable t) {
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java Fri Jul 27 14:58:51 2007
@@ -62,7 +62,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- phase = (Phase) globalinflow.get(2);
+ phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
@@ -89,7 +89,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- phase = (Phase) globalinflow.get(2);
+ phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(0, phase.getHandlerCount());
AxisService service = config.getService(serviceName);
@@ -126,7 +126,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- phase = (Phase) globalinflow.get(2);
+ phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
@@ -153,7 +153,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- predisptah = (Phase) globalinflow.get(2);
+ predisptah = (Phase) globalinflow.get(3);
assertNotNull(predisptah);
assertEquals(predisptah.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
@@ -180,7 +180,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- phase = (Phase) globalinflow.get(2);
+ phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
@@ -207,7 +207,7 @@
Phase userPhase;
ArrayList globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
- phase = (Phase) globalinflow.get(2);
+ phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java Fri Jul 27 14:58:51 2007
@@ -24,19 +24,15 @@
import org.apache.axis2.deployment.DeploymentException;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.util.Constants;
+import org.apache.axis2.metadata.registry.MetadataFactoryRegistry;
/** This class serves as a factory for ConfigurationContexts suitable in the client environment. */
public class ClientConfigurationFactory {
- private static ClientConfigurationFactory instance = new ClientConfigurationFactory();
-
- protected ClientConfigurationFactory() {
- }
-
/** Returns a ClientConfigurationFactory object. */
public static ClientConfigurationFactory newInstance() {
- return instance;
+ return (ClientConfigurationFactory)MetadataFactoryRegistry.getFactory(ClientConfigurationFactory.class);
}
/**
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/EndpointDescription.java Fri Jul 27 14:58:51 2007
@@ -66,6 +66,12 @@
"org.apache.axis2.jaxws.description.EndpointDescription";
public static final String DEFAULT_CLIENT_BINDING_ID = SOAPBinding.SOAP11HTTP_BINDING;
+ /**
+ * Paramater set on AxisService which contains an ArrayList of SOAP header QNames
+ * of SOAPHandlers.
+ */
+ public static final String HANDLER_PARAMETER_QNAMES = "org.apache.axis2.jaxws.description.EndpointDescription.handlerParameterQNames";
+
public abstract AxisService getAxisService();
public abstract ServiceClient getServiceClient();
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java Fri Jul 27 14:58:51 2007
@@ -59,6 +59,12 @@
* </pre>
*/
public interface OperationDescription {
+ /**
+ * Paramater set on AxisOperation which contains an ArrayList of SOAP header QNames
+ * corresponding to SEI parameters.
+ */
+ public static final String HEADER_PARAMETER_QNAMES = "org.apache.axis2.jaxws.description.OperationDescription.headerParameterQNames";
+
public EndpointInterfaceDescription getEndpointInterfaceDescription();
public FaultDescription[] getFaultDescriptions();
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java Fri Jul 27 14:58:51 2007
@@ -30,6 +30,7 @@
import javax.jws.HandlerChain;
import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlList;
import javax.xml.ws.WebServiceRef;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
@@ -231,5 +232,18 @@
paramType = getType(((GenericArrayType)type).getGenericComponentType(), paramType) + "[]";
}
return paramType;
+ }
+
+ /**
+ * This method will search array of parameter annotations for the presence of the @XmlList
+ * annotation.
+ */
+ public static boolean hasXmlListAnnotation(Annotation[] annotations) {
+ for(Annotation annotation : annotations) {
+ if(annotation.annotationType() == XmlList.class) {
+ return true;
+ }
+ }
+ return false;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java Fri Jul 27 14:58:51 2007
@@ -32,6 +32,7 @@
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.WebEndpoint;
+
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
@@ -67,6 +68,7 @@
setExceptionList(mdc, method);
mdc.setMethodName(method.getName());
setReturnType(mdc, method);
+ setIsListType(mdc, method);
mdc.setDeclaringClass(method.getDeclaringClass().getName());
attachHandlerChainAnnotation(mdc, method);
attachOnewayAnnotation(mdc, method);
@@ -302,4 +304,9 @@
mdc.setReturnType(((Class)type).getName());
}
}
+
+ private void setIsListType(MethodDescriptionComposite mdc, Method method) {
+ mdc.setIsListType(ConverterUtils.hasXmlListAnnotation(method.getAnnotations()));
+ }
+
}
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?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- 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 Fri Jul 27 14:58:51 2007
@@ -20,9 +20,14 @@
import static org.apache.axis2.jaxws.description.builder.MDQConstants.CONSTRUCTOR_METHOD;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.AttachmentDescription;
import org.apache.axis2.jaxws.description.AttachmentType;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
import org.apache.axis2.jaxws.description.builder.WebMethodAnnot;
@@ -45,6 +50,8 @@
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.soap.SOAPHandler;
import java.io.IOException;
import java.io.InputStream;
@@ -56,6 +63,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import java.util.StringTokenizer;
/** Utilities used throughout the Description package. */
@@ -494,5 +502,38 @@
}
}
}
+ }
+
+ public static void registerHandlerHeaders(AxisService axisService, List<Handler> handlers) {
+ if (handlers == null || axisService == null) {
+ return;
+ }
+
+ ArrayList<QName> understoodHeaderQNames = new ArrayList<QName>();
+ for (Handler handler : handlers) {
+ if (handler instanceof SOAPHandler) {
+ SOAPHandler soapHandler = (SOAPHandler) handler;
+
+ Set<QName> headers = soapHandler.getHeaders();
+ if (headers != null) {
+ for (QName header : headers) {
+ if (!understoodHeaderQNames.contains(header)) {
+ understoodHeaderQNames.add(header);
+ }
+ }
+ }
+ }
+ }
+
+ if (!understoodHeaderQNames.isEmpty()) {
+ Parameter headerQNParameter =
+ new Parameter(EndpointDescription.HANDLER_PARAMETER_QNAMES, understoodHeaderQNames);
+ try {
+ axisService.addParameter(headerQNParameter);
+ } catch (AxisFault e) {
+ // TODO: RAS
+ log.warn("Unable to add Parameter for header QNames to AxisService " + axisService, e);
+ }
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Fri Jul 27 14:58:51 2007
@@ -20,11 +20,13 @@
package org.apache.axis2.jaxws.description.impl;
+import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.wsdl.WSDL11ActionHelper;
import org.apache.axis2.description.AxisMessage;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisOperationFactory;
import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.AttachmentDescription;
@@ -42,6 +44,8 @@
import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
import org.apache.axis2.jaxws.description.builder.OneWayAnnot;
import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.converter.ConverterUtils;
+import org.apache.axis2.jaxws.util.WSDL4JWrapper;
import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -56,6 +60,7 @@
import javax.wsdl.BindingInput;
import javax.wsdl.BindingOperation;
import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
import javax.wsdl.extensions.AttributeExtensible;
import javax.xml.bind.annotation.XmlList;
import javax.xml.namespace.QName;
@@ -65,10 +70,12 @@
import javax.xml.ws.ResponseWrapper;
import javax.xml.ws.WebFault;
+import java.io.File;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -186,7 +193,7 @@
parentEndpointInterfaceDescription = parent;
partAttachmentMap = new HashMap<String, AttachmentDescription>();
setSEIMethod(method);
- checkForXmlListAnnotation(method.getAnnotations());
+ isListType = ConverterUtils.hasXmlListAnnotation(method.getAnnotations());
// The operationQName is intentionally unqualified to be consistent with the remaining parts of the system.
// Using a qualified name will cause breakage.
// Don't do --> this.operationQName = new QName(parent.getTargetNamespace(), getOperationName());
@@ -233,6 +240,8 @@
} else {
this.axisOperation = createAxisOperation();
}
+ // Register understood headers on axisOperation
+ registerMustUnderstandHeaders();
}
/**
@@ -486,6 +495,8 @@
parameterDescriptions = createParameterDescriptions();
faultDescriptions = createFaultDescriptions();
}
+ // Register understood headers on axisOperation
+ registerMustUnderstandHeaders();
}
public EndpointInterfaceDescription getEndpointInterfaceDescription() {
@@ -1659,14 +1670,6 @@
// TODO Add toString support
runtimeDescMap.put(ord.getKey(), ord);
}
-
- private void checkForXmlListAnnotation(Annotation[] annotations) {
- for(Annotation annotation : annotations) {
- if(annotation.annotationType() == XmlList.class) {
- isListType = true;
- }
- }
- }
public boolean isListType() {
return isListType;
@@ -1796,7 +1799,8 @@
.getEndpointDescriptionImpl()
.isWSDLFullySpecified()) {
if (log.isDebugEnabled()) {
- log.debug("A full WSDL is available. Query the WSDL binding for the AttachmentDescription information.");
+ log.debug("A full WSDL is available. Query the WSDL binding for the " +
+ "AttachmentDescription information.");
}
DescriptionUtils.getAttachmentFromBinding(this,
this.getEndpointInterfaceDescriptionImpl()
@@ -1804,24 +1808,67 @@
.getWSDLBinding());
} else {
if (log.isDebugEnabled()) {
- log.debug("A full WSDL is not available. AttachmentDescriptions are not built. Processing continues.");
+ log.debug("The WSDL is not available. Looking for @WebService wsdlLocation.");
}
- // TODO: Dummy attachment code to get the attachment test working. I am working on the code
- // to get this information built automatically from the wsdl
- // START_HACK
- if (log.isDebugEnabled()) {
- log.debug("Adding dummy Attachment information.");
+
+ // Try getting a WSDL
+ String wsdlLocation = this.getEndpointInterfaceDescriptionImpl().
+ getEndpointDescriptionImpl().
+ getAnnoWebServiceWSDLLocation();
+
+ if (wsdlLocation == null || wsdlLocation.length() == 0) {
+ if (log.isDebugEnabled()) {
+ log.debug("@WebService wsdlLocation is not specified. " +
+ "Processing continues without AttachmentDescription information");
+ }
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("@WebService wsdlLocation is " + wsdlLocation);
+ }
+
+ Definition def = null;
+ WSDL4JWrapper wsdl4j = null;
+ try {
+ File file = new File(wsdlLocation);
+ URL url = file.toURL();
+ wsdl4j = new WSDL4JWrapper(url);
+ def = wsdl4j.getDefinition();
+ } catch (Throwable t) {
+ if (log.isDebugEnabled()) {
+ log.debug("Error occurred while loading WSDL. " +
+ "Procesing continues without AttachmentDescription " +
+ "information. " + t);
+ }
+ }
+ if (def != null) {
+ // Set the WSDL on the server
+ this.getEndpointInterfaceDescriptionImpl().getEndpointDescriptionImpl().
+ getServiceDescriptionImpl().setWsdlWrapper(wsdl4j);
+ if (log.isDebugEnabled()) {
+ log.debug("WSDL Definition is loaded. Get the WSDL Binding.");
+ }
+
+ Binding binding = this.getEndpointInterfaceDescriptionImpl().
+ getEndpointDescriptionImpl().getWSDLBinding();
+
+ if (binding == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("WSDL Binding was not found for serviceName=" +
+ this.getEndpointInterfaceDescription().
+ getEndpointDescription().getServiceQName() +
+ " and portName=" +
+ this.getEndpointInterfaceDescription().
+ getEndpointDescription().getPortQName());
+ }
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Query Binding for AttachmentDescription Information");
+ }
+ DescriptionUtils.getAttachmentFromBinding(this, binding);
+ }
+ }
}
- addPartAttachmentDescription("dummyAttachmentIN",
- new AttachmentDescriptionImpl(AttachmentType.SWA,
- new String[] {"text/plain"}));
- addPartAttachmentDescription("dummyAttachmentINOUT",
- new AttachmentDescriptionImpl(AttachmentType.SWA,
- new String[] {"image/jpeg"}));
- addPartAttachmentDescription("dummyAttachmentOUT",
- new AttachmentDescriptionImpl(AttachmentType.SWA,
- new String[] {"text/plain"}));
- // END_HACK
+
}
if (log.isDebugEnabled()) {
log.debug("End buildAttachmentInformation");
@@ -1953,4 +2000,60 @@
}
return string.toString();
}
+
+ /**
+ * Adds a list of SOAP header QNames that are understood by JAXWS for this operation to the
+ * AxisOperation. This will be used by Axis2 to verify that all headers marked as
+ * mustUnderstand have been or will be processed.
+ *
+ * Server side headers considered understood [JAXWS 2.0 Sec 10.2.1 page 117]
+ * - SEI method params that are in headers
+ * - Headers processed by application handlers (TBD)
+ *
+ * Client side headers considered understood: None
+ *
+ */
+ private void registerMustUnderstandHeaders() {
+
+ // REVIEW: If client side (return value, OUT or INOUT params) needs to be supported then
+ // this needs to process client and server differently.
+
+ AxisOperation theAxisOperation = getAxisOperation();
+ if (theAxisOperation == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("The axis operation is null, so header QNames could not be registered. OpDesc = " + this);
+ }
+ return;
+ }
+
+ // If any IN or INOUT parameters are in the header, then add their QNames to the list
+ ParameterDescription paramDescs[] = getParameterDescriptions();
+ ArrayList understoodQNames = new ArrayList();
+ if (paramDescs != null && paramDescs.length > 0) {
+ for (ParameterDescription paramDesc : paramDescs) {
+ if (paramDesc.isHeader()
+ && (paramDesc.getMode() == WebParam.Mode.IN
+ || paramDesc.getMode() == WebParam.Mode.INOUT)) {
+ QName headerQN = new QName(paramDesc.getTargetNamespace(),
+ paramDesc.getParameterName());
+ understoodQNames.add(headerQN);
+ if (log.isDebugEnabled()) {
+ log.debug("OpDesc: understoodQName added to AxisOperation (if not null) " + headerQN);
+ }
+ }
+ }
+ }
+
+ if (!understoodQNames.isEmpty()) {
+ Parameter headerQNParameter = new Parameter(OperationDescription.HEADER_PARAMETER_QNAMES,
+ understoodQNames);
+ try {
+ theAxisOperation.addParameter(headerQNParameter);
+ } catch (AxisFault e) {
+ // TODO: RAS
+ log.warn("Unable to add Parameter for header QNames to AxisOperation " + theAxisOperation, e);
+ }
+ }
+ }
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java Fri Jul 27 14:58:51 2007
@@ -28,6 +28,7 @@
import org.apache.axis2.jaxws.description.ParameterDescriptionJava;
import org.apache.axis2.jaxws.description.ParameterDescriptionWSDL;
import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.converter.ConverterUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -90,7 +91,7 @@
getGenericParameterActualType((ParameterizedType)parameterGenericType);
}
findWebParamAnnotation(parameterAnnotations);
- findXmlListAnnotation(parameterAnnotations);
+ this.isListType = ConverterUtils.hasXmlListAnnotation(parameterAnnotations);
}
ParameterDescriptionImpl(int parameterNumber, ParameterDescriptionComposite pdc,
@@ -120,18 +121,6 @@
// javadoc: "Note that an interface that manually extends this one does not define an annotation type."
if (checkAnnotation.annotationType() == WebParam.class) {
webParamAnnotation = (WebParam)checkAnnotation;
- }
- }
- }
-
- /**
- * This method will search array of parameter annotations for the presence of the @XmlList
- * annotation.
- */
- private void findXmlListAnnotation(Annotation[] annotations) {
- for (Annotation checkAnnotation:annotations) {
- if (checkAnnotation.annotationType() == XmlList.class) {
- isListType = true;
}
}
}
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?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- 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 Fri Jul 27 14:58:51 2007
@@ -21,6 +21,7 @@
import java.util.Hashtable;
import java.util.Map;
+import org.apache.axis2.jaxws.ClientConfigurationFactory;
import org.apache.axis2.metadata.factory.ResourceFinderFactory;
public class MetadataFactoryRegistry {
@@ -28,6 +29,7 @@
static {
table = new Hashtable<Class,Object>();
table.put(ResourceFinderFactory.class, new ResourceFinderFactory());
+ table.put(ClientConfigurationFactory.class, new ClientConfigurationFactory());
}
/**
Modified: webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/MexMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/MexMessageReceiver.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/MexMessageReceiver.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/MexMessageReceiver.java Fri Jul 27 14:58:51 2007
@@ -33,13 +33,13 @@
import org.apache.axis2.dataretrieval.OutputForm;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
-import org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver;
import org.apache.axis2.mex.om.Location;
import org.apache.axis2.mex.om.Metadata;
import org.apache.axis2.mex.om.MetadataReference;
import org.apache.axis2.mex.om.MetadataSection;
import org.apache.axis2.mex.om.MexOMException;
import org.apache.axis2.mex.util.MexUtil;
+import org.apache.axis2.receivers.AbstractInOutMessageReceiver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,7 +49,7 @@
* Message Receiver for processing WS-MEX GetMetadata request.
*
*/
-public class MexMessageReceiver extends AbstractInOutSyncMessageReceiver {
+public class MexMessageReceiver extends AbstractInOutMessageReceiver {
private static final Log log = LogFactory.getLog(MexMessageReceiver.class);
Parameter axisConfigMEXParm = null;
Parameter serviceConfigMEXParm = null;
@@ -113,8 +113,10 @@
OMElement aReq = body.getFirstChildWithName(new QName(
MexConstants.Spec_2004_09.NS_URI,
MexConstants.SPEC.GET_METADATA));
+
List metadata_request_list;
if (aReq != null) {
+ mexNamespaceValue = MexConstants.Spec_2004_09.NS_URI;
metadata_request_list = determineMetadataTypes(aReq);
} else {
@@ -136,27 +138,32 @@
public Metadata processRequest(List metadata_request_list,
MessageContext msgContext, OMElement aReq) throws MexException {
-
- String identifier_value = null;
+ // Instantiate Metadata instance to build the WS-Mex Metadata element
+ SOAPEnvelope envelope = msgContext.getEnvelope();
+ String soapNamespaceURI = envelope.getNamespace().getNamespaceURI();
+ SOAPFactory factory = MexUtil.getSOAPFactory(soapNamespaceURI);
+
+ Metadata metadata = new Metadata(factory, mexNamespaceValue);
DataRetrievalRequest requestOptions = new DataRetrievalRequest();
+
+ String identifier_value = null;
// Check if Identifier element included in request
- OMElement identifier = aReq.getFirstChildWithName(new QName(
- MexConstants.SPEC.IDENTIFIER));
- if (identifier != null) {
- identifier_value = identifier.getText();
- if (identifier_value != null && identifier_value.length() > 0) {
- requestOptions.putIdentifier(identifier_value);
- }
- }
-
- // Instantiate Metadata instance to build the WS-Mex Metadata element
- SOAPEnvelope envelope = msgContext.getEnvelope();
- String soapNamespaceURI = envelope.getNamespace().getNamespaceURI();
- SOAPFactory factory = MexUtil.getSOAPFactory(soapNamespaceURI);
- mexNamespaceValue = MexConstants.Spec_2004_09.NS_URI;
- Metadata metadata = new Metadata(factory, mexNamespaceValue);
-
+ OMElement dialectElem = aReq.getFirstChildWithName(new QName(
+ mexNamespaceValue, MexConstants.SPEC.DIALECT));
+
+ if (dialectElem != null) {
+ OMElement identifier = dialectElem.getFirstChildWithName(new QName(
+ mexNamespaceValue, MexConstants.SPEC.IDENTIFIER));
+
+ if (identifier != null) {
+ identifier_value = identifier.getText();
+ if (identifier_value != null && identifier_value.length() > 0) {
+ requestOptions.putIdentifier(identifier_value);
+ }
+ }
+ }
+
// Process the request and append MetadataSection to Metadata
// Loop through the metadata_request_list for Dialect(s)), and setup requestOptions.
// Basically, one requestOptions is setup for each supported outputForm for the Dialect
@@ -165,7 +172,8 @@
OutputForm[] outputforms;
for (int i = 0; i < len; i++) { // metadata request
- String dialect = "";
+
+ String dialect = "";
try {
dialect = (String) metadata_request_list.get(i);
@@ -195,6 +203,7 @@
} catch (Throwable e) {
log.error("Throwable detected for dialect, " + dialect , e);
+ e.printStackTrace();
throw new MexException(e);
}
@@ -275,16 +284,18 @@
boolean allTypes = false;
- OMElement dialect = aReq.getFirstChildWithName(new QName(
+ OMElement dialect = aReq.getFirstChildWithName(new QName(mexNamespaceValue,
MexConstants.SPEC.DIALECT));
if (dialect != null) {
String dialectText = dialect.getText();
if (dialectText != null && dialectText.length() > 0) {
metadata_request_list.add(dialectText.trim());
- } else
+ } else {
allTypes = true;
- } else
+ }
+ } else {
allTypes = true;
+ }
if (allTypes) { // retrieve all metadata
metadata_request_list.add(MexConstants.SPEC.DIALECT_TYPE_POLICY);
Modified: webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/Metadata.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/Metadata.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/Metadata.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/Metadata.java Fri Jul 27 14:58:51 2007
@@ -165,7 +165,7 @@
if (aFactory == null) {
aFactory = factory;
}
- Iterator mexSections = mexElement.getChildrenWithName(new QName(MexConstants.SPEC.METADATA_SECTION));
+ Iterator mexSections = mexElement.getChildrenWithName(new QName(namespaceValue, MexConstants.SPEC.METADATA_SECTION));
if (mexSections == null){
throw new MexOMException("Metadata element does not contain MetadataSection element.");
Modified: webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/MetadataSection.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/MetadataSection.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/MetadataSection.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/mex/src/org/apache/axis2/mex/om/MetadataSection.java Fri Jul 27 14:58:51 2007
@@ -101,7 +101,7 @@
setIdentifier(identifierAttr.getAttributeValue());
}
// validate one of the following element must exist: Location, MetadataReference, inline data
- OMElement locationElem = element.getFirstChildWithName(new QName(MexConstants.SPEC.LOCATION));
+ OMElement locationElem = element.getFirstChildWithName(new QName(namespaceValue, MexConstants.SPEC.LOCATION));
Location location = null;
MetadataReference ref = null;
@@ -110,7 +110,7 @@
setLocation(location.fromOM(locationElem));
}
else { // check for MetadataReference
- OMElement refElem = element.getFirstChildWithName(new QName(MexConstants.SPEC.METADATA_REFERENCE));
+ OMElement refElem = element.getFirstChildWithName(new QName(namespaceValue, MexConstants.SPEC.METADATA_REFERENCE));
if (refElem != null ){
ref = new MetadataReference(factory, namespaceValue);
setMetadataReference(ref.fromOM(refElem));
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?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml Fri Jul 27 14:58:51 2007
@@ -114,7 +114,7 @@
<jettison.version>1.0-RC1</jettison.version>
<jibx.version>1.1.5</jibx.version>
<junit.version>4.3.1</junit.version>
- <log4j.version>1.2.13</log4j.version>
+ <log4j.version>1.2.14</log4j.version>
<maven.archiver.version>2.2</maven.archiver.version>
<maven.artifact.version>2.0.4</maven.artifact.version>
<maven.assembly.version>2.2-beta-1</maven.assembly.version>
@@ -809,6 +809,11 @@
<artifactId>jalopy</artifactId>
<version>${jalopy.version}</version>
</dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${xerces.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<!-- Top level dependencies that will be needed in all sub mvn modules -->
@@ -847,8 +852,16 @@
<groupId>${stax.impl.groupid}</groupId>
<artifactId>${stax.impl.artifactid}</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
</dependencies>
+
<profiles>
<profile>
<id>java14</id>
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/pom.xml Fri Jul 27 14:58:51 2007
@@ -38,11 +38,35 @@
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-saaj-api</artifactId>
<version>${version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-activation_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>${version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-activation_1.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
</dependency>
</dependencies>
<build>
@@ -66,6 +90,13 @@
<directory>test-resources</directory>
<includes>
<include>**/*.*</include>
+ </includes>
+ </testResource>
+ <testResource>
+ <targetPath></targetPath>
+ <directory>test-resources</directory>
+ <includes>
+ <include>**/*.properties</include>
</includes>
</testResource>
</testResources>
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyImpl.java Fri Jul 27 14:58:51 2007
@@ -148,6 +148,10 @@
if (uri == null || "".equals(uri)) {
childEle = new SOAPBodyElementImpl(
(ElementImpl)getOwnerDocument().createElement(localName));
+ } else if (prefix == null || "".equals(prefix)) {
+ childEle = new SOAPBodyElementImpl(
+ (ElementImpl)getOwnerDocument().createElementNS(uri,
+ localName));
} else {
childEle = new SOAPBodyElementImpl(
(ElementImpl)getOwnerDocument().createElementNS(uri,
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java Fri Jul 27 14:58:51 2007
@@ -30,8 +30,11 @@
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.DispatchPhase;
import org.apache.axis2.saaj.util.IDGenerator;
import org.apache.axis2.saaj.util.SAAJUtil;
+import org.apache.axis2.saaj.util.UnderstandAllHeadersHandler;
import org.apache.axis2.wsdl.WSDLConstants;
import javax.activation.DataHandler;
@@ -55,6 +58,7 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
@@ -105,11 +109,16 @@
// initialize the Sender
OperationClient opClient;
try {
- serviceClient = new ServiceClient();
+ serviceClient = new ServiceClient();
+ disableMustUnderstandProcessing(serviceClient.getAxisConfiguration());
opClient = serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
} catch (AxisFault e) {
throw new SOAPException(e);
}
+
+ options.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,
+ request.getProperty(SOAPMessage.CHARACTER_SET_ENCODING));
+
opClient.setOptions(options);
if (request.countAttachments() != 0) { // SOAPMessage with attachments
@@ -121,6 +130,33 @@
}
}
+ /*
+ * Installs UnderstandAllHeadersHandler that marks all headers as processed
+ * because MU validation should not be done for SAAJ clients.
+ */
+ private void disableMustUnderstandProcessing(AxisConfiguration config) {
+ DispatchPhase phase;
+ phase = getDispatchPhase(serviceClient.getAxisConfiguration().getInFlowPhases());
+ if (phase != null) {
+ phase.addHandler(new UnderstandAllHeadersHandler());
+ }
+ phase = getDispatchPhase(serviceClient.getAxisConfiguration().getInFaultFlowPhases());
+ if (phase != null) {
+ phase.addHandler(new UnderstandAllHeadersHandler());
+ }
+ }
+
+ private static DispatchPhase getDispatchPhase(List phases) {
+ Iterator iter = phases.iterator();
+ while(iter.hasNext()) {
+ Object phase = iter.next();
+ if (phase instanceof DispatchPhase) {
+ return (DispatchPhase)phase;
+ }
+ }
+ return null;
+ }
+
/**
* Closes this <CODE>SOAPConnection</CODE> object.
*
@@ -153,8 +189,8 @@
MessageContext msgCtx =
opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
return getSOAPMessage(msgCtx.getEnvelope());
- } catch (AxisFault e) {
- throw new SOAPException(e.getMessage());
+ } catch (Exception e) {
+ throw new SOAPException(e.getMessage(), e);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/quickstartadb/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/quickstartadb/build.xml?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/quickstartadb/build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/quickstartadb/build.xml Fri Jul 27 14:58:51 2007
@@ -77,7 +77,7 @@
<property name="axis2.home" value="../../${AXIS2_HOME}"/>
</ant>
<copy file="${basedir}/build/service/build/lib/StockQuoteService.aar"
- toDir="${basedir}/../../repository/services/StockQuoteService.aar"
+ toDir="${basedir}/../../repository/services"
overwrite="yes">
</copy>
Modified: webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-service-plugin/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-service-plugin/pom.xml?view=diff&rev=560397&r1=560396&r2=560397
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-service-plugin/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/tool/axis2-eclipse-service-plugin/pom.xml Fri Jul 27 14:58:51 2007
@@ -233,7 +233,7 @@
<filter token="version_number" value="${version_number}"/>
<filter token="ant.version" value="${ant.version}"/>
<filter token="commons.logging.version" value="${commons.logging.version}"/>
- <filter token="log4j.version" value="1.2.13"/>
+ <filter token="log4j.version" value="1.2.14"/>
<delete dir="./target/plugin/${service.plugin.version}"/>
<mkdir dir="./target/plugin/${service.plugin.version}"/>
<delete dir="./target/dist"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org