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 sc...@apache.org on 2006/09/21 20:48:39 UTC
svn commit: r448629 - in
/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws:
ClientConfigurationFactory.java client/proxy/DocLitProxyHandler.java
description/ServiceDescription.java
message/databinding/impl/SourceBlockImpl.java
Author: scheu
Date: Thu Sep 21 11:48:39 2006
New Revision: 448629
URL: http://svn.apache.org/viewvc?view=rev&rev=448629
Log:
Patches for AXIS2-1149 AXIS2-1196 AXIS2-1204 AXIS2-1184
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/DocLitProxyHandler.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescription.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java?view=diff&rev=448629&r1=448628&r2=448629
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/ClientConfigurationFactory.java Thu Sep 21 11:48:39 2006
@@ -29,18 +29,16 @@
*/
public class ClientConfigurationFactory {
- private static ClientConfigurationFactory instance = new ClientConfigurationFactory();
-
private ConfigurationContext configContext = null;
protected ClientConfigurationFactory(){
}
/**
- * Returns the singleton ClientConfigurationFactory object.
+ * Returns a ClientConfigurationFactory object.
*/
public static ClientConfigurationFactory newInstance() {
- return instance;
+ return new ClientConfigurationFactory();
}
/**
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/DocLitProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/DocLitProxyHandler.java?view=diff&rev=448629&r1=448628&r2=448629
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/DocLitProxyHandler.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/DocLitProxyHandler.java Thu Sep 21 11:48:39 2006
@@ -320,6 +320,7 @@
public ArrayList<String> getParamNames(Object[] objects){
ArrayList<String> names = proxyDescriptor.getParamNames();
//TODO Should this logic be moved to Operation Description.
+ argList = null;
ArrayList<Object> paramValues = createArgList(names, objects);
if(names.size() == paramValues.size()){
return names;
@@ -373,9 +374,9 @@
}
return values;
}
-
+ //TODO Implement createNameValuePair method so we can remove getParamName and getParamObject and only call this method once.
private ArrayList<Object> createArgList(ArrayList<String> names, Object[] objects){
- if(this.argList !=null){
+ if(argList !=null){
return argList;
}
argList = new ArrayList<Object>();
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescription.java?view=diff&rev=448629&r1=448628&r2=448629
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescription.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescription.java Thu Sep 21 11:48:39 2006
@@ -34,11 +34,13 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.deployment.DeploymentException;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.OutInAxisOperation;
import org.apache.axis2.description.OutOnlyAxisOperation;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.RobustOutOnlyAxisOperation;
+import org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder;
import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
import org.apache.axis2.engine.AbstractDispatcher;
import org.apache.axis2.jaxws.ClientConfigurationFactory;
@@ -97,6 +99,7 @@
*/
public class ServiceDescription {
private AxisService axisService;
+ private ClientConfigurationFactory clientConfigFactory;
private ConfigurationContext configContext;
private URL wsdlURL;
@@ -156,6 +159,20 @@
addAnonymousAxisOperations();
// This will set the serviceClient field after adding the AxisService to the AxisConfig
getServiceClient();
+ // Give the configuration builder a chance to finalize configuration for this service
+ try {
+ getClientConfigurationFactory().completeAxis2Configuration(axisService);
+ } catch (DeploymentException e) {
+ // TODO RAS
+ // TODO NLS
+ e.printStackTrace();
+ throw ExceptionFactory.makeWebServiceException("ServiceDescription caught " + e);
+ } catch (Exception e) {
+ // TODO RAS
+ // TODO NLS
+ e.printStackTrace();
+ throw ExceptionFactory.makeWebServiceException("ServiceDescription caught " + e);
+ }
}
/**
@@ -284,6 +301,22 @@
else {
buildAxisServiceFromNoWSDL();
}
+
+ if (axisService == null)
+ // TODO: RAS & NLS
+ throw ExceptionFactory.makeWebServiceException("Unable to create AxisService for " + serviceQName);
+
+ // Save the Service QName as a parameter.
+ Parameter serviceNameParameter = new Parameter();
+ serviceNameParameter.setName(WSDL11ToAllAxisServicesBuilder.WSDL_SERVICE_QNAME);
+ serviceNameParameter.setValue(serviceQName);
+ try {
+ axisService.addParameter(serviceNameParameter);
+ }
+ catch (AxisFault e) {
+ // TODO RAS
+ e.printStackTrace();
+ }
}
private void buildAxisServiceFromWSDL() {
@@ -389,10 +422,17 @@
public ConfigurationContext getAxisConfigContext() {
if (configContext == null) {
- ClientConfigurationFactory factory = ClientConfigurationFactory.newInstance();
+ ClientConfigurationFactory factory = getClientConfigurationFactory();
configContext = factory.getClientConfigurationContext();
}
return configContext;
+ }
+
+ private ClientConfigurationFactory getClientConfigurationFactory() {
+ if (clientConfigFactory == null) {
+ clientConfigFactory = ClientConfigurationFactory.newInstance();
+ }
+ return clientConfigFactory;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java?view=diff&rev=448629&r1=448628&r2=448629
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java Thu Sep 21 11:48:39 2006
@@ -25,7 +25,9 @@
import org.apache.axis2.jaxws.message.impl.BlockImpl;
import org.apache.axis2.jaxws.message.util.DOMReader;
import org.apache.axis2.jaxws.message.util.Reader2Writer;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import javax.xml.bind.util.JAXBSource;
import javax.xml.namespace.QName;
@@ -140,14 +142,24 @@
// TODO not sure if this is always the most performant way to do this.
if (busObj instanceof DOMSource) {
// Let's use our own DOMReader for now...
- Element element = (Element) ((DOMSource)busObj).getNode();
+ Element element = null;
+
+ //TODO busObj can be any of the subclasses of Node -- Document, Elemeent, Entity, Text, ETC.
+ //May need to add code to check for other supported Node type other than Document and Element.
+ Node node = ((DOMSource)busObj).getNode();
+ if(node instanceof Document){
+ element = ((Document)node).getDocumentElement();
+ }else{
+ element = (Element) ((DOMSource)busObj).getNode();
+ }
// We had some problems with testers producing DOMSources w/o Namespaces.
// It's easy to catch this here.
if (element.getLocalName() == null) {
throw new XMLStreamException(ExceptionFactory.makeMessageException(Messages.getMessage("JAXBSourceNamespaceErr")));
}
- return new DOMReader((Element) ((DOMSource)busObj).getNode());
+
+ return new DOMReader(element);
}
if(busObj instanceof StreamSource){
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org