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 ng...@apache.org on 2006/10/03 05:17:17 UTC

svn commit: r452303 - in /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws: AxisController.java Dispatch.java client/BaseDispatch.java core/controller/AxisInvocationController.java util/Constants.java

Author: ngallardo
Date: Mon Oct  2 20:17:16 2006
New Revision: 452303

URL: http://svn.apache.org/viewvc?view=rev&rev=452303
Log:
Cleaning up bad properties.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/AxisController.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Dispatch.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/AxisController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/AxisController.java?view=diff&rev=452303&r1=452302&r2=452303
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/AxisController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/AxisController.java Mon Oct  2 20:17:16 2006
@@ -1,385 +1,375 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.axis2.jaxws;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.jaxws.handler.PortData;
-import org.apache.axis2.jaxws.i18n.Messages;
-import org.apache.axis2.jaxws.impl.AsyncListenerWrapper;
-import org.apache.axis2.jaxws.impl.AsyncListener;
-import org.apache.axis2.jaxws.param.JAXBParameter;
-import org.apache.axis2.jaxws.param.Parameter;
-import org.apache.axis2.jaxws.param.ParameterFactory;
-import org.apache.axis2.jaxws.param.ParameterUtils;
-import org.apache.axis2.jaxws.util.Constants;
-import org.apache.axis2.jaxws.util.WSDLWrapper;
-
-
-public class AxisController {
-    private AxisService axisService = null;
-//  TODO: This configContext will come from websphere deployment code later
-    private ConfigurationContext configContext = null; 
-    private ServiceClient serviceClient = null;
-    private ServiceContext serviceContext = null;
-    private JAXWSClientContext clientContext = null;
-    private ServiceGroupContext groupContext = null;
-    private EndpointReference myEPR;
-    
-    public AxisService getAxisService() {
-        return axisService;
-    }
-    public void setAxisService(AxisService axisService) {
-        this.axisService = axisService;
-    }
-    public ConfigurationContext getConfigContext() {
-        return configContext;
-    }
-    public void setConfigContext(ConfigurationContext configContext) {
-        this.configContext = configContext;
-    }
-    public ServiceClient getServiceClient() {
-        return serviceClient;
-    }
-    public void setServiceClient(ServiceClient serviceClient) {
-        this.serviceClient = serviceClient;
-    }
-    public ServiceContext getServiceContext() {
-        return serviceContext;
-    }
-    public void setServiceContext(ServiceContext serviceContext) {
-        this.serviceContext = serviceContext;
-    }
-    public JAXWSClientContext getClientContext() {
-        return clientContext;
-    }
-    public void setClientContext(JAXWSClientContext clientContext) {
-        this.clientContext = clientContext;
-    }
-    public ServiceGroupContext getGroupContext() {
-        return groupContext;
-    }
-    public void setGroupContext(ServiceGroupContext groupContext) {
-        this.groupContext = groupContext;
-    }
-    public PortData getPortInfo(){
-        return clientContext.getPort();
-    }
-    public QName getServiceName(){
-        return getPortInfo().getServiceName();
-    }
-    public QName getPortName(){
-        return getPortInfo().getPortName();
-    }
-    public String getEndpointAddress(){
-        return getPortInfo().getEndpointAddress();
-    }
-    public String getBindingId(){
-        return getPortInfo().getBindingID();
-    }
-    public WSDLWrapper getWSDLContext(){
-        return clientContext.getWsdlContext();
-    }
-    public ExecutorService getExecutor() {
-        return clientContext.getExecutor();
-    }
-    public Mode getServiceMode() {
-        return (Mode) clientContext.getServiceMode();
-    }
-    public URL getWSDLLocation(){
-        return clientContext.getWSDLLocation(); 
-    }
-
-    public Object invoke(Parameter param, Map requestContext) throws WebServiceException {
-        setupProperties(requestContext);
-        
-        try{
-            //TODO: This is not the correct way to setup the JAXBContext
-            if (clientContext.getJAXBContext() != null) {
-                JAXBParameter p = (JAXBParameter) param;
-                p.setJAXBContext(clientContext.getJAXBContext());
-            }
-            
-            serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(getEndpointURL(requestContext)));
-            String soapAction = getSOAPAction(requestContext);
-            if (soapAction != null) {
-                serviceClient.getOptions().setAction(soapAction);    
-            }
-            else {
-                //TODO: This should be an addressing exception on the client side
-                serviceClient.getOptions().setAction("none");
-            }
-            
-            //Create the Parameter wrapper for the response based on what the input 
-            //type was.  If it was a JAXBParameter, then set the JAXBContext on it as well
-            Parameter response = ParameterFactory.createParameter(param.getValue().getClass());
-            if (param instanceof JAXBParameter) {
-                JAXBParameter p = (JAXBParameter) response;
-                p.setJAXBContext(clientContext.getJAXBContext());
-            }
-            OMElement axisResponse = null;
-            
-            //TODO: Team needs to decide if we are going to use ServiceClient api or go to AxisEngine api directly. ServiceClient requires that we send a OMElement
-            //and it creates a SOAPEnvelop by reading the headers that dispatch sets in ServiceClient. This is not a good way for message modeas we will be 
-            //manuplating client message first to read all the headers and then read the body. we add the headers in ServiceClient then create OMElement from body
-            //and send then OMElement in SendReceive operation, which then is converted again to an envelope and header headers are added to it by ServiceClient 
-            //before sending it to axis enging. 
-            axisResponse = serviceClient.sendReceive(ServiceClient.ANON_OUT_IN_OP, toOM(param));
-
-            //TODO: If ServiceClient can return the actual sopaEnvelope from MessageContext we can use the message mode and param this way.
-            //response.fromEnvelope(mode, axisResponse);
-            //return response.getValue();
-            return buildResponse(axisResponse, response).getValue();
-        }catch(AxisFault e){
-        	// TODO Add Fault Processing
-        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
-            
-        }       
-    }
-    
-    public void invokeOneWay(Parameter param, Map requestContext) throws WebServiceException{
-        setupProperties(requestContext);
-        
-        try{
-            //TODO: This is not the correct way to setup the JAXBContext
-            if (clientContext.getJAXBContext() != null) {
-                JAXBParameter p = (JAXBParameter) param;
-                p.setJAXBContext(clientContext.getJAXBContext());
-            }
-            
-            serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(getEndpointURL(requestContext)));
-            String soapAction = getSOAPAction(requestContext);
-            if (soapAction != null) {
-                serviceClient.getOptions().setAction(soapAction);    
-            }
-            else {
-                serviceClient.getOptions().setAction("none");
-            }
-            
-            serviceClient.fireAndForget(ServiceClient.ANON_OUT_ONLY_OP, toOM(param));
-        } catch(AxisFault e) {
-        	// TODO Add Fault Processing
-        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
-
-        }
-    }
-    
-    public Future<?> invokeAsync(Parameter param, AsyncHandler asynchandler, Map requestContext) throws WebServiceException{
-        setupProperties(requestContext);
-        
-        try{
-            //TODO: This is not the correct way to setup the JAXBContext
-            if (clientContext.getJAXBContext() != null) {
-                JAXBParameter p = (JAXBParameter) param;
-                p.setJAXBContext(clientContext.getJAXBContext());
-            }
-            
-            serviceClient.getOptions().setTo(new EndpointReference(getEndpointURL(requestContext)));
-            serviceClient.getOptions().setReplyTo(getMyEPR());
-            
-            //TODO: This is a hack.  Need a better way to determine the default wsa:Action if
-            //a SOAPAction header does not exist.
-            String soapAction = getSOAPAction(requestContext);
-            if (soapAction != null) {
-                serviceClient.getOptions().setAction(soapAction);    
-            }
-            else {
-                serviceClient.getOptions().setAction("none");
-            }
-            
-            AxisCallback callback = new AxisCallback();
-            Boolean useAsyncMep = (Boolean) requestContext.get(Constants.USE_ASYNC_MEP);
-
-            if((useAsyncMep != null && useAsyncMep.booleanValue()) 
-                    || serviceClient.getOptions().isUseSeparateListener()) {
-                serviceClient.getOptions().setUseSeparateListener(true);
-                serviceClient.getOptions().setTransportInProtocol("http");
-            }
-
-            serviceClient.sendReceiveNonBlocking(ServiceClient.ANON_OUT_IN_OP, 
-                    toOM(param), callback);
-            
-            //Create the Parameter wrapper for the response based on what the input 
-            //type was.  If it was a JAXBParameter, then set the JAXBContext on it as well
-            Parameter responseParam = ParameterFactory.createParameter(param.getValue().getClass());
-            if (param instanceof JAXBParameter) {
-                JAXBParameter p = (JAXBParameter) responseParam;
-                p.setJAXBContext(clientContext.getJAXBContext());
-            }
-            
-            AsyncListener asyncProcessor = new AsyncListener(callback);
-            asyncProcessor.setMode((Mode) clientContext.getServiceMode());
-            //asyncProcessor.setParameter(responseParam);
-            
-            AsyncListenerWrapper<?> response = new AsyncListenerWrapper<Object>(asyncProcessor);
-            if(asynchandler !=null){
-                response.setAsyncHandler(asynchandler);
-            }
-            
-            try {
-                getExecutor().submit(response).get();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-                throw ExceptionFactory.makeWebServiceException(e);
-            } catch (ExecutionException e) {
-                e.printStackTrace();
-                throw ExceptionFactory.makeWebServiceException(e);
-            }
-            
-            //TODO: Need to figure out who/when the Listener should be shutdown
-            //Do we do it after this request?  Or, can we ask the listener to check
-            //itself to see if any other responses are outstanding.
-            return response;
-        }catch(AxisFault e){
-        	// TODO Add Fault Processing
-        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
-        }
-    }
-    
-    public Response invokeAsync(Parameter param, Map requestContext)throws WebServiceException{
-    	AsyncListenerWrapper<Object>  response= (AsyncListenerWrapper<Object>)invokeAsync(param, null, requestContext);
-        return response;
-    }
-    
-    private String getEndpointURL(Map requestContext){
-        return (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
-    }
-    
-    private String getSOAPAction(Map requestContext){
-        Boolean useSoapAction = (Boolean)requestContext.get(BindingProvider.SOAPACTION_USE_PROPERTY);
-        if(useSoapAction!=null && useSoapAction.booleanValue()){
-            return (String)requestContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
-        }
-        return null;
-    }
-    
-    private OMElement toOM(Parameter param){
-        /*TODO: This is a a hack.... I am getting the Header of the message and setting serviceClent header, then 
-        * extract body of message as OM and ServiceCleint will create the envelope. 
-        * I am doing this because ServiceClient wants to form the envelope and send it to AxisEngine.
-        * I would like to return param.toEnvelope() but ServiceClient will try to build envelope on top of envelope.
-        * Let just go directly to AxisEngine forget about ServiceClient... can I?
-        */
-        SOAPEnvelope env = ParameterUtils.toEnvelope((Mode) clientContext.getServiceMode(), 
-                serviceClient.getOptions().getSoapVersionURI(),
-                param);
-        SOAPBody body= env.getBody();
-        SOAPHeader soapHeader = env.getHeader();
-        addHeadersToServiceClient(soapHeader);
-        return body.getFirstElement();
-    }
-    
-    private void addHeadersToServiceClient(SOAPHeader soapHeader){
-        if(soapHeader!=null){
-            for(Iterator headers = soapHeader.getChildElements(); headers.hasNext();){
-                OMElement header = (OMElement)headers.next();
-                serviceClient.addHeader(header);
-            }
-        }
-    }
-    
-    private Parameter buildResponse(OMElement element, Parameter xmlResponse){
-        //Create empty SoapResponse first 
-        Parameter soapResponse = xmlResponse;
-        
-        /* get xmlResponse param from ServiceClient OM response, By the way ServiceClient always retuns an 
-         * OMElement xml string not Soap Env or Body.
-         * It does something like msgCtx.getEnvelope().getBody.getChild() --> i.e OMElement under the body.
-         * So we now have to go thru the pain of recreating the envelope. This is a performance issue...
-        */
-        xmlResponse.fromOM(element);
-        /*I will convert param toEnvelope since ServiceClient always send xml string.
-         * toEnvelope() in Parameter is coded just to handle this.
-         */
-        SOAPEnvelope env =xmlResponse.toEnvelope(null,serviceClient.getOptions().getSoapVersionURI());
-        
-        //TODO:(NLG) Need to figure out why we have to cast to (Mode) here. 
-        soapResponse.fromEnvelope((Mode) clientContext.getServiceMode(), env);
-        
-        return soapResponse;
-    }
-
-    /*
-     * Returns the EPR that should be used for in-bound async responses
-     */
-    private EndpointReference getMyEPR() {
-        if (myEPR != null) {        
-            return myEPR;
-        }
-        else {
-            try {
-                //TODO:(NLG) This should not be hard coded to HTTP and should allow
-                //for other transports to be used.
-                myEPR = serviceClient.getMyEPR("http");
-            } catch (AxisFault e) {
-                e.printStackTrace();
-            }
-            return myEPR;
-        }
-    }
-    
-    
-    /*
-     * TODO: This is a first pass at filtering the properties that are set on the 
-     * RequestContext.  Right now it's called during the invoke, but needs to be 
-     * moved over to when the property is set.  This should not be in the path
-     * of performance.
-     */
-    private void setupProperties(Map<String, Object> requestCtx) {
-        for (Iterator<String> it = requestCtx.keySet().iterator(); it.hasNext(); ) {
-            String key = it.next();
-            Object value = requestCtx.get(key);
-            
-            if (key.equals(Constants.QOS_WSRM_ENABLE)) {
-                key = "Sandesha2AppProcessingDone";
-                value = !(Boolean) value;
-                value = value.toString();
-            }
-            else if (key.equals(Constants.QOS_WSADDRESSING_ENABLE)) {
-                key = AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES;
-                value = !(Boolean) value;
-            }
-            
-            serviceClient.getOptions().setProperty(key, value);
-        }
-    }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.axis2.jaxws;
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.Service.Mode;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.jaxws.handler.PortData;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.impl.AsyncListenerWrapper;
+import org.apache.axis2.jaxws.impl.AsyncListener;
+import org.apache.axis2.jaxws.param.JAXBParameter;
+import org.apache.axis2.jaxws.param.Parameter;
+import org.apache.axis2.jaxws.param.ParameterFactory;
+import org.apache.axis2.jaxws.param.ParameterUtils;
+import org.apache.axis2.jaxws.util.Constants;
+import org.apache.axis2.jaxws.util.WSDLWrapper;
+
+
+public class AxisController {
+    private AxisService axisService = null;
+//  TODO: This configContext will come from websphere deployment code later
+    private ConfigurationContext configContext = null; 
+    private ServiceClient serviceClient = null;
+    private ServiceContext serviceContext = null;
+    private JAXWSClientContext clientContext = null;
+    private ServiceGroupContext groupContext = null;
+    private EndpointReference myEPR;
+    
+    public AxisService getAxisService() {
+        return axisService;
+    }
+    public void setAxisService(AxisService axisService) {
+        this.axisService = axisService;
+    }
+    public ConfigurationContext getConfigContext() {
+        return configContext;
+    }
+    public void setConfigContext(ConfigurationContext configContext) {
+        this.configContext = configContext;
+    }
+    public ServiceClient getServiceClient() {
+        return serviceClient;
+    }
+    public void setServiceClient(ServiceClient serviceClient) {
+        this.serviceClient = serviceClient;
+    }
+    public ServiceContext getServiceContext() {
+        return serviceContext;
+    }
+    public void setServiceContext(ServiceContext serviceContext) {
+        this.serviceContext = serviceContext;
+    }
+    public JAXWSClientContext getClientContext() {
+        return clientContext;
+    }
+    public void setClientContext(JAXWSClientContext clientContext) {
+        this.clientContext = clientContext;
+    }
+    public ServiceGroupContext getGroupContext() {
+        return groupContext;
+    }
+    public void setGroupContext(ServiceGroupContext groupContext) {
+        this.groupContext = groupContext;
+    }
+    public PortData getPortInfo(){
+        return clientContext.getPort();
+    }
+    public QName getServiceName(){
+        return getPortInfo().getServiceName();
+    }
+    public QName getPortName(){
+        return getPortInfo().getPortName();
+    }
+    public String getEndpointAddress(){
+        return getPortInfo().getEndpointAddress();
+    }
+    public String getBindingId(){
+        return getPortInfo().getBindingID();
+    }
+    public WSDLWrapper getWSDLContext(){
+        return clientContext.getWsdlContext();
+    }
+    public ExecutorService getExecutor() {
+        return clientContext.getExecutor();
+    }
+    public Mode getServiceMode() {
+        return (Mode) clientContext.getServiceMode();
+    }
+    public URL getWSDLLocation(){
+        return clientContext.getWSDLLocation(); 
+    }
+
+    public Object invoke(Parameter param, Map requestContext) throws WebServiceException {
+        setupProperties(requestContext);
+        
+        try{
+            //TODO: This is not the correct way to setup the JAXBContext
+            if (clientContext.getJAXBContext() != null) {
+                JAXBParameter p = (JAXBParameter) param;
+                p.setJAXBContext(clientContext.getJAXBContext());
+            }
+            
+            serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(getEndpointURL(requestContext)));
+            String soapAction = getSOAPAction(requestContext);
+            if (soapAction != null) {
+                serviceClient.getOptions().setAction(soapAction);    
+            }
+            else {
+                //TODO: This should be an addressing exception on the client side
+                serviceClient.getOptions().setAction("none");
+            }
+            
+            //Create the Parameter wrapper for the response based on what the input 
+            //type was.  If it was a JAXBParameter, then set the JAXBContext on it as well
+            Parameter response = ParameterFactory.createParameter(param.getValue().getClass());
+            if (param instanceof JAXBParameter) {
+                JAXBParameter p = (JAXBParameter) response;
+                p.setJAXBContext(clientContext.getJAXBContext());
+            }
+            OMElement axisResponse = null;
+            
+            //TODO: Team needs to decide if we are going to use ServiceClient api or go to AxisEngine api directly. ServiceClient requires that we send a OMElement
+            //and it creates a SOAPEnvelop by reading the headers that dispatch sets in ServiceClient. This is not a good way for message modeas we will be 
+            //manuplating client message first to read all the headers and then read the body. we add the headers in ServiceClient then create OMElement from body
+            //and send then OMElement in SendReceive operation, which then is converted again to an envelope and header headers are added to it by ServiceClient 
+            //before sending it to axis enging. 
+            axisResponse = serviceClient.sendReceive(ServiceClient.ANON_OUT_IN_OP, toOM(param));
+
+            //TODO: If ServiceClient can return the actual sopaEnvelope from MessageContext we can use the message mode and param this way.
+            //response.fromEnvelope(mode, axisResponse);
+            //return response.getValue();
+            return buildResponse(axisResponse, response).getValue();
+        }catch(AxisFault e){
+        	// TODO Add Fault Processing
+        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
+            
+        }       
+    }
+    
+    public void invokeOneWay(Parameter param, Map requestContext) throws WebServiceException{
+        setupProperties(requestContext);
+        
+        try{
+            //TODO: This is not the correct way to setup the JAXBContext
+            if (clientContext.getJAXBContext() != null) {
+                JAXBParameter p = (JAXBParameter) param;
+                p.setJAXBContext(clientContext.getJAXBContext());
+            }
+            
+            serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(getEndpointURL(requestContext)));
+            String soapAction = getSOAPAction(requestContext);
+            if (soapAction != null) {
+                serviceClient.getOptions().setAction(soapAction);    
+            }
+            else {
+                serviceClient.getOptions().setAction("none");
+            }
+            
+            serviceClient.fireAndForget(ServiceClient.ANON_OUT_ONLY_OP, toOM(param));
+        } catch(AxisFault e) {
+        	// TODO Add Fault Processing
+        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
+
+        }
+    }
+    
+    public Future<?> invokeAsync(Parameter param, AsyncHandler asynchandler, Map requestContext) throws WebServiceException{
+        setupProperties(requestContext);
+        
+        try{
+            //TODO: This is not the correct way to setup the JAXBContext
+            if (clientContext.getJAXBContext() != null) {
+                JAXBParameter p = (JAXBParameter) param;
+                p.setJAXBContext(clientContext.getJAXBContext());
+            }
+            
+            serviceClient.getOptions().setTo(new EndpointReference(getEndpointURL(requestContext)));
+            serviceClient.getOptions().setReplyTo(getMyEPR());
+            
+            //TODO: This is a hack.  Need a better way to determine the default wsa:Action if
+            //a SOAPAction header does not exist.
+            String soapAction = getSOAPAction(requestContext);
+            if (soapAction != null) {
+                serviceClient.getOptions().setAction(soapAction);    
+            }
+            else {
+                serviceClient.getOptions().setAction("none");
+            }
+            
+            AxisCallback callback = new AxisCallback();
+            Boolean useAsyncMep = (Boolean) requestContext.get(Constants.USE_ASYNC_MEP);
+
+            if((useAsyncMep != null && useAsyncMep.booleanValue()) 
+                    || serviceClient.getOptions().isUseSeparateListener()) {
+                serviceClient.getOptions().setUseSeparateListener(true);
+                serviceClient.getOptions().setTransportInProtocol("http");
+            }
+
+            serviceClient.sendReceiveNonBlocking(ServiceClient.ANON_OUT_IN_OP, 
+                    toOM(param), callback);
+            
+            //Create the Parameter wrapper for the response based on what the input 
+            //type was.  If it was a JAXBParameter, then set the JAXBContext on it as well
+            Parameter responseParam = ParameterFactory.createParameter(param.getValue().getClass());
+            if (param instanceof JAXBParameter) {
+                JAXBParameter p = (JAXBParameter) responseParam;
+                p.setJAXBContext(clientContext.getJAXBContext());
+            }
+            
+            AsyncListener asyncProcessor = new AsyncListener(callback);
+            asyncProcessor.setMode((Mode) clientContext.getServiceMode());
+            //asyncProcessor.setParameter(responseParam);
+            
+            AsyncListenerWrapper<?> response = new AsyncListenerWrapper<Object>(asyncProcessor);
+            if(asynchandler !=null){
+                response.setAsyncHandler(asynchandler);
+            }
+            
+            try {
+                getExecutor().submit(response).get();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                throw ExceptionFactory.makeWebServiceException(e);
+            } catch (ExecutionException e) {
+                e.printStackTrace();
+                throw ExceptionFactory.makeWebServiceException(e);
+            }
+            
+            //TODO: Need to figure out who/when the Listener should be shutdown
+            //Do we do it after this request?  Or, can we ask the listener to check
+            //itself to see if any other responses are outstanding.
+            return response;
+        }catch(AxisFault e){
+        	// TODO Add Fault Processing
+        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("faultProcessingNotSupported", e.getMessage()), e);
+        }
+    }
+    
+    public Response invokeAsync(Parameter param, Map requestContext)throws WebServiceException{
+    	AsyncListenerWrapper<Object>  response= (AsyncListenerWrapper<Object>)invokeAsync(param, null, requestContext);
+        return response;
+    }
+    
+    private String getEndpointURL(Map requestContext){
+        return (String) requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+    }
+    
+    private String getSOAPAction(Map requestContext){
+        Boolean useSoapAction = (Boolean)requestContext.get(BindingProvider.SOAPACTION_USE_PROPERTY);
+        if(useSoapAction!=null && useSoapAction.booleanValue()){
+            return (String)requestContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
+        }
+        return null;
+    }
+    
+    private OMElement toOM(Parameter param){
+        /*TODO: This is a a hack.... I am getting the Header of the message and setting serviceClent header, then 
+        * extract body of message as OM and ServiceCleint will create the envelope. 
+        * I am doing this because ServiceClient wants to form the envelope and send it to AxisEngine.
+        * I would like to return param.toEnvelope() but ServiceClient will try to build envelope on top of envelope.
+        * Let just go directly to AxisEngine forget about ServiceClient... can I?
+        */
+        SOAPEnvelope env = ParameterUtils.toEnvelope((Mode) clientContext.getServiceMode(), 
+                serviceClient.getOptions().getSoapVersionURI(),
+                param);
+        SOAPBody body= env.getBody();
+        SOAPHeader soapHeader = env.getHeader();
+        addHeadersToServiceClient(soapHeader);
+        return body.getFirstElement();
+    }
+    
+    private void addHeadersToServiceClient(SOAPHeader soapHeader){
+        if(soapHeader!=null){
+            for(Iterator headers = soapHeader.getChildElements(); headers.hasNext();){
+                OMElement header = (OMElement)headers.next();
+                serviceClient.addHeader(header);
+            }
+        }
+    }
+    
+    private Parameter buildResponse(OMElement element, Parameter xmlResponse){
+        //Create empty SoapResponse first 
+        Parameter soapResponse = xmlResponse;
+        
+        /* get xmlResponse param from ServiceClient OM response, By the way ServiceClient always retuns an 
+         * OMElement xml string not Soap Env or Body.
+         * It does something like msgCtx.getEnvelope().getBody.getChild() --> i.e OMElement under the body.
+         * So we now have to go thru the pain of recreating the envelope. This is a performance issue...
+        */
+        xmlResponse.fromOM(element);
+        /*I will convert param toEnvelope since ServiceClient always send xml string.
+         * toEnvelope() in Parameter is coded just to handle this.
+         */
+        SOAPEnvelope env =xmlResponse.toEnvelope(null,serviceClient.getOptions().getSoapVersionURI());
+        
+        //TODO:(NLG) Need to figure out why we have to cast to (Mode) here. 
+        soapResponse.fromEnvelope((Mode) clientContext.getServiceMode(), env);
+        
+        return soapResponse;
+    }
+
+    /*
+     * Returns the EPR that should be used for in-bound async responses
+     */
+    private EndpointReference getMyEPR() {
+        if (myEPR != null) {        
+            return myEPR;
+        }
+        else {
+            try {
+                //TODO:(NLG) This should not be hard coded to HTTP and should allow
+                //for other transports to be used.
+                myEPR = serviceClient.getMyEPR("http");
+            } catch (AxisFault e) {
+                e.printStackTrace();
+            }
+            return myEPR;
+        }
+    }
+    
+    
+    /*
+     * TODO: This is a first pass at filtering the properties that are set on the 
+     * RequestContext.  Right now it's called during the invoke, but needs to be 
+     * moved over to when the property is set.  This should not be in the path
+     * of performance.
+     */
+    private void setupProperties(Map<String, Object> requestCtx) {
+        for (Iterator<String> it = requestCtx.keySet().iterator(); it.hasNext(); ) {
+            String key = it.next();
+            Object value = requestCtx.get(key);
+            
+            serviceClient.getOptions().setProperty(key, value);
+        }
+    }
+}

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Dispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Dispatch.java?view=diff&rev=452303&r1=452302&r2=452303
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Dispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/Dispatch.java Mon Oct  2 20:17:16 2006
@@ -1,252 +1,249 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.jaxws;
-
-import java.util.concurrent.Future;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Response;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.Service.Mode;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.jaxws.core.InvocationContext;
-import org.apache.axis2.jaxws.core.InvocationContextFactory;
-import org.apache.axis2.jaxws.core.MessageContext;
-import org.apache.axis2.jaxws.core.controller.AxisInvocationController;
-import org.apache.axis2.jaxws.core.controller.InvocationController;
-import org.apache.axis2.jaxws.i18n.Messages;
-import org.apache.axis2.jaxws.param.JAXBParameter;
-import org.apache.axis2.jaxws.param.Parameter;
-import org.apache.axis2.jaxws.param.ParameterFactory;
-import org.apache.axis2.jaxws.param.ParameterUtils;
-import org.apache.axis2.jaxws.spi.ServiceDelegate;
-import org.apache.axis2.jaxws.util.Constants;
-import org.apache.axis2.jaxws.util.WSDLWrapper;
-
-/**
- * Dispatch is an implementation of the {@link javax.xml.ws.Dispatch} interface.
- * 
- * The Dispatch is a client that can be used to invoke remote services that
- * requires the programmer to operate at the raw XML level.  The XML payloads
- * can be in two different formats, or Modes ({@link javax.xml.ws.Service.Mode}).
- * 
- * @param <T>
- */
-public class Dispatch<T> extends BindingProvider implements javax.xml.ws.Dispatch {
-    
-    //FIXME: Remove the AxisController completely and replace with InvocationController
-    private AxisController axisController = null;
-    
-    private InvocationController ic;
-    private ServiceDelegate serviceDelegate;
-    private Mode mode;
-    private JAXBContext jaxbContext;
-   
-    public Dispatch() {
-        super();
-    }
-    
-    public Dispatch(AxisController axisController){
-        super();
-        
-        //FIXME: Remove this when we remove the AxisController
-        this.axisController = axisController;
-        
-        ic = new AxisInvocationController();
-        setRequestContext();
-    }
-    
-    /**
-     * Sets the back pointer to the ServiceDelegate instance that created
-     * this Dispatch.
-     * 
-     * @param svcDlg
-     */
-    public void setServiceDelegate(ServiceDelegate svcDlg) {
-        serviceDelegate = svcDlg;
-    }
-    
-    /**
-     * Returns the back pointer to the Service Delegate instance that created
-     * this Dispatch.
-     * 
-     * @return
-     */
-    public ServiceDelegate getServiceDescription() {
-        return serviceDelegate;
-    }
-    
-    public Mode getMode() {
-        return mode;
-    }
-    
-    public void setMode(Mode m) {
-        mode = m;
-    }
-    
-    public JAXBContext getJAXBContext() {
-        return jaxbContext;
-    }
-    
-    public void setJAXBContext(JAXBContext jbc) {
-        jaxbContext = jbc;
-    }
-    
-    public Object invoke(Object obj) throws WebServiceException {
-        /*
-        
-        // Create the InvocationContext instance for this request/response flow.
-        InvocationContext invocationContext = InvocationContextFactory.createInvocationContext(null);
-        invocationContext.setServiceClient(axisController.getServiceClient());
-        
-        // Create the MessageContext to hold the actual request message and its
-        // associated properties
-        MessageContext requestMsgCtx = new MessageContext();
-        invocationContext.setRequestMessageContext(requestMsgCtx);
-        
-        // FIXME: This is where the Message Model will be integrated instead of 
-        // the ParameterFactory/Parameter APIs.
-        Parameter param = ParameterFactory.createParameter(obj);
-        if (param instanceof JAXBParameter) {
-            JAXBParameter p = (JAXBParameter) param;
-            p.setJAXBContext(jaxbContext);
-        }
-        
-        OMElement reqEnvelope = toOM(param, axisController.getServiceClient().getOptions().getSoapVersionURI());
-        requestMsgCtx.setMessageAsOM(reqEnvelope);
-        
-        // Copy the properties from the request context into the MessageContext
-        requestMsgCtx.getProperties().putAll(requestContext);
-        
-        // Send the request using the InvocationController
-        ic.invoke(invocationContext);
-        
-        MessageContext responseMsgCtx = invocationContext.getResponseMessageContext();
-        
-        //FIXME: This is temporary until more of the Message model is available
-        OMElement rspEnvelope = responseMsgCtx.getMessageAsOM();
-        Parameter rspParam;
-        // Create a new Parameter class for the output based on in the 
-        // input Parameter type.
-        try {
-            rspParam = param.getClass().newInstance();
-            if (rspParam instanceof JAXBParameter) {
-                JAXBParameter p = (JAXBParameter) rspParam;
-                p.setJAXBContext(jaxbContext);
-            }
-        } catch (Exception e) {
-            throw ExceptionFactory.makeWebServiceException(e);
-        }
-        
-        rspParam = fromOM(rspEnvelope, rspParam, axisController.getServiceClient().getOptions().getSoapVersionURI());
-        
-        return rspParam.getValue();
-        
-        */
-        
-        return null;
-    }
-    
-   public void invokeOneWay(Object obj) throws WebServiceException{
-       if(obj == null){
-           throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr1"));
-        }
-        try{
-            Parameter param = ParameterFactory.createParameter(obj);
-            axisController.invokeOneWay(param, requestContext);
-        }catch(Exception e){
-            throw ExceptionFactory.makeWebServiceException(e);
-        }
-    }
-   
-    public Future<?> invokeAsync(Object obj, AsyncHandler asynchandler) throws WebServiceException {
-       if(obj == null){
-    	   throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr2"));
-       }
-       try{
-           Parameter param = ParameterFactory.createParameter(obj);
-           return axisController.invokeAsync(param, asynchandler, requestContext);
-       } catch(Exception e) {
-           throw ExceptionFactory.makeWebServiceException(e);
-       }
-    }
-  
-    public Response invokeAsync(Object obj)throws WebServiceException{
-        if(obj == null){
-        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr2"));
-        }
-        try{
-            Parameter param = ParameterFactory.createParameter(obj);
-            return axisController.invokeAsync(param, requestContext);
-        }catch(Exception e){
-            throw ExceptionFactory.makeWebServiceException(e);
-        }
-    }    
-
-    protected void setRequestContext(){
-        String endPointAddress = axisController.getEndpointAddress();
-        WSDLWrapper wsdl =  axisController.getWSDLContext();
-        QName serviceName = axisController.getServiceName();
-        QName portName = axisController.getPortName();
-        if(endPointAddress != null && !"".equals(endPointAddress)){
-            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointAddress);
-        }else if(wsdl != null){
-            String soapAddress = wsdl.getSOAPAddress(serviceName, portName);
-            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);
-        }
-        
-        if(wsdl != null){
-            String soapAction = wsdl.getSOAPAction(serviceName, portName);
-            getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, soapAction);
-        }
-        
-        getRequestContext().put(Constants.QOS_WSADDRESSING_ENABLE, Boolean.FALSE);
-        getRequestContext().put(Constants.QOS_WSRM_ENABLE, Boolean.FALSE);
-    }
-    
-    /* 
-     * FIXME: This is temporary until more of the Message Model is available.
-     */
-    private OMElement toOM(Parameter param, String soapVersion){
-        SOAPEnvelope env = ParameterUtils.toEnvelope(mode, soapVersion, param);
-        System.out.println(">> Generated envelope [" + env.toString() + "]");
-        
-        SOAPBody body = env.getBody();
-        //SOAPHeader soapHeader = env.getHeader();
-        //addHeadersToServiceClient(soapHeader);
-        return body.getFirstElement();
-    }
-    
-    /*
-     * FIXME: This is temporary until more of the Message Model is available. 
-     */
-    private Parameter fromOM(OMElement element, Parameter response, String soapVersion){
-        response.fromOM(element);
-
-        // Convert param toEnvelope since ServiceClient always send xml string.
-        // toEnvelope() in Parameter is coded just to handle this.
-        SOAPEnvelope env = response.toEnvelope(null, soapVersion);
-        
-        response.fromEnvelope(mode, env);
-        return response;
-    }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.jaxws;
+
+import java.util.concurrent.Future;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.Service.Mode;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.jaxws.core.InvocationContext;
+import org.apache.axis2.jaxws.core.InvocationContextFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.core.controller.AxisInvocationController;
+import org.apache.axis2.jaxws.core.controller.InvocationController;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.param.JAXBParameter;
+import org.apache.axis2.jaxws.param.Parameter;
+import org.apache.axis2.jaxws.param.ParameterFactory;
+import org.apache.axis2.jaxws.param.ParameterUtils;
+import org.apache.axis2.jaxws.spi.ServiceDelegate;
+import org.apache.axis2.jaxws.util.Constants;
+import org.apache.axis2.jaxws.util.WSDLWrapper;
+
+/**
+ * Dispatch is an implementation of the {@link javax.xml.ws.Dispatch} interface.
+ * 
+ * The Dispatch is a client that can be used to invoke remote services that
+ * requires the programmer to operate at the raw XML level.  The XML payloads
+ * can be in two different formats, or Modes ({@link javax.xml.ws.Service.Mode}).
+ * 
+ * @param <T>
+ */
+public class Dispatch<T> extends BindingProvider implements javax.xml.ws.Dispatch {
+    
+    //FIXME: Remove the AxisController completely and replace with InvocationController
+    private AxisController axisController = null;
+    
+    private InvocationController ic;
+    private ServiceDelegate serviceDelegate;
+    private Mode mode;
+    private JAXBContext jaxbContext;
+   
+    public Dispatch() {
+        super();
+    }
+    
+    public Dispatch(AxisController axisController){
+        super();
+        
+        //FIXME: Remove this when we remove the AxisController
+        this.axisController = axisController;
+        
+        ic = new AxisInvocationController();
+        setRequestContext();
+    }
+    
+    /**
+     * Sets the back pointer to the ServiceDelegate instance that created
+     * this Dispatch.
+     * 
+     * @param svcDlg
+     */
+    public void setServiceDelegate(ServiceDelegate svcDlg) {
+        serviceDelegate = svcDlg;
+    }
+    
+    /**
+     * Returns the back pointer to the Service Delegate instance that created
+     * this Dispatch.
+     * 
+     * @return
+     */
+    public ServiceDelegate getServiceDescription() {
+        return serviceDelegate;
+    }
+    
+    public Mode getMode() {
+        return mode;
+    }
+    
+    public void setMode(Mode m) {
+        mode = m;
+    }
+    
+    public JAXBContext getJAXBContext() {
+        return jaxbContext;
+    }
+    
+    public void setJAXBContext(JAXBContext jbc) {
+        jaxbContext = jbc;
+    }
+    
+    public Object invoke(Object obj) throws WebServiceException {
+        /*
+        
+        // Create the InvocationContext instance for this request/response flow.
+        InvocationContext invocationContext = InvocationContextFactory.createInvocationContext(null);
+        invocationContext.setServiceClient(axisController.getServiceClient());
+        
+        // Create the MessageContext to hold the actual request message and its
+        // associated properties
+        MessageContext requestMsgCtx = new MessageContext();
+        invocationContext.setRequestMessageContext(requestMsgCtx);
+        
+        // FIXME: This is where the Message Model will be integrated instead of 
+        // the ParameterFactory/Parameter APIs.
+        Parameter param = ParameterFactory.createParameter(obj);
+        if (param instanceof JAXBParameter) {
+            JAXBParameter p = (JAXBParameter) param;
+            p.setJAXBContext(jaxbContext);
+        }
+        
+        OMElement reqEnvelope = toOM(param, axisController.getServiceClient().getOptions().getSoapVersionURI());
+        requestMsgCtx.setMessageAsOM(reqEnvelope);
+        
+        // Copy the properties from the request context into the MessageContext
+        requestMsgCtx.getProperties().putAll(requestContext);
+        
+        // Send the request using the InvocationController
+        ic.invoke(invocationContext);
+        
+        MessageContext responseMsgCtx = invocationContext.getResponseMessageContext();
+        
+        //FIXME: This is temporary until more of the Message model is available
+        OMElement rspEnvelope = responseMsgCtx.getMessageAsOM();
+        Parameter rspParam;
+        // Create a new Parameter class for the output based on in the 
+        // input Parameter type.
+        try {
+            rspParam = param.getClass().newInstance();
+            if (rspParam instanceof JAXBParameter) {
+                JAXBParameter p = (JAXBParameter) rspParam;
+                p.setJAXBContext(jaxbContext);
+            }
+        } catch (Exception e) {
+            throw ExceptionFactory.makeWebServiceException(e);
+        }
+        
+        rspParam = fromOM(rspEnvelope, rspParam, axisController.getServiceClient().getOptions().getSoapVersionURI());
+        
+        return rspParam.getValue();
+        
+        */
+        
+        return null;
+    }
+    
+   public void invokeOneWay(Object obj) throws WebServiceException{
+       if(obj == null){
+           throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr1"));
+        }
+        try{
+            Parameter param = ParameterFactory.createParameter(obj);
+            axisController.invokeOneWay(param, requestContext);
+        }catch(Exception e){
+            throw ExceptionFactory.makeWebServiceException(e);
+        }
+    }
+   
+    public Future<?> invokeAsync(Object obj, AsyncHandler asynchandler) throws WebServiceException {
+       if(obj == null){
+    	   throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr2"));
+       }
+       try{
+           Parameter param = ParameterFactory.createParameter(obj);
+           return axisController.invokeAsync(param, asynchandler, requestContext);
+       } catch(Exception e) {
+           throw ExceptionFactory.makeWebServiceException(e);
+       }
+    }
+  
+    public Response invokeAsync(Object obj)throws WebServiceException{
+        if(obj == null){
+        	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchInvokeErr2"));
+        }
+        try{
+            Parameter param = ParameterFactory.createParameter(obj);
+            return axisController.invokeAsync(param, requestContext);
+        }catch(Exception e){
+            throw ExceptionFactory.makeWebServiceException(e);
+        }
+    }    
+
+    protected void setRequestContext(){
+        String endPointAddress = axisController.getEndpointAddress();
+        WSDLWrapper wsdl =  axisController.getWSDLContext();
+        QName serviceName = axisController.getServiceName();
+        QName portName = axisController.getPortName();
+        if(endPointAddress != null && !"".equals(endPointAddress)){
+            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointAddress);
+        }else if(wsdl != null){
+            String soapAddress = wsdl.getSOAPAddress(serviceName, portName);
+            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);
+        }
+        
+        if(wsdl != null){
+            String soapAction = wsdl.getSOAPAction(serviceName, portName);
+            getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, soapAction);
+        }
+    }
+    
+    /* 
+     * FIXME: This is temporary until more of the Message Model is available.
+     */
+    private OMElement toOM(Parameter param, String soapVersion){
+        SOAPEnvelope env = ParameterUtils.toEnvelope(mode, soapVersion, param);
+        System.out.println(">> Generated envelope [" + env.toString() + "]");
+        
+        SOAPBody body = env.getBody();
+        //SOAPHeader soapHeader = env.getHeader();
+        //addHeadersToServiceClient(soapHeader);
+        return body.getFirstElement();
+    }
+    
+    /*
+     * FIXME: This is temporary until more of the Message Model is available. 
+     */
+    private Parameter fromOM(OMElement element, Parameter response, String soapVersion){
+        response.fromOM(element);
+
+        // Convert param toEnvelope since ServiceClient always send xml string.
+        // toEnvelope() in Parameter is coded just to handle this.
+        SOAPEnvelope env = response.toEnvelope(null, soapVersion);
+        
+        response.fromEnvelope(mode, env);
+        return response;
+    }
+}

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java?view=diff&rev=452303&r1=452302&r2=452303
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java Mon Oct  2 20:17:16 2006
@@ -244,9 +244,6 @@
         //    String soapAction = wsdl.getSOAPAction(serviceName, portName);
         //    getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, soapAction);
         //}
-        
-        getRequestContext().put(Constants.QOS_WSADDRESSING_ENABLE, Boolean.FALSE);
-        getRequestContext().put(Constants.QOS_WSRM_ENABLE, Boolean.FALSE);
     }
     
     public ServiceDelegate getServiceDelegate() {

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java?view=diff&rev=452303&r1=452302&r2=452303
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java Mon Oct  2 20:17:16 2006
@@ -585,17 +585,6 @@
         for (Iterator<String> it = properties.keySet().iterator(); it.hasNext(); ) {
             String key = it.next();
             Object value = properties.get(key);
-            
-            if (key.equals(Constants.QOS_WSRM_ENABLE)) {
-                key = "Sandesha2AppProcessingDone";
-                value = !(Boolean) value;
-                value = value.toString();
-            }
-            else if (key.equals(Constants.QOS_WSADDRESSING_ENABLE)) {
-                key = AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES;
-                value = !(Boolean) value;
-            }
-            
             ops.setProperty(key, value);
         }
         

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java?view=diff&rev=452303&r1=452302&r2=452303
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java Mon Oct  2 20:17:16 2006
@@ -34,15 +34,9 @@
     
     public static final String SCHEMA = "http://www.w3.org/2001/XMLSchema";
     
-    public static final String AXIS2_REPO_PATH = "com.ibm.websphere.webservices.axis2.repo.path";
-    public static final String AXIS2_CONFIG_PATH = "com.ibm.websphere.webservices.axis2.config.path";
-    public static final String USE_ASYNC_MEP = "com.ibm.websphere.webservices.use.async.mep";
-    
-    public static final String QOS_WSADDRESSING_ENABLE = "com.ibm.websphere.webservices.qos.wsaddressing.enable";
-    public static final String QOS_WSRM_ENABLE = "com.ibm.websphere.webservices.qos.wsrm.enable";
-    
-    public static final QName QNAME_WSADDRESSING_MODULE = new QName("", "addressing");
-    public static final QName QNAME_WSRM_MODULE = new QName("", "sandesha2");
+    public static final String AXIS2_REPO_PATH = "org.apache.axis2.jaxws.repo.path";
+    public static final String AXIS2_CONFIG_PATH = "org.apache.axis2.jaxws.config.path";
+    public static final String USE_ASYNC_MEP = "org.apache.axis2.jaxws.use.async.mep";
     
     public static final String THREAD_CONTEXT_MIGRATOR_LIST_ID = "JAXWS-ThreadContextMigrator-List";
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org