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/06/10 13:42:22 UTC
svn commit: r545866 [5/7] - in /webservices/axis2/branches/java/jaxws21:
modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb/src/org/apache/axis2/databinding/types/
modules/adb/src/org/apache/axis2/databinding/utils/
modules/adb/src/org/apache...
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Sun Jun 10 04:42:12 2007
@@ -31,18 +31,7 @@
import org.apache.axis2.util.JavaUtils;
import org.apache.axis2.util.Utils;
import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HeaderElement;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpMethodBase;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.NTCredentials;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.HttpVersion;
+import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.auth.AuthPolicy;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.protocol.Protocol;
@@ -615,7 +604,22 @@
.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
}
} else {
- httpClient = new HttpClient();
+ HttpConnectionManager connManager =
+ (HttpConnectionManager) msgContext.getProperty(
+ HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER);
+ if(connManager==null){
+ connManager =
+ new SimpleHttpConnectionManager();
+ msgContext.getConfigurationContext().
+ setProperty(
+ HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER,
+ connManager);
+ }
+ if(msgContext.isServerSide()){
+ httpClient = new HttpClient();
+ } else {
+ httpClient = new HttpClient(connManager);
+ }
}
// Get the timeout values set in the runtime
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java Sun Jun 10 04:42:12 2007
@@ -434,6 +434,8 @@
*/
public static final String CACHED_HTTP_CLIENT = "CACHED_HTTP_CLIENT";
+ public static final String MUTTITHREAD_HTTP_CONNECTION_MANAGER = "MUTTITHREAD_HTTP_CONNECTION_MANAGER";
+
/**
* Field CACHED_HTTP_CLIENT
*/
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Sun Jun 10 04:42:12 2007
@@ -74,9 +74,9 @@
SOAPFactory soapFactory = new SOAP11Factory();
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
OMNamespace omNs = soapFactory.createOMNamespace(service.getSchematargetNamespace(),
- service.getSchematargetNamespacePrefix());
+ service.getSchemaTargetNamespacePrefix());
soapFactory.createOMNamespace(service.getSchematargetNamespace(),
- service.getSchematargetNamespacePrefix());
+ service.getSchemaTargetNamespacePrefix());
OMElement opElement = soapFactory.createOMElement(operation, omNs);
Iterator it = map.keySet().iterator();
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java Sun Jun 10 04:42:12 2007
@@ -22,6 +22,7 @@
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
+import java.util.Iterator;
import org.apache.axis2.Constants;
import org.apache.axis2.context.ConfigurationContext;
@@ -86,15 +87,36 @@
}
if (uri.indexOf("?") < 0) {
if (!uri.endsWith(contextPath)) {
- String serviceName = uri.replaceAll(contextPath, "");
- if (serviceName.indexOf("/") < 0) {
- String s = HTTPTransportReceiver
- .printServiceHTML(serviceName, configurationContext);
- response.setStatus(HttpStatus.SC_OK);
- response.setContentType("text/html");
- OutputStream out = response.getOutputStream();
- out.write(EncodingUtils.getBytes(s, HTTP.ISO_8859_1));
- return;
+ if (uri.endsWith(".xsd") || uri.endsWith(".wsdl")) {
+ HashMap services = configurationContext.getAxisConfiguration().getServices();
+ String file = uri.substring(uri.lastIndexOf("/") + 1,
+ uri.length());
+ if ((services != null) && !services.isEmpty()) {
+ Iterator i = services.values().iterator();
+ while (i.hasNext()) {
+ AxisService service = (AxisService) i.next();
+ InputStream stream = service.getClassLoader().getResourceAsStream("META-INF/" + file);
+ if (stream != null) {
+ OutputStream out = response.getOutputStream();
+ response.setContentType("text/xml");
+ ListingAgent.copy(stream, out);
+ out.flush();
+ out.close();
+ return;
+ }
+ }
+ }
+ } else {
+ String serviceName = uri.replaceAll(contextPath, "");
+ if (serviceName.indexOf("/") < 0) {
+ String s = HTTPTransportReceiver
+ .printServiceHTML(serviceName, configurationContext);
+ response.setStatus(HttpStatus.SC_OK);
+ response.setContentType("text/html");
+ OutputStream out = response.getOutputStream();
+ out.write(EncodingUtils.getBytes(s, HTTP.ISO_8859_1));
+ return;
+ }
}
}
}
@@ -103,10 +125,9 @@
HashMap services = configurationContext.getAxisConfiguration().getServices();
AxisService service = (AxisService) services.get(serviceName);
if (service != null) {
- String ip = getHostAddress(request);
response.setStatus(HttpStatus.SC_OK);
response.setContentType("text/xml");
- service.printWSDL2(response.getOutputStream(), ip, servicePath);
+ service.printWSDL2(response.getOutputStream());
return;
}
}
@@ -115,10 +136,9 @@
HashMap services = configurationContext.getAxisConfiguration().getServices();
AxisService service = (AxisService) services.get(serviceName);
if (service != null) {
- String ip = getHostAddress(request);
response.setStatus(HttpStatus.SC_OK);
response.setContentType("text/xml");
- service.printWSDL(response.getOutputStream(), ip, servicePath);
+ service.printWSDL(response.getOutputStream());
return;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java Sun Jun 10 04:42:12 2007
@@ -210,7 +210,7 @@
res.setContentType("text/xml");
String ip = extractHostAndPort(filePart, isHttp);
((AxisService) serviceObj)
- .printWSDL2(out, ip, configContext.getServiceContextPath());
+ .printWSDL2(out);
out.flush();
out.close();
return;
@@ -218,7 +218,7 @@
OutputStream out = res.getOutputStream();
res.setContentType("text/xml");
String ip = extractHostAndPort(filePart, isHttp);
- ((AxisService) serviceObj).printWSDL(out, ip, configContext.getServicePath());
+ ((AxisService) serviceObj).printWSDL(out, ip);
out.flush();
out.close();
return;
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java Sun Jun 10 04:42:12 2007
@@ -382,6 +382,7 @@
msgContext.setAxisMessage(inMessage);
opContext.addMessageContext(msgContext);
msgContext.setServiceContext(opContext.getServiceContext());
+ return true;
}
}
}
@@ -391,10 +392,9 @@
SynchronousMailListener listener = (SynchronousMailListener) callBackTable.get(messageID);
if(listener!=null){
listener.setInMessageContext(msgContext);
- return false;
}
}
- return true;
+ return false;
}
private void buildSOAPEnvelope(MimeMessage msg, MessageContext msgContext)
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java Sun Jun 10 04:42:12 2007
@@ -82,6 +82,9 @@
String WSDL_VERSION_1 = "1.1";
+ String NO_MESSAGE_RECEIVER_OPTION_LONG = "noMessageReceiver";
+ String NO_WSDLS_OPTION_LONG = "noWSDL";
+ String NO_BUILD_XML_OPTION_LONG = "noBuildXML";
}
interface Java2WSDLConstants {
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?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- 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 Sun Jun 10 04:42:12 2007
@@ -28,7 +28,7 @@
* @param rootLocation - Location to be written
* @param packageName - package, can be '.' separated
* @param fileName name of the file
- * @param extension type of the file, java, csharp, cpp etc
+ * @param extension type of the file, java, cpp etc
* @return the File that was created
* @throws IOException
* @throws Exception
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java Sun Jun 10 04:42:12 2007
@@ -523,6 +523,10 @@
message = getFaultReasonFromException(e, context);
}
}
+ } else {
+ if (e != null && (message == null || "".equals(message))) {
+ message = getFaultReasonFromException(e, context);
+ }
}
// defaulting to reason, unknown, if no reason is available
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Utils.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/Utils.java Sun Jun 10 04:42:12 2007
@@ -22,8 +22,6 @@
import org.apache.axiom.soap.SOAPFault;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
-import org.apache.axis2.clustering.ClusterManager;
-import org.apache.axis2.clustering.context.ContextManager;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
@@ -146,20 +144,8 @@
.getParent());
serviceGroupContext.setId(serviceGroupContextId);
- configurationContext.registerServiceGroupContextintoSoapSessionTable(serviceGroupContext);
- ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService);
-
- ClusterManager clusterManager =
- configurationContext.getAxisConfiguration().getClusterManager();
- if (clusterManager != null) {
- ContextManager contextManager = clusterManager.getContextManager();
- if (contextManager!=null) {
- contextManager.addContext(serviceGroupContext);
- contextManager.addContext(serviceContext);
- }
- }
-
- return serviceContext;
+ configurationContext.addServiceGroupContextIntoSoapSessionTable(serviceGroupContext);
+ return serviceGroupContext.getServiceContext(axisService);
}
/**
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=545866&r1=545865&r2=545866
==============================================================================
--- 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 Sun Jun 10 04:42:12 2007
@@ -23,6 +23,7 @@
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisDescription;
+import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.axis2.wsdl.SOAPHeaderMessage;
import org.apache.axis2.wsdl.SOAPModuleMessage;
@@ -34,7 +35,6 @@
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMText;
-import org.apache.ws.java2wsdl.Java2WSDLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
@@ -278,48 +278,77 @@
eprs = new String[]{axisService.getName()};
}
OMElement serviceElement = null;
+ serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
+ serviceElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME,
+ null, axisService.getName()));
+ serviceElement.addAttribute(omFactory.createOMAttribute(
+ WSDL2Constants.INTERFACE_LOCAL_NAME, null,
+ tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
for (int i = 0; i < eprs.length; i++) {
- serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
- serviceElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME,
- null, axisService.getName()));
- serviceElement.addAttribute(omFactory.createOMAttribute(
- WSDL2Constants.INTERFACE_LOCAL_NAME, null,
- tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
+ String name = "";
+ String epr = eprs[i];
+ if (!epr.endsWith("/")) {
+ epr = epr + "/";
+ }
+ if (epr.startsWith("https://")) {
+ name = WSDL2Constants.DEFAULT_HTTPS_PREFIX;
+ }
OMElement soap11EndpointElement =
omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
soap11EndpointElement.addAttribute(omFactory.createOMAttribute(
WSDL2Constants.ATTRIBUTE_NAME, null,
- WSDL2Constants.DEFAULT_SOAP11_ENDPOINT_NAME));
+ name + WSDL2Constants.DEFAULT_SOAP11_ENDPOINT_NAME));
soap11EndpointElement.addAttribute(omFactory.createOMAttribute(
WSDL2Constants.BINDING_LOCAL_NAME, null,
tns.getPrefix() + ":" + axisService.getName() +
Java2WSDLConstants.BINDING_NAME_SUFFIX));
soap11EndpointElement.addAttribute(
- omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, eprs[i]));
+ 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,
- WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME));
+ 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, eprs[i]));
+ omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, epr));
serviceElement.addChild(soap12EndpointElement);
OMElement httpEndpointElement =
omFactory.createOMElement(WSDL2Constants.ENDPOINT_LOCAL_NAME, wsdl);
httpEndpointElement.addAttribute(omFactory.createOMAttribute(
WSDL2Constants.ATTRIBUTE_NAME, null,
- WSDL2Constants.DEFAULT_HTTP_ENDPOINT_NAME));
+ name + WSDL2Constants.DEFAULT_HTTP_ENDPOINT_NAME));
httpEndpointElement.addAttribute(omFactory.createOMAttribute(
WSDL2Constants.BINDING_LOCAL_NAME, null,
tns.getPrefix() + ":" + axisService.getName() + Java2WSDLConstants.HTTP_BINDING));
httpEndpointElement.addAttribute(
- omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_ADDRESS, null, eprs[i]));
+ 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);
+ OMElement httpDocumentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
+ httpDocumentation.setText("This endpoint exposes a HTTP binding over a HTTPS");
+ httpEndpointElement.addChild(httpDocumentation);
+ } else if (epr.startsWith("http://")) {
+ 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);
+ OMElement httpDocumentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
+ httpDocumentation.setText("This endpoint exposes a HTTP binding over a HTTP");
+ httpEndpointElement.addChild(httpDocumentation);
+ }
}
return serviceElement;
}
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=545866&r1=545865&r2=545866
==============================================================================
--- 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 Sun Jun 10 04:42:12 2007
@@ -2,12 +2,22 @@
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 javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.stream.StreamResult;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
import java.lang.reflect.Method;
/*
* Copyright 2004,2005 The Apache Software Foundation.
@@ -43,24 +53,6 @@
*/
public static void prettify(File file) {
try {
- // Create an instance of the Jalopy bean
- Class clazz = Loader.loadClass("org.w3c.tidy.Tidy");
- Object prettifier = clazz.newInstance();
-
- //set the input to be xml
- Method setXmlInFlagMethod = clazz.getMethod(
- "setXmlTags",
- new Class[]{boolean.class});
- setXmlInFlagMethod.invoke(prettifier,
- new Object[]{Boolean.TRUE});
-
- //set the output to be xml
- Method setXmlOutFlagMethod = clazz.getMethod(
- "setXmlOut",
- new Class[]{boolean.class});
- setXmlOutFlagMethod.invoke(prettifier,
- new Object[]{Boolean.TRUE});
-
//create the input stream
InputStream input = new FileInputStream(file);
@@ -71,15 +63,14 @@
File tempFile = new File(tempFileName);
FileOutputStream tempFileOutputStream = new FileOutputStream(tempFile);
- //Call the pretty printer
- Method parsr = clazz.getMethod("parse", new Class[]{
- InputStream.class,
- OutputStream.class});
- parsr.invoke(prettifier, new Object[]{input,
- tempFileOutputStream});
+ Source stylesheetSource = new StreamSource(new ByteArrayInputStream(prettyPrintStylesheet.getBytes()));
+ Source xmlSource = new StreamSource(input);
- //rename and restore the pretty printed one as the original
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Templates templates = tf.newTemplates(stylesheetSource);
+ Transformer transformer = templates.newTransformer();
+ transformer.transform(xmlSource, new StreamResult(tempFileOutputStream));
//first close the streams. if not this may cause the
// files not to be renamed
@@ -103,4 +94,32 @@
}
+ private static final String prettyPrintStylesheet =
+ "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' " +
+ " xmlns:xalan='http://xml.apache.org/xslt' " +
+ " exclude-result-prefixes='xalan'>" +
+ " <xsl:output method='xml' indent='yes' xalan:indent-amount='4'/>" +
+ " <xsl:strip-space elements='*'/>" +
+ " <xsl:template match='/'>" +
+ " <xsl:apply-templates/>" +
+ " </xsl:template>" +
+ " <xsl:template match='node() | @*'>" +
+ " <xsl:copy>" +
+ " <xsl:apply-templates select='node() | @*'/>" +
+ " </xsl:copy>" +
+ " </xsl:template>" +
+ "</xsl:stylesheet>";
+
+ public static void prettify(OMElement wsdlElement, OutputStream out) throws Exception {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ wsdlElement.serialize(baos);
+
+ Source stylesheetSource = new StreamSource(new ByteArrayInputStream(prettyPrintStylesheet.getBytes()));
+ Source xmlSource = new StreamSource(new ByteArrayInputStream(baos.toByteArray()));
+
+ TransformerFactory tf = TransformerFactory.newInstance();
+ Templates templates = tf.newTemplates(stylesheetSource);
+ Transformer transformer = templates.newTransformer();
+ transformer.transform(xmlSource, new StreamResult(out));
+ }
}
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=545866&r1=545865&r2=545866
==============================================================================
--- 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 Sun Jun 10 04:42:12 2007
@@ -63,7 +63,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
er.engageModule(module.getName());
@@ -88,7 +88,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
er.engageModule(module.getName());
@@ -122,7 +122,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
er.engageModule(module.getName());
@@ -147,7 +147,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
service.engageModule(module);
@@ -172,7 +172,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
service.engageModule(module);
@@ -197,7 +197,7 @@
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
- userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+ userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
operation.engageModule(module);
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=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/parent/pom.xml Sun Jun 10 04:42:12 2007
@@ -15,6 +15,13 @@
! See the License for the specific language governing permissions and
! limitations under the License.
!-->
+ <!--
+ N.B. This is a parent POM for use by the Apache Axis2 development community.
+ Please do not use this as a maven2 dependency. Please use either one of the
+ specific modules or a aggregate - org.apache.axis2:axis2
+
+ See https://issues.apache.org/jira/browse/AXIS2-2721 for more details
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache</groupId>
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=545866&r1=545865&r2=545866
==============================================================================
--- 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 Sun Jun 10 04:42:12 2007
@@ -98,11 +98,19 @@
String prefix = soapElement.getPrefix();
String localName = soapElement.getLocalName();
element.declareNamespace(namespaceURI, prefix);
-
- SOAPBodyElementImpl childEle =
+ SOAPBodyElementImpl childEle;
+
+ if (localName == null) {
+ childEle =
+ new SOAPBodyElementImpl(
+ (ElementImpl)getOwnerDocument().createElementNS(namespaceURI,
+ ""));
+ } else {
+ childEle =
new SOAPBodyElementImpl(
(ElementImpl)getOwnerDocument().createElementNS(namespaceURI,
- localName));
+ localName));
+ }
for (Iterator iter = soapElement.getAllAttributes(); iter.hasNext();) {
Name name = (Name)iter.next();
childEle.addAttribute(name, soapElement.getAttributeValue(name));
@@ -406,7 +414,16 @@
domEle.getTagName().substring(0, indexOfColon));
} else {
localname = domEle.getLocalName();
- ns = new NamespaceImpl(domEle.getNamespaceURI(), domEle.getPrefix());
+ if (domEle.getNamespaceURI() != null) {
+ ns = new NamespaceImpl(domEle.getNamespaceURI(), domEle.getPrefix());
+ } else {
+ if (domEle.getPrefix() != null) {
+ ns = new NamespaceImpl("", domEle.getPrefix());
+ } else {
+ ns = new NamespaceImpl("", "");
+
+ }
+ }
}
ElementImpl eleImpl =
new ElementImpl((DocumentImpl)this.getOwnerDocument(),
@@ -418,10 +435,18 @@
NamedNodeMap domAttrs = domEle.getAttributes();
for (int i = 0; i < domAttrs.getLength(); i++) {
org.w3c.dom.Node attrNode = domAttrs.item(i);
- saajEle.addAttribute(new PrefixedQName(attrNode.getNamespaceURI(),
- attrNode.getLocalName(),
- attrNode.getPrefix()),
- attrNode.getNodeValue());
+ if (attrNode.getLocalName() == null) {
+ //local part is required. "" is allowed to preserve compatibility with QName 1.0
+ saajEle.addAttribute(new PrefixedQName(attrNode.getNamespaceURI(),
+ "",
+ attrNode.getPrefix()),
+ attrNode.getNodeValue());
+ } else {
+ saajEle.addAttribute(new PrefixedQName(attrNode.getNamespaceURI(),
+ attrNode.getLocalName(),
+ attrNode.getPrefix()),
+ attrNode.getNodeValue());
+ }
}
NodeList childNodes = node.getChildNodes();
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java Sun Jun 10 04:42:12 2007
@@ -119,6 +119,10 @@
}
soapMessage = parentSoapMsg;
+ String knownEncoding = (String) soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
+ XMLStreamReader xmlReader = null;
+
+
InputStream modifiedInputStream = null;
StAXSOAPModelBuilder builder = null;
InputStreamReader isReader = null;
@@ -129,7 +133,8 @@
Attachments attachments =
new Attachments(inputStream, fullContentTypeStr, false, "", "");
modifiedInputStream = attachments.getSOAPPartInputStream();
- isReader = new InputStreamReader(modifiedInputStream);
+ isReader = new InputStreamReader(modifiedInputStream);
+
String soapEnvelopeNamespaceURI =
BuilderUtil.getEnvelopeNamespace(fullContentTypeStr);
@@ -173,23 +178,30 @@
modifiedInputStream = inputStream;
try {
isReader = new InputStreamReader(modifiedInputStream);
+ XMLStreamReader streamReader = null;
+
+ if(knownEncoding != null){
+ streamReader = StAXUtils.createXMLStreamReader(modifiedInputStream, knownEncoding);
+ }else{
+ streamReader = StAXUtils.createXMLStreamReader(modifiedInputStream);
+ }
if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(contentType)) {
- builder = new StAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(isReader),
+ builder = new StAXSOAPModelBuilder(streamReader,
new SOAP11Factory(),
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
} else if (HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML.equals(contentType)) {
- builder = new StAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(isReader),
+ builder = new StAXSOAPModelBuilder(streamReader,
new SOAP12Factory(),
SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
} else if (HTTPConstants.MEDIA_TYPE_MULTIPART_RELATED.equals(contentType)) {
- builder = new StAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(isReader),
+ builder = new StAXSOAPModelBuilder(streamReader,
new SOAP11Factory(),
null);
} else {
- builder = new StAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(isReader),
+ builder = new StAXSOAPModelBuilder(streamReader,
new SOAP11Factory(),
null);
}
@@ -204,7 +216,7 @@
envelope.element.build();
this.document = envelope.getOwnerDocument();
javax.xml.transform.Source xmlSource =
- new javax.xml.transform.stream.StreamSource(isReader);
+ new javax.xml.transform.stream.StreamSource( isReader);
this.source = xmlSource;
} catch (Exception e) {
throw new SOAPException(e);
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java Sun Jun 10 04:42:12 2007
@@ -333,9 +333,8 @@
private boolean isNetworkedResourceAvailable(String url) {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
- client.getHttpConnectionManager().getParams().setConnectionTimeout(3000);
- client.getHttpConnectionManager().getParams().setConnectionTimeout(3000);
- method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
+ client.getHttpConnectionManager().getParams().setConnectionTimeout(1000);
+ method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(1, false));
try {
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPConnectionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPConnectionTest.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPConnectionTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPConnectionTest.java Sun Jun 10 04:42:12 2007
@@ -15,13 +15,22 @@
*/
package org.apache.axis2.saaj;
-import junit.framework.TestCase;
+import java.io.IOException;
+import java.net.URL;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.params.HttpMethodParams;
/**
*
@@ -86,15 +95,46 @@
public void testGet() {
- try {
- SOAPConnectionFactory sf = new SOAPConnectionFactoryImpl();
- SOAPConnection con = sf.createConnection();
- //Create a valid non webservice endpoint for invoking HTTP-GET
- URL urlEndpoint = new URL("http", "java.sun.com", 80, "/index.html");
- //invoking HTTP-GET with a valid non webservice endpoint should throw a SOAPException
- SOAPMessage reply = con.get(urlEndpoint);
- } catch (Exception e) {
- assertTrue(e instanceof SOAPException);
- }
+ if(isNetworkedResourceAvailable("http://java.sun.com/index.html")){
+ try {
+ SOAPConnectionFactory sf = new SOAPConnectionFactoryImpl();
+ SOAPConnection con = sf.createConnection();
+ //Create a valid non webservice endpoint for invoking HTTP-GET
+ URL urlEndpoint = new URL("http", "java.sun.com", 80, "/index.html");
+ //invoking HTTP-GET with a valid non webservice endpoint should throw a SOAPException
+ SOAPMessage reply = con.get(urlEndpoint);
+ } catch (Exception e) {
+ assertTrue(e instanceof SOAPException);
+ }
+ }else{
+ //If resource is not available online, do a mock test
+ assertTrue(true);
+ }
}
+
+
+ private boolean isNetworkedResourceAvailable(String url) {
+ HttpClient client = new HttpClient();
+ GetMethod method = new GetMethod(url);
+ client.getHttpConnectionManager().getParams().setConnectionTimeout(1000);
+ method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
+ new DefaultHttpMethodRetryHandler(1, false));
+
+ try {
+ int statusCode = client.executeMethod(method);
+ if (statusCode != HttpStatus.SC_OK) {
+ return false;
+ }
+
+ } catch (HttpException e) {
+ e.printStackTrace();
+ return false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ } finally {
+ method.releaseConnection();
+ }
+ return true;
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPElementTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPElementTest.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPElementTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPElementTest.java Sun Jun 10 04:42:12 2007
@@ -95,8 +95,8 @@
assertSame(o, z1); // should be same SAAJ Node
assertSame(z1, z2); // should be same SAAJ Node
- assertEquals(((javax.xml.soap.Text)z1).getNodeValue(),
- ((javax.xml.soap.Text)z2).getNodeValue());
+ assertEquals(((javax.xml.soap.Text)z1).getValue(),
+ ((javax.xml.soap.Text)z2).getValue());
Node lastChildNode = (Node)soapEle.getLastChild();
SOAPElement lastChildSOAPEle = (SOAPElement)lastChildNode;
@@ -132,8 +132,8 @@
Object z2 = soapEle.getFirstChild();
assertSame(o, z1); // should be same SAAJ Node
assertSame(z1, z2); // should be same SAAJ Node
- assertEquals(((javax.xml.soap.Text)z1).getNodeValue(),
- ((javax.xml.soap.Text)z2).getNodeValue());
+ assertEquals(((javax.xml.soap.Text)z1).getValue(),
+ ((javax.xml.soap.Text)z2).getValue());
SOAPElement lastChildSOAPEle = (SOAPElement)soapEle.getLastChild();
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPMessageTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPMessageTest.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPMessageTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/SOAPMessageTest.java Sun Jun 10 04:42:12 2007
@@ -127,12 +127,10 @@
cnt++;
iterator.next();
}
- System.out.println("number of attachments: " + cnt);
assertEquals(cnt, 1);
iterator = msg.getAttachments();
AttachmentPart ap = (AttachmentPart)iterator.next();
String ctype = ap.getContentType();
- System.out.println(ctype);
assertTrue(ctype.equals("text/plain"));
} catch (Exception e) {
@@ -174,13 +172,6 @@
fail("got object: " + o +
", expected object: javax.xml.transform.stream.StreamSource");
}
-
- //if(is != null) {
- // StringBuffer sb2 = copyToBuffer(is);
- // String s1 = sb1.toString();
- // String s2 = sb2.toString();
- // assertTrue(s1.equals(s2));
- //}
}
catch (Exception e) {
fail("attachment has no content - unexpected");
@@ -455,8 +446,8 @@
SOAPMessage replymsg = con.call(msg, urlEndpoint);
// Check if reply message
- if (ValidateReplyMessage(replymsg, 1)) {
- //TestUtil.logMsg("Reply message is correct (PASSED)");
+ if (!validateReplyMessage(replymsg, 1)) {
+ //Reply message is correct
} else {
//TestUtil.logErr("Reply message is incorrect (FAILED)");
}
@@ -467,7 +458,7 @@
}
}
- private boolean ValidateReplyMessage(SOAPMessage msg, int num) {
+ private boolean validateReplyMessage(SOAPMessage msg, int num) {
try {
boolean pass = true;
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
@@ -498,12 +489,11 @@
}
if (!foundHeader1 || !foundHeader2 ||
!foundHeader3 || !foundHeader4) {
- //"Did not find expected soap headers in reply message"
+ //expected soap headers in reply message
pass = false;
} else {
- //"Did find expected soap headers in reply message");
+ //expected soap headers in reply message
}
- //TestUtil.logMsg("Verify soap body");
boolean foundBody1 = false;
boolean foundChild1 = false;
boolean foundChild2 = false;
@@ -528,21 +518,17 @@
}
}
if (!foundBody1) {
- //TestUtil.logErr("Did not find expected soap body in reply message");
+ //expected soap body in reply message
pass = false;
} else
- //TestUtil.logMsg("Did find expected soap body in reply message");
if (!foundChild1 || !foundChild2) {
- //TestUtil.logErr("Did not find expected soap body " +ild elements in reply message");
pass = false;
} else {
- //TestUtil.logMsg("Did find expected soap body child " +
+ //Did find expected soap body child
}
- //TestUtil.logMsg("Verify attachments");
int count = msg.countAttachments();
if (count == num) {
- //TestUtil.logMsg("Got expected " + count +" attachments in reply message");
-
+ //received expected number of attachments in reply message
i = msg.getAttachments();
boolean gifFound = false;
boolean xmlFound = false;
@@ -552,7 +538,6 @@
while (i.hasNext()) {
AttachmentPart a = (AttachmentPart)i.next();
String type = a.getContentType();
- //TestUtil.logMsg("MIME type of attachment = " + type);
if (type.equals("image/gif"))
gifFound = true;
else if (type.equals("text/xml"))
@@ -564,28 +549,21 @@
else if (type.equals("image/jpeg"))
jpegFound = true;
else {
- //TestUtil.logErr("Got unexpected MIME type: " + type);
+ //Got unexpected MIME type
pass = false;
}
}
- if (num == 1 && xmlFound) {
- //TestUtil.logMsg("Did find expected MIME types in reply message");
- } else if (num == 3 && xmlFound && jpegFound && textFound) {
- // TestUtil.logMsg("Did find expected MIME types in reply message");
- } else if (num > 0) {
- //TestUtil.logErr("Did not find expected MIME types in reply message");
+ if (num > 0) {
+ //Did not find expected MIME types in reply message
pass = false;
}
return pass;
} else {
- //TestUtil.logErr("Got unexpected " + count +" attachments in reply message, expected 5");
+ //Got unexpected number of attachments in reply message
return false;
}
} catch (Exception e) {
return false;
}
}
-
-
-}
-
+}
\ No newline at end of file
Modified: webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/saaj/test/org/apache/axis2/saaj/integration/IntegrationTest.java Sun Jun 10 04:42:12 2007
@@ -28,6 +28,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
@@ -43,6 +44,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
@@ -312,4 +314,33 @@
final SOAPElement ele2 = bodyElement2.addChildElement(ns4);
ele2.addTextNode("This is another text");
}
+
+
+ public void testSendReceive_ISO88591_EncodedSOAPMessage() {
+ try{
+ MimeHeaders mimeHeaders = new MimeHeaders();
+ mimeHeaders.addHeader("Content-Type", "text/xml; charset=iso-8859-1");
+
+ FileInputStream fileInputStream = new FileInputStream(System.getProperty("basedir", ".") +
+ "/test-resources" + File.separator + "soap-part-iso-8859-1.xml");
+ SOAPMessage requestMessage = MessageFactory.newInstance().createMessage(mimeHeaders,fileInputStream);
+
+
+ SOAPConnection sCon = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPMessage response = sCon.call(requestMessage, getAddress());
+ assertFalse(response.getAttachments().hasNext());
+ assertEquals(0, response.countAttachments());
+
+ printSOAPMessage(requestMessage);
+ String responseStr = printSOAPMessage(response);
+ assertTrue(responseStr.indexOf("This is some text.Here are some special chars : öÃî¤") != -1);
+ assertTrue(responseStr.indexOf("echo") != -1);
+ sCon.close();
+ } catch (SOAPException e) {
+ e.printStackTrace();
+ fail("Unexpected Exception while running test: " + e);
+ } catch (IOException e) {
+ fail("Unexpected Exception while running test: " + e);
+ }
+ }
}
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/databinding/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/databinding/build.xml?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/databinding/build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/databinding/build.xml Sun Jun 10 04:42:12 2007
@@ -1,170 +1,170 @@
-<project basedir="." default="generate.service">
-
- <property environment="env"/>
-
- <property name="wsdl.uri" value="StockQuoteService.wsdl"/>
- <property name="service.target" value="build/service"/>
- <property name="client.target" value="build/client"/>
-
- <path id="axis2.classpath">
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="lib">
- <include name="*.jar"/>
- </fileset>
- </path>
-
- <macrodef name="CastorSourceGenerator">
- <attribute name="schema" default="NOT SET"/>
- <attribute name="package" default="NOT SET"/>
- <attribute name="output" default="NOT SET"/>
- <sequential>
- <echo/>
- <java classname="org.exolab.castor.builder.SourceGeneratorMain" fork="true">
- <classpath refid="axis2.classpath"/>
- <arg line="-i @{schema} -package @{package} -dest @{output}" />
- </java>
- </sequential>
- </macrodef>
-
- <!-- Build the service, then the client. -->
- <target name="jar">
- <ant dir="service" target="jar.server"/>
- <ant dir="client"/>
- </target>
-
- <target name="run.client" depends="generate.stub">
-
- <condition property="params.ok">
- <and>
- <isset property="url"/>
- <isset property="symbol"/>
- </and>
- </condition>
-
- <fail message="One of the parameters are not set. Usage: StockClient -Durl=<url> -Dsymbol=<symbol>"
- unless="params.ok"/>
-
- <java classname="samples.databinding.StockClient" fork="true">
- <arg line="${url} ${symbol}"/>
- <classpath>
- <pathelement location="${client.target}/StockService-test-client.jar"/>
- <path refid="axis2.classpath"/>
- </classpath>
- </java>
- </target>
-
- <target name="generate.all" depends="generate.service,generate.stub"/>
-
- <target name="generate.service">
-
- <delete dir="${service.target}"/>
- <mkdir dir="${service.target}"/>
- <mkdir dir="${service.target}/classes"/>
-
- <CastorSourceGenerator output="${service.target}/src"
- package="samples.databinding.data"
- schema="StockQuote.xsd"/>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" classpathref="axis2.classpath">
- <arg line="-uri ${wsdl.uri}"/>
- <arg line="-ss"/>
- <arg line="-sd"/>
- <arg line="-p samples.databinding"/>
- <arg line="-d none"/>
- <arg line="-o ${service.target}"/>
- </java>
-
- <!--copy the already written skeleton class-->
- <copy todir="${service.target}/src/"
- overwrite="yes">
- <fileset dir="service/src">
- <include name="**/*.java"/>
- </fileset>
- </copy>
-
- <!--First let's compile the classes-->
- <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
- destdir="${service.target}/classes" srcdir="${service.target}/src"
- classpathref="axis2.classpath">
- </javac>
-
- <!--aar them up -->
- <copy toDir="${service.target}/classes/META-INF" failonerror="false">
- <fileset dir="${service.target}/resources">
- <include name="*.xml"/>
- <include name="*.wsdl"/>
- <include name="*.xsd"/>
- </fileset>
- </copy>
- <jar destfile="${service.target}/StockService.aar">
- <fileset excludes="**/Test.class" dir="${service.target}/classes"/>
- <fileset dir="${basedir}">
- <include name="lib/*.jar"/>
- </fileset>
- </jar>
-
- <copy file="${service.target}/StockService.aar" tofile="../../repository/services/StockService.aar"
- overwrite="true"/>
-
- </target>
-
- <target name="generate.stub" unless="skip.generate">
- <delete dir="${client.target}"/>
- <mkdir dir="${client.target}"/>
- <mkdir dir="${client.target}/classes"/>
-
-
- <CastorSourceGenerator output="${client.target}/src"
- package="samples.databinding.data"
- schema="StockQuote.xsd"/>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" classpathref="axis2.classpath">
- <arg line="-uri ${wsdl.uri}"/>
- <arg line="-u"/>
- <arg line="-p samples.databinding"/>
- <arg line="-d none"/>
- <arg line="-t"/>
- <arg line="-o ${client.target}"/>
- </java>
-
- <copy todir="${client.target}/src/"
- overwrite="yes">
- <fileset dir="client/src">
- <include name="**/*.java"/>
- </fileset>
- </copy>
-
- <!--now compile the stub classes-->
- <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
- srcdir="${client.target}/src"
- excludes="**/StockClient2*.*"
- destdir="${client.target}/classes"
- classpathref="axis2.classpath">
- </javac>
-
- <!--jar the compiled stuff-->
- <jar destfile="${client.target}/StockService-test-client.jar">
- <fileset dir="${client.target}/classes">
- <exclude name="**/META-INF/*.*"/>
- <exclude name="**/*MessageReceiver.class"/>
- <exclude name="**/*Skeleton.class"/>
- </fileset>
- </jar>
- </target>
-
- <!--We are not shipping castor and stax-utils jars with the release. This target can be used to
- download those jars that are required to run this sample.-->
- <target name="download.jars">
- <mkdir dir="lib"/>
-
- <get src="http://ws.zones.apache.org/repository/stax-utils/jars/stax-utils-20060915.jar"
- dest="lib/stax-utils-20060915.jar" verbose="true"/>
- <get src="http://dist.codehaus.org/castor/1.0.4/castor-1.0.4.jar" dest="lib/castor-1.0.4.jar"
- verbose="true"/>
- </target>
-
- <target name="clean">
- <delete dir="build"/>
- </target>
-
-</project>
+<project name="databinding" basedir="." default="generate.service">
+
+ <property environment="env"/>
+
+ <property name="wsdl.uri" value="StockQuoteService.wsdl"/>
+ <property name="service.target" value="build/service"/>
+ <property name="client.target" value="build/client"/>
+
+ <path id="axis2.classpath">
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ <fileset dir="lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <macrodef name="CastorSourceGenerator">
+ <attribute name="schema" default="NOT SET"/>
+ <attribute name="package" default="NOT SET"/>
+ <attribute name="output" default="NOT SET"/>
+ <sequential>
+ <echo/>
+ <java classname="org.exolab.castor.builder.SourceGeneratorMain" fork="true">
+ <classpath refid="axis2.classpath"/>
+ <arg line="-i @{schema} -package @{package} -dest @{output}" />
+ </java>
+ </sequential>
+ </macrodef>
+
+ <!-- Build the service, then the client. -->
+ <target name="jar">
+ <ant dir="service" target="jar.server"/>
+ <ant dir="client"/>
+ </target>
+
+ <target name="run.client" depends="generate.stub">
+
+ <condition property="params.ok">
+ <and>
+ <isset property="url"/>
+ <isset property="symbol"/>
+ </and>
+ </condition>
+
+ <fail message="One of the parameters are not set. Usage: StockClient -Durl=<url> -Dsymbol=<symbol>"
+ unless="params.ok"/>
+
+ <java classname="samples.databinding.StockClient" fork="true">
+ <arg line="${url} ${symbol}"/>
+ <classpath>
+ <pathelement location="${client.target}/StockService-test-client.jar"/>
+ <path refid="axis2.classpath"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="generate.all" depends="generate.service,generate.stub"/>
+
+ <target name="generate.service">
+
+ <delete dir="${service.target}"/>
+ <mkdir dir="${service.target}"/>
+ <mkdir dir="${service.target}/classes"/>
+
+ <CastorSourceGenerator output="${service.target}/src"
+ package="samples.databinding.data"
+ schema="StockQuote.xsd"/>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" classpathref="axis2.classpath">
+ <arg line="-uri ${wsdl.uri}"/>
+ <arg line="-ss"/>
+ <arg line="-sd"/>
+ <arg line="-p samples.databinding"/>
+ <arg line="-d none"/>
+ <arg line="-o ${service.target}"/>
+ </java>
+
+ <!--copy the already written skeleton class-->
+ <copy todir="${service.target}/src/"
+ overwrite="yes">
+ <fileset dir="service/src">
+ <include name="**/*.java"/>
+ </fileset>
+ </copy>
+
+ <!--First let's compile the classes-->
+ <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
+ destdir="${service.target}/classes" srcdir="${service.target}/src"
+ classpathref="axis2.classpath">
+ </javac>
+
+ <!--aar them up -->
+ <copy toDir="${service.target}/classes/META-INF" failonerror="false">
+ <fileset dir="${service.target}/resources">
+ <include name="*.xml"/>
+ <include name="*.wsdl"/>
+ <include name="*.xsd"/>
+ </fileset>
+ </copy>
+ <jar destfile="${service.target}/StockService.aar">
+ <fileset excludes="**/Test.class" dir="${service.target}/classes"/>
+ <fileset dir="${basedir}">
+ <include name="lib/*.jar"/>
+ </fileset>
+ </jar>
+
+ <copy file="${service.target}/StockService.aar" tofile="../../repository/services/StockService.aar"
+ overwrite="true"/>
+
+ </target>
+
+ <target name="generate.stub" unless="skip.generate">
+ <delete dir="${client.target}"/>
+ <mkdir dir="${client.target}"/>
+ <mkdir dir="${client.target}/classes"/>
+
+
+ <CastorSourceGenerator output="${client.target}/src"
+ package="samples.databinding.data"
+ schema="StockQuote.xsd"/>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true" classpathref="axis2.classpath">
+ <arg line="-uri ${wsdl.uri}"/>
+ <arg line="-u"/>
+ <arg line="-p samples.databinding"/>
+ <arg line="-d none"/>
+ <arg line="-t"/>
+ <arg line="-o ${client.target}"/>
+ </java>
+
+ <copy todir="${client.target}/src/"
+ overwrite="yes">
+ <fileset dir="client/src">
+ <include name="**/*.java"/>
+ </fileset>
+ </copy>
+
+ <!--now compile the stub classes-->
+ <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
+ srcdir="${client.target}/src"
+ excludes="**/StockClient2*.*"
+ destdir="${client.target}/classes"
+ classpathref="axis2.classpath">
+ </javac>
+
+ <!--jar the compiled stuff-->
+ <jar destfile="${client.target}/StockService-test-client.jar">
+ <fileset dir="${client.target}/classes">
+ <exclude name="**/META-INF/*.*"/>
+ <exclude name="**/*MessageReceiver.class"/>
+ <exclude name="**/*Skeleton.class"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <!--We are not shipping castor and stax-utils jars with the release. This target can be used to
+ download those jars that are required to run this sample.-->
+ <target name="download.jars">
+ <mkdir dir="lib"/>
+
+ <get src="http://ws.zones.apache.org/repository/stax-utils/jars/stax-utils-20060915.jar"
+ dest="lib/stax-utils-20060915.jar" verbose="true"/>
+ <get src="http://dist.codehaus.org/castor/1.0.4/castor-1.0.4.jar" dest="lib/castor-1.0.4.jar"
+ verbose="true"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="build"/>
+ </target>
+
+</project>
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/faulthandling/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/faulthandling/build.xml?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/faulthandling/build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/faulthandling/build.xml Sun Jun 10 04:42:12 2007
@@ -1,135 +1,135 @@
-<project basedir="." default="generate.service">
-
- <property environment="env"/>
-
- <property name="wsdl.uri" value="bank.wsdl"/>
- <property name="service.target" value="build/service"/>
- <property name="client.target" value="build/client"/>
-
- <!-- Build the service, then the client. -->
- <target name="jar">
- <ant dir="service" target="jar.server"/>
- <ant dir="client"/>
- </target>
-
- <target name="run.client" depends="gen.stub">
-
- <condition property="params.ok">
- <and>
- <isset property="url"/>
- <isset property="account"/>
- <isset property="amt"/>
- </and>
- </condition>
-
- <fail message="One of the parameters are not set. Usage: BankClient -Durl=<url> -Daccount=<account> -Damt=<amount>"
- unless="params.ok"/>
-
- <java classname="example.BankClient" fork="true">
- <arg line="${url} ${account} ${amt}"/>
- <classpath>
- <pathelement location="${client.target}/BankService-test-client.jar"/>
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </java>
- </target>
-
- <target name="generate.all" depends="generate.service,gen.stub"/>
-
- <target name="generate.service">
-
- <delete dir="${service.target}"/>
- <mkdir dir="${service.target}"/>
- <mkdir dir="${service.target}/classes"/>
-
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <arg line="-uri ${wsdl.uri}"/>
- <arg line="-ss"/>
- <arg line="-sd"/>
- <arg line="-o ${service.target}"/>
- <!-- Output directory in which to generate files --> <!-- NB it generates to the src folder under this directory!! -->
- <classpath>
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </java>
-
- <!--copy the already written skeleton class-->
- <copy file="service/src/example/BankServiceSkeleton.java"
- todir="${service.target}/src/example"
- overwrite="yes"/>
-
- <!--First let's compile the classes-->
- <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
- destdir="${service.target}/classes" srcdir="${service.target}/src">
- <classpath>
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </javac>
-
- <!--aar them up -->
- <copy toDir="${service.target}/classes/META-INF" failonerror="false">
- <fileset dir="${service.target}/resources">
- <include name="*.xml"/>
- <include name="*.wsdl"/>
- <include name="*.xsd"/>
- </fileset>
- </copy>
- <jar destfile="${service.target}/BankService.aar">
- <fileset excludes="**/Test.class" dir="${service.target}/classes"/>
- </jar>
-
- <copy file="${service.target}/BankService.aar" tofile="../../repository/services/sample-faulthandling.aar"
- overwrite="true"/>
-
- </target>
-
- <target name="gen.stub">
- <delete dir="${client.target}"/>
- <mkdir dir="${client.target}"/>
- <mkdir dir="${client.target}/classes"/>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <arg line="-uri ${wsdl.uri}"/>
- <arg line="-u"/>
- <arg line="-o ${client.target}"/>
- <classpath>
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </java>
-
- <copy file="client/src/example/BankClient.java" todir="${client.target}/src/example"/>
-
- <!--now compile the stub classes-->
- <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
- destdir="${client.target}/classes">
- <src path="${client.target}/src"/>
- <classpath>
- <fileset dir="../../lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </javac>
-
- <!--jar the compiled stuff-->
- <jar destfile="${client.target}/BankService-test-client.jar">
- <fileset dir="${client.target}/classes">
- <exclude name="**/META-INF/*.*"/>
- <exclude name="**/lib/*.*"/>
- <exclude name="**/*MessageReceiver.class"/>
- <exclude name="**/*Skeleton.class"/>
- </fileset>
- </jar>
- </target>
-
- <target name="clean">
- <delete dir="build"/>
- </target>
-
-</project>
+<project name="faulthandling" basedir="." default="generate.service">
+
+ <property environment="env"/>
+
+ <property name="wsdl.uri" value="bank.wsdl"/>
+ <property name="service.target" value="build/service"/>
+ <property name="client.target" value="build/client"/>
+
+ <!-- Build the service, then the client. -->
+ <target name="jar">
+ <ant dir="service" target="jar.server"/>
+ <ant dir="client"/>
+ </target>
+
+ <target name="run.client" depends="gen.stub">
+
+ <condition property="params.ok">
+ <and>
+ <isset property="url"/>
+ <isset property="account"/>
+ <isset property="amt"/>
+ </and>
+ </condition>
+
+ <fail message="One of the parameters are not set. Usage: BankClient -Durl=<url> -Daccount=<account> -Damt=<amount>"
+ unless="params.ok"/>
+
+ <java classname="example.BankClient" fork="true">
+ <arg line="${url} ${account} ${amt}"/>
+ <classpath>
+ <pathelement location="${client.target}/BankService-test-client.jar"/>
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="generate.all" depends="generate.service,gen.stub"/>
+
+ <target name="generate.service">
+
+ <delete dir="${service.target}"/>
+ <mkdir dir="${service.target}"/>
+ <mkdir dir="${service.target}/classes"/>
+
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <arg line="-uri ${wsdl.uri}"/>
+ <arg line="-ss"/>
+ <arg line="-sd"/>
+ <arg line="-o ${service.target}"/>
+ <!-- Output directory in which to generate files --> <!-- NB it generates to the src folder under this directory!! -->
+ <classpath>
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+
+ <!--copy the already written skeleton class-->
+ <copy file="service/src/example/BankServiceSkeleton.java"
+ todir="${service.target}/src/example"
+ overwrite="yes"/>
+
+ <!--First let's compile the classes-->
+ <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
+ destdir="${service.target}/classes" srcdir="${service.target}/src">
+ <classpath>
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </javac>
+
+ <!--aar them up -->
+ <copy toDir="${service.target}/classes/META-INF" failonerror="false">
+ <fileset dir="${service.target}/resources">
+ <include name="*.xml"/>
+ <include name="*.wsdl"/>
+ <include name="*.xsd"/>
+ </fileset>
+ </copy>
+ <jar destfile="${service.target}/BankService.aar">
+ <fileset excludes="**/Test.class" dir="${service.target}/classes"/>
+ </jar>
+
+ <copy file="${service.target}/BankService.aar" tofile="../../repository/services/sample-faulthandling.aar"
+ overwrite="true"/>
+
+ </target>
+
+ <target name="gen.stub">
+ <delete dir="${client.target}"/>
+ <mkdir dir="${client.target}"/>
+ <mkdir dir="${client.target}/classes"/>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <arg line="-uri ${wsdl.uri}"/>
+ <arg line="-u"/>
+ <arg line="-o ${client.target}"/>
+ <classpath>
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+
+ <copy file="client/src/example/BankClient.java" todir="${client.target}/src/example"/>
+
+ <!--now compile the stub classes-->
+ <javac debug="on" memoryMaximumSize="256m" memoryInitialSize="256m" fork="true"
+ destdir="${client.target}/classes">
+ <src path="${client.target}/src"/>
+ <classpath>
+ <fileset dir="../../lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </javac>
+
+ <!--jar the compiled stuff-->
+ <jar destfile="${client.target}/BankService-test-client.jar">
+ <fileset dir="${client.target}/classes">
+ <exclude name="**/META-INF/*.*"/>
+ <exclude name="**/lib/*.*"/>
+ <exclude name="**/*MessageReceiver.class"/>
+ <exclude name="**/*Skeleton.class"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="clean">
+ <delete dir="build"/>
+ </target>
+
+</project>
Modified: webservices/axis2/branches/java/jaxws21/modules/samples/googlespellcheck/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/samples/googlespellcheck/build.xml?view=diff&rev=545866&r1=545865&r2=545866
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/samples/googlespellcheck/build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/samples/googlespellcheck/build.xml Sun Jun 10 04:42:12 2007
@@ -1,95 +1,94 @@
-
-<project basedir="." default="run.client">
-
- <property name="wsdl" value="http://tools.wso2.net:12001/axis2/services/SimplifiedSpellCheck?wsdl" />
-
- <property name="dest.dir" value="build" />
-
- <property name="dest.dir.classes" value="${dest.dir}/classes" />
-
- <property name="dest.dir.lib" value="${dest.dir}/lib" />
-
- <property name="axis2.home" value="../../" />
-
- <path id="client.class.path">
- <fileset dir="${axis2.home}/lib">
- <include name="*.jar" />
- </fileset>
- <fileset dir="${dest.dir.lib}" includes="*.jar" />
- </path>
-
- <path id="build.class.path">
- <fileset dir="${axis2.home}/lib">
- <include name="*.jar" />
- </fileset>
- </path>
-
- <target name="clean">
-
- <delete dir="${dest.dir}" />
-
- <delete dir="src" includes="sample/spellcheck/stub/**"/>
-
- </target>
-
- <target name="prepare">
-
- <mkdir dir="${dest.dir}" />
-
- <mkdir dir="${dest.dir.classes}" />
-
- <mkdir dir="${dest.dir.lib}" />
-
- </target>
-
- <target name="run.client" depends="clean,prepare">
-
- <antcall target="client.codegen-stub">
- <param name="wsdl" value="${wsdl}"/>
- </antcall>
-
- <antcall target="client.compile" />
-
- <antcall target="client.jar" />
-
- <antcall target="client.run" />
- </target>
-
- <target name="client.codegen-stub">
-
- <java classname="org.apache.axis2.wsdl.WSDL2Java">
- <arg value="-uri" />
- <arg value="${wsdl}" />
- <arg value="-p" />
- <arg value="sample.spellcheck.stub" />
- <arg value="-o" />
- <arg value="src" />
- <arg value="-f"/>
- <classpath refid="build.class.path" />
- </java>
-
- </target>
-
- <target name="client.compile">
-
- <javac srcdir="src" destdir="${dest.dir.classes}">
- <classpath refid="build.class.path" />
- </javac>
-
- </target>
-
- <target name="client.jar">
-
- <jar basedir="${dest.dir.classes}" destfile="${dest.dir.lib}/editor.jar" />
-
- </target>
-
- <target name="client.run">
-
- <java classname="sample.spellcheck.editor.SuggestionForm" fork="true">
- <classpath refid="client.class.path" />
- </java>
-
- </target>
-
+<project name="googlespellcheck" basedir="." default="run.client">
+
+ <property name="wsdl" value="http://tools.wso2.net:12001/axis2/services/SimplifiedSpellCheck?wsdl" />
+
+ <property name="dest.dir" value="build" />
+
+ <property name="dest.dir.classes" value="${dest.dir}/classes" />
+
+ <property name="dest.dir.lib" value="${dest.dir}/lib" />
+
+ <property name="axis2.home" value="../../" />
+
+ <path id="client.class.path">
+ <fileset dir="${axis2.home}/lib">
+ <include name="*.jar" />
+ </fileset>
+ <fileset dir="${dest.dir.lib}" includes="*.jar" />
+ </path>
+
+ <path id="build.class.path">
+ <fileset dir="${axis2.home}/lib">
+ <include name="*.jar" />
+ </fileset>
+ </path>
+
+ <target name="clean">
+
+ <delete dir="${dest.dir}" />
+
+ <delete dir="src" includes="sample/spellcheck/stub/**"/>
+
+ </target>
+
+ <target name="prepare">
+
+ <mkdir dir="${dest.dir}" />
+
+ <mkdir dir="${dest.dir.classes}" />
+
+ <mkdir dir="${dest.dir.lib}" />
+
+ </target>
+
+ <target name="run.client" depends="clean,prepare">
+
+ <antcall target="client.codegen-stub">
+ <param name="wsdl" value="${wsdl}"/>
+ </antcall>
+
+ <antcall target="client.compile" />
+
+ <antcall target="client.jar" />
+
+ <antcall target="client.run" />
+ </target>
+
+ <target name="client.codegen-stub">
+
+ <java classname="org.apache.axis2.wsdl.WSDL2Java">
+ <arg value="-uri" />
+ <arg value="${wsdl}" />
+ <arg value="-p" />
+ <arg value="sample.spellcheck.stub" />
+ <arg value="-o" />
+ <arg value="src" />
+ <arg value="-f"/>
+ <classpath refid="build.class.path" />
+ </java>
+
+ </target>
+
+ <target name="client.compile">
+
+ <javac srcdir="src" destdir="${dest.dir.classes}">
+ <classpath refid="build.class.path" />
+ </javac>
+
+ </target>
+
+ <target name="client.jar">
+
+ <jar basedir="${dest.dir.classes}" destfile="${dest.dir.lib}/editor.jar" />
+
+ </target>
+
+ <target name="client.run">
+
+ <java classname="sample.spellcheck.editor.SuggestionForm" fork="true">
+ <classpath refid="client.class.path" />
+ </java>
+
+ </target>
+
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org