You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/02/27 01:45:07 UTC

svn commit: r381211 - in /incubator/tuscany/java/sca: ./ binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ binding.axis/src/main/java/org/apache/tuscany/binding/axis/...

Author: jsdelfino
Date: Sun Feb 26 16:45:05 2006
New Revision: 381211

URL: http://svn.apache.org/viewcvs?rev=381211&view=rev
Log:
Fixed compile errors in Axis binding - added skeleton of an ExternalService implementation - integrated back into the top level build

Added:
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java.off
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java.off
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/
    incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl
Removed:
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/mediator/
    incubator/tuscany/java/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl
    incubator/tuscany/java/sca/binding.axis/src/test/java/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl
Modified:
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java
    incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointBean.java
    incubator/tuscany/java/sca/pom.xml

Modified: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java?rev=381211&r1=381210&r2=381211&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java (original)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/builder/ExternalWebServiceWireBuilder.java Sun Feb 26 16:45:05 2006
@@ -7,14 +7,31 @@
 import org.apache.tuscany.core.context.ScopeContext;
 import org.apache.tuscany.core.invocation.InvocationConfiguration;
 import org.apache.tuscany.core.invocation.spi.ProxyFactory;
+import org.apache.tuscany.core.runtime.RuntimeContext;
+import org.apache.tuscany.core.system.annotation.Autowire;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Scope;
 
+@Scope("MODULE")
 public class ExternalWebServiceWireBuilder implements WireBuilder {
 
+    private RuntimeContext runtimeContext;
+
     /**
      * Constructs a new ExternalWebServiceWireBuilder.
      */
     public ExternalWebServiceWireBuilder() {
         super();
+    }
+
+    @Autowire
+    public void setRuntimeContext(RuntimeContext context) {
+        runtimeContext = context;
+    }
+
+    @Init(eager=true)
+    public void init() {
+        runtimeContext.addBuilder(this);
     }
 
     public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException {

Added: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java.off
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java.off?rev=381211&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java.off (added)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceConfigurationHandler.java.off Sun Feb 26 16:45:05 2006
@@ -0,0 +1,93 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.tuscany.binding.axis.handler;
+
+import java.util.Map;
+
+import org.apache.tuscany.core.addressing.EndpointReference;
+import org.apache.tuscany.core.context.TuscanyModuleComponentContext;
+import org.apache.tuscany.core.invocation.InvocationConfiguration;
+import org.apache.tuscany.core.invocation.MessageHandler;
+import org.apache.tuscany.core.invocation.ProxyConfiguration;
+import org.apache.tuscany.core.message.Message;
+import org.apache.tuscany.model.assembly.Binding;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.Interface;
+import org.apache.tuscany.model.assembly.Part;
+import org.apache.tuscany.model.types.InterfaceType;
+import org.apache.tuscany.model.types.OperationType;
+import org.apache.tuscany.model.types.wsdl.WSDLOperationType;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.model.WebServiceBinding;
+
+/**
+ */
+public class ExternalWebServiceConfigurationHandler implements MessageHandler {
+    /**
+     * Constructor.
+     */
+    public ExternalWebServiceConfigurationHandler() {
+        super();
+    }
+
+    /**
+     * @see org.apache.tuscany.core.invocation.MessageHandler#processMessage(org.apache.tuscany.core.message.Message)
+     */
+    public boolean processMessage(Message message) {
+        // Get the endpoint reference of the target service and the service model element
+        EndpointReference endpointReference = message.getEndpointReference();
+        Object portEndpoint = endpointReference.getConfiguredPort();
+
+        // Return immediately if the target is not an external service
+        if (!(portEndpoint instanceof ConfiguredService))
+            return false;
+        ConfiguredService serviceEndpoint = (ConfiguredService) portEndpoint;
+        Part part = serviceEndpoint.getPart();
+        if (!(part instanceof ExternalService))
+            return false;
+        ExternalService externalService = (ExternalService) part;
+
+        // Return immediately if this is not an external web service
+        Binding binding = externalService.getBindings().get(0);
+        if (!(binding instanceof WebServiceBinding))
+            return false;
+        WebServiceBinding wsBinding = (WebServiceBinding) binding;
+
+        TuscanyModuleComponentContext context = (TuscanyModuleComponentContext) CurrentModuleContext.getContext();
+
+        // Get the proxy configuration
+        ProxyConfiguration proxyConfiguration=(ProxyConfiguration)message.getBody();
+        Map<OperationType, InvocationConfiguration> invocationConfigurations=proxyConfiguration.getInvocationConfigurations();
+
+        // Get the business interface
+        Interface targetInterface = serviceEndpoint.getService().getInterfaceContract();
+        InterfaceType targetInterfaceType = targetInterface.getInterfaceType();
+
+        // Create the invocation configurations
+        for (InvocationConfiguration invocationConfiguration : invocationConfigurations.values()) {
+            OperationType targetOperationType=targetInterfaceType.getOperationType(invocationConfiguration.getOperationType().getName());
+
+            // Handle a business method invocation, get a message handler from the port
+            ExternalWebServiceHandler handler = new ExternalWebServiceHandler(context, (WSDLOperationType) targetOperationType, externalService, wsBinding, endpointReference);
+            invocationConfiguration.addRequestHandler(handler);
+        }
+
+        return false;
+    }
+
+}

Added: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java.off
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java.off?rev=381211&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java.off (added)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/ExternalWebServiceHandler.java.off Sun Feb 26 16:45:05 2006
@@ -0,0 +1,426 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.tuscany.binding.axis.handler;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Input;
+import javax.wsdl.Operation;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.ServiceFactory;
+
+import org.apache.axis.client.Call;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.tuscany.binding.axis.assembly.WebServiceBinding;
+import org.apache.tuscany.binding.axis.mediator.SOAPMediator;
+import org.apache.tuscany.binding.axis.mediator.impl.SOAPDocumentLiteralMediatorImpl;
+import org.apache.tuscany.core.addressing.EndpointReference;
+import org.apache.tuscany.core.invocation.MessageHandler;
+import org.apache.tuscany.core.message.Message;
+import org.apache.tuscany.core.message.impl.MessageFactoryImpl;
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
+import org.apache.tuscany.sdo.helper.HelperProviderImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.osoa.sca.ServiceUnavailableException;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ *         Operation handler
+ */
+public class ExternalWebServiceHandler implements MessageHandler {
+    private TuscanyModuleComponentContext moduleContext;
+    private Service jaxrpcService;
+    private WebServicePortMetaData portMetaData;
+    private Call call;
+    private Operation wsdlOperation;
+    private boolean rpcStyle;
+    private boolean rpcEncoded;
+    private SOAPMediator mediator;
+    private Boolean wrapped;
+
+    private void configureCall() throws ServiceException {
+
+        String soapAction = getSOAPAction();
+        // Create a JAX RPC call object for the particular operation
+        QName portName = portMetaData.getPortName();
+        call = (Call) jaxrpcService.createCall(portName);
+
+        // set operation name
+        WebServiceOperationMetaData operationMetaData = portMetaData.getOperationMetaData(wsdlOperation.getName());
+
+        call.setOperationName(operationMetaData.getRPCOperationName());
+
+        // Set the target endpoint address
+        String endpoint = portMetaData.getEndpoint();
+        if (endpoint != null) {
+            String originalEndpoint = call.getTargetEndpointAddress();
+            if (!endpoint.equals(originalEndpoint))
+                call.setTargetEndpointAddress(endpoint);
+        }
+
+        // Set the SOAP action
+        if (soapAction != null) {
+            call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+            call.setProperty(Call.SOAPACTION_URI_PROPERTY, soapAction);
+        }
+
+        // Set the encoding style
+        String bindingStyle = operationMetaData.getStyle();
+        rpcStyle = "rpc".equals(bindingStyle);
+        String bindingUse = operationMetaData.getUse();
+        rpcEncoded = "encoded".equals(bindingUse);
+        call.setProperty(Call.OPERATION_STYLE_PROPERTY, (rpcStyle) ? "rpc" : "document");
+
+        // Create the appropriate mediator
+//FIXME only support document style for now 
+//        if (rpcStyle) {
+//            if (rpcEncoded) {
+//                mediator = new SOAPRPCEncodedMediatorImpl(portMetaData);
+//            } else {
+//                mediator = new SOAPRPCLiteralMediatorImpl(portMetaData);
+//            }
+//        } else {
+            mediator = new SOAPDocumentLiteralMediatorImpl(portMetaData);
+//        }
+
+    }
+
+    private boolean isWrappedStyle() {
+        if (wrapped == null) {
+            wrapped = Boolean.valueOf(isWrappedStyle(wsdlOperation));
+        }
+        return wrapped.booleanValue();
+    }
+
+    public static boolean isWrappedStyle(Operation wsdlOperation) {
+        Input input = wsdlOperation.getInput();
+        if (input == null)
+            return false;
+        javax.wsdl.Message message = input.getMessage();
+        if (message == null)
+            return false;
+        Collection<Part> parts=message.getParts().values();
+        if (parts.size() != 1)
+            return false;
+        Part part = parts.iterator().next();
+        QName elementName=part.getElementName();
+        if (elementName == null)
+            return false;
+        if (elementName.getLocalPart().equals(wsdlOperation.getName()))
+            return true;
+        else
+            return false;
+    }
+
+    /**
+     * @see org.apache.tuscany.core.invocation.MessageHandler#processMessage(org.apache.tuscany.core.message.Message)
+     */
+    public boolean processMessage(Message message) {
+        try {
+            // Create a new SOAP envelope
+            SOAPEnvelope requestEnvelope = new SOAPEnvelopeImpl();
+
+            Object input=message.getBody();
+            Message requestMessage = createRequestMessage(moduleContext, wsdlOperation, input);
+
+            // Write the SCA message into the SOAP envelope
+            mediator.writeRequest(moduleContext, requestMessage, wsdlOperation, requestEnvelope);
+
+            // Invoke the SOAP operation
+            call.setRequestMessage(new org.apache.axis.Message(requestEnvelope));
+            call.invoke();
+
+            // Create an SCA message from the response envelope
+            SOAPEnvelope responseEnvelope = call.getResponseMessage().getSOAPEnvelope();
+            Message responseMessage = new MessageFactoryImpl().createMessage();
+            mediator.readResponse(moduleContext, responseEnvelope, responseMessage, wsdlOperation);
+
+            Object output=getResponse(responseMessage, wsdlOperation);
+            responseMessage.setBody(output);
+            
+            // Generate a message ID
+            responseMessage.setRelatesTo(message.getMessageID());
+            responseMessage.setMessageID(EcoreUtil.generateUUID());
+
+            // Send the response message
+            EndpointReference replyTo = message.getReplyTo();
+            responseMessage.setEndpointReference(replyTo);
+
+            message.getCallbackChannel().send(responseMessage);
+            
+            return false;
+
+        } catch (Exception e) {
+            throw new ServiceUnavailableException(e);
+        }
+    }
+
+    public static Object getResponse(Message responseMessage, Operation wsdlOperation) {
+        Object result = responseMessage.getBody();
+        if (result == null)
+            return null;
+
+        List properties = wsdlOperationType.getOutputType().getProperties();
+        if (isWrappedStyle(wsdlOperation)) {
+            DataObject outputBody = ((DataObject) result).getDataObject(0);
+            Property property = (Property) properties.get(0); // the single part
+            List argList = property.getType().getProperties();
+            Object[] results = new Object[argList.size()];
+            for (int i = 0; i < results.length; i++) {
+                results[i] = outputBody.get(i);
+            }
+            if (results.length == 1)
+                return results[0];
+            else
+                return results;
+
+        } else {
+            // FIXME: [rfeng] How to deal with multi-parts output
+            DataObject outputBody = ((DataObject) result).getDataObject(0);
+            return outputBody;
+        }
+    }
+
+    public static Object[] getRequest(Message requestMessage, Operation wsdlOperation) {
+        Object request = requestMessage.getBody();
+        if (request == null)
+            return null;
+
+        List properties = wsdlOperationType.getInputType().getProperties();
+        if (isWrappedStyle(wsdlOperation)) {
+            DataObject inputPart = ((DataObject) request).getDataObject(0); // Get the single part
+            Property property = (Property) properties.get(0); // Type of the part
+            List argList = property.getType().getProperties();
+            Object[] results = new Object[argList.size()];
+            for (int i = 0; i < results.length; i++) {
+                // Each property of the part is corresponding to an argument
+                results[i] = inputPart.get(i);
+            }
+            return results;
+        } else {
+            DataObject inputMessage = (DataObject) request;
+            Object[] results = new Object[properties.size()];
+            for (int i = 0; i < results.length; i++) {
+                // Each part is a property of the request message
+                results[i] = inputMessage.get(i);
+            }
+            return results;
+        }
+    }
+
+    /**
+     * @param input
+     */
+    public static Message createRequestMessage(TuscanyModuleComponentContext context, Operation operation, Object input) {
+        Message message = new MessageFactoryImpl().createMessage();
+        HelperProvider provider = new HelperProviderImpl((ConfiguredResourceSet) context.getAssemblyModelContext().getAssemblyLoader());
+        Type inputType = operationType.getInputType();
+        DataObject inputBody = provider.getDataFactory().create(inputType);
+
+        DataObject inputData = null;
+        if (isWrappedStyle(operationType)) {
+            inputData = inputBody.createDataObject(0);
+        } else
+            inputData = inputBody;
+
+        Object[] args = (Object[]) input;
+        for (int i = 0; i < args.length; i++) {
+            inputData.set(i, args[i]);
+        }
+        message.setBody(inputBody);
+        return message;
+    }
+
+    /**
+     * @param response
+     */
+    public static Message createResponseMessage(TuscanyModuleComponentContext context, Operation operation, Object response) {
+        Message message = new MessageFactoryImpl().createMessage();
+        HelperProvider provider = new HelperProviderImpl((ConfiguredResourceSet) context.getAssemblyModelContext().getAssemblyLoader());
+        Type outputType = operationType.getOutputType();
+        DataObject outputBody = provider.getDataFactory().create(outputType);
+
+        DataObject outputData = null;
+        if (isWrappedStyle(operationType)) {
+            outputData = outputBody.createDataObject(0);
+        } else {
+            outputData = outputBody;
+        }
+
+        // FIXME: Assume only one part output
+        outputData.set(0, response);
+
+        message.setBody(outputBody);
+        return message;
+    }
+
+    /**
+     * Constructor
+     *
+     * @param moduleContext
+     * @param externalService
+     * @param wsBinding
+     * @param endpointReference
+     */
+    public ExternalWebServiceHandler(TuscanyModuleComponentContext moduleContext, Operation wsdlOperation, ExternalService externalService, WebServiceBinding wsBinding,
+                             EndpointReference endpointReference) {
+
+        this.moduleContext = moduleContext;
+        this.wsdlOperation = wsdlOperation;
+
+        // Get the WSDL port name
+        String portName = wsBinding.getWSDLPort();
+        if (portName != null) {
+
+            // A port name is specified, create a port handler for this port and cache it in the binding model
+            AssemblyFactory assemblyFactory = new AssemblyFactoryImpl();
+            QName wsdlPortName = assemblyFactory.createQName(portName);
+            Definition wsdlDefinition = typeHelper.getWSDLDefinition(wsdlPortName.getNamespaceURI());
+            if (wsdlDefinition == null) {
+                throw new IllegalArgumentException("WSDL definition cannot be found for " + wsdlPortName);
+            }
+
+            // In managed mode, work with a Web service reference
+            // FIXME: [rfeng] Need the API to test isManaged
+            boolean managed = false;
+
+            if (managed) {
+                // Lookup a Web service reference
+                String jndiName = "java:comp/env/sca/externalService/" + externalService.getName();
+
+                // TODO Port this to Axis+Tomcat
+                jaxrpcService = null;
+
+                if (jaxrpcService != null) {
+
+                    // Get the actual endpoint from the JSR 109 service reference, unless it is overriden
+                    // by the wsBinding
+                    String endpoint;
+                    if (wsBinding.getUri() == null) {
+                        Call axisCall;
+                        try {
+                            axisCall = (Call) jaxrpcService.createCall(wsdlPortName);
+                        } catch (ServiceException e) {
+                            throw new ServiceUnavailableException(e);
+                        }
+                        endpoint = axisCall.getTargetEndpointAddress();
+                    } else
+                        endpoint = wsBinding.getUri();
+
+                    // Create a port info object to hold the port information
+                    portMetaData = new WebServicePortMetaData(typeHelper, wsdlDefinition, wsdlPortName, endpoint, managed);
+
+                } else {
+
+                    // Can't create a managed port resource, try unmanaged
+                    managed = false;
+                }
+            }
+
+            // Unmanaged mode
+            if (!managed) {
+
+                // Create a port info object to hold the port information
+                portMetaData = new WebServicePortMetaData(typeHelper, wsdlDefinition, wsdlPortName, wsBinding.getUri(), managed);
+
+                // Create a JAX-RPC service
+                QName wsdlServiceName = portMetaData.getService().getQName();
+                try {
+                    jaxrpcService = ServiceFactory.newInstance().createService(wsdlServiceName);
+                    configureCall();
+                } catch (ServiceException e) {
+                    throw new ServiceUnavailableException(e);
+                }
+            }
+
+        } else {
+
+            // No port is specified in the wsBinding, we are expecting the endpoint reference to specify the
+            // service name, port name and endpoint
+
+            // Get the port type name, service name, port name, and endpoint address from the
+            // endpoint reference
+            AssemblyFactory assemblyFactory = new AssemblyFactoryImpl();
+            QName wsdlServiceName = assemblyFactory.createQName(endpointReference.getServiceName());
+            String wsdlPortName = endpointReference.getPortName();
+            QName wsdlPortTypeName = assemblyFactory.createQName(endpointReference.getPortTypeName());
+            String endpoint = endpointReference.getAddress();
+
+            // If a service name and/or port name are specified then look up the port
+            if (wsdlServiceName != null && wsdlPortName != null) {
+                String nsUri = wsdlServiceName.getNamespaceURI();
+                Definition wsdlDefinition = typeHelper.getWSDLDefinition(nsUri);
+
+                // Create a port info object to hold the port information
+                portMetaData = new WebServicePortMetaData(typeHelper, wsdlDefinition, new QName(wsdlServiceName.getNamespaceURI(), wsdlPortName), endpoint, false);
+
+            } else {
+
+                // Create default service and port names
+                if (wsdlServiceName == null)
+                    wsdlServiceName = new QName("http://tempuri.org", "TempService");
+                if (wsdlPortName == null)
+                    wsdlPortName = "TempPort";
+
+                // Create a port info object to hold the port information
+                portMetaData = new WebServicePortMetaData(wsdlServiceName, wsdlPortName, wsdlPortTypeName, endpoint);
+            }
+
+            // Create a new JAXRPC service
+            try {
+                jaxrpcService = ServiceFactory.newInstance().createService(wsdlServiceName);
+                configureCall();
+            } catch (ServiceException e) {
+                throw new ServiceUnavailableException(e);
+            }
+        }
+
+    }
+
+    private String getSOAPAction() {
+        Port wsdlPort = portMetaData.getPort();
+        if (wsdlPort != null) {
+            // Create the method handler
+            WebServiceOperationMetaData operationMetaData = portMetaData.getOperationMetaData(wsdlOperation.getName());
+            String soapAction = operationMetaData.getSOAPAction();
+            return (soapAction);
+        } else {
+
+            // No WSDL binding, assume a default SOAP document literal binding from the operation type
+            // Derive the SOAP action from the input type
+            String namespace = "";
+            String name = wsdlOperation.getName();
+            String soapAction = namespace + '/' + name;
+
+            // Create the method handler
+            return (soapAction);
+        }
+	}
+
+}
\ No newline at end of file

Modified: incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointBean.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointBean.java?rev=381211&r1=381210&r2=381211&view=diff
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointBean.java (original)
+++ incubator/tuscany/java/sca/binding.axis/src/main/java/org/apache/tuscany/binding/axis/handler/WebServiceEntryPointBean.java Sun Feb 26 16:45:05 2006
@@ -17,41 +17,17 @@
 package org.apache.tuscany.binding.axis.handler;
 
 import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.xml.namespace.QName;
 import javax.xml.rpc.ServiceException;
 import javax.xml.rpc.server.ServiceLifecycle;
 import javax.xml.rpc.server.ServletEndpointContext;
 
 import org.apache.axis.MessageContext;
-import org.apache.axis.message.MessageElement;
-import org.apache.axis.message.SOAPBody;
 import org.apache.axis.message.SOAPEnvelope;
-import org.apache.tuscany.binding.axis.assembly.WebServiceBinding;
-import org.apache.tuscany.binding.axis.mediator.SOAPMediator;
-import org.apache.tuscany.binding.axis.mediator.impl.SOAPDocumentLiteralMediatorImpl;
 import org.apache.tuscany.core.addressing.EndpointReference;
-import org.apache.tuscany.core.addressing.impl.AddressingFactoryImpl;
 import org.apache.tuscany.core.context.AggregateContext;
-import org.apache.tuscany.core.invocation.spi.ProxyFactory;
-import org.apache.tuscany.core.message.Message;
-import org.apache.tuscany.core.message.impl.MessageFactoryImpl;
-import org.apache.tuscany.model.assembly.AssemblyFactory;
-import org.apache.tuscany.model.assembly.ConfiguredReference;
-import org.apache.tuscany.model.assembly.ConfiguredService;
-import org.apache.tuscany.model.assembly.EntryPoint;
-import org.apache.tuscany.model.assembly.Module;
-import org.apache.tuscany.model.assembly.ServiceContract;
-import org.apache.tuscany.model.assembly.ServiceURI;
-import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
 import org.apache.tuscany.model.types.wsdl.WSDLServiceContract;
-import org.osoa.sca.CurrentModuleContext;
-import org.osoa.sca.ServiceRuntimeException;
 
 //FIXME most of this class is commented out for now
 

Added: incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl?rev=381211&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl (added)
+++ incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/account/AccountService.wsdl Sun Feb 26 16:45:05 2006
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  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.
+ -->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:tns="http://www.bigbank.com/AccountService/"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  targetNamespace="http://www.bigbank.com/AccountService/"
+
+                  name="AccountService">
+
+    <wsdl:types>
+        <xsd:schema targetNamespace="http://www.bigbank.com/AccountService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+            <xsd:element name="customerID" type="xsd:string"/>
+            <xsd:element name="getAccountReportResponse" type="tns:AccountReport"/>
+
+            <xsd:complexType name="AccountReport">
+                <xsd:sequence>
+                    <xsd:element name="accountSummary" type="tns:AccountSummary" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:complexType>
+            <xsd:complexType name="AccountSummary">
+                <xsd:sequence>
+                    <xsd:element name="accountNumber" type="xsd:string"/>
+                    <xsd:element name="accountType" type="xsd:string"/>
+                    <xsd:element name="balance" type="xsd:float"/>
+                </xsd:sequence>
+            </xsd:complexType>
+
+        </xsd:schema>
+    </wsdl:types>
+    <wsdl:message name="getAccountReportRequest">
+        <wsdl:part element="tns:customerID" name="getAccountReportRequest"/>
+    </wsdl:message>
+    <wsdl:message name="getAccountReportResponse">
+        <wsdl:part element="tns:getAccountReportResponse" name="getAccountReportResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="AccountService">
+        <wsdl:operation name="getAccountReport">
+            <wsdl:input message="tns:getAccountReportRequest"/>
+            <wsdl:output message="tns:getAccountReportResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="AccountServiceSOAP" type="tns:AccountService">
+        <soap:binding style="document"
+                      transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="getAccountReport">
+            <soap:operation
+                    soapAction="http://www.bigbank.com/AccountService/getAccountReport"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="AccountService">
+        <wsdl:port binding="tns:AccountServiceSOAP"
+                   name="AccountServiceSOAP">
+            <soap:address location=""/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl?rev=381211&view=auto
==============================================================================
--- incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl (added)
+++ incubator/tuscany/java/sca/binding.axis/src/test/resources/org/apache/tuscany/binding/axis/assembly/tests/bigbank/account/services/stockquote/StockQuoteWebService.wsdl Sun Feb 26 16:45:05 2006
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  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.
+ -->
+<wsdl:definitions targetNamespace="http://webservice.stockquote" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservice.stockquote" xmlns:intf="http://webservice.stockquote" xmlns:tns1="http://stockquote" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="">
+    <!--WSDL created by Apache Axis version: 1.2.1
+Built on Jun 14, 2005 (09:15:57 EDT)-->
+    <wsdl:types>
+        <schema elementFormDefault="qualified" targetNamespace="http://stockquote" xmlns="http://www.w3.org/2001/XMLSchema">
+            <complexType name="GetQuoteRequest">
+                <sequence>
+                    <element name="symbol" nillable="true" type="xsd:string"/>
+                </sequence>
+            </complexType>
+            <complexType name="GetQuoteResponse">
+                <sequence>
+                    <element name="price" type="xsd:float"/>
+                </sequence>
+            </complexType>
+        </schema>
+        <schema elementFormDefault="qualified" targetNamespace="http://webservice.stockquote" xmlns="http://www.w3.org/2001/XMLSchema">
+            <import namespace="http://stockquote"/>
+            <element name="request" type="tns1:GetQuoteRequest"/>
+            <element name="getQuoteReturn" type="tns1:GetQuoteResponse"/>
+        </schema>
+    </wsdl:types>
+
+    <wsdl:message name="getQuoteResponse">
+
+        <wsdl:part element="impl:getQuoteReturn" name="getQuoteReturn"/>
+
+    </wsdl:message>
+
+    <wsdl:message name="getQuoteRequest">
+
+        <wsdl:part element="impl:request" name="request"/>
+
+    </wsdl:message>
+
+    <wsdl:portType name="StockQuoteWebService">
+
+        <wsdl:operation name="getQuote" parameterOrder="request">
+
+            <wsdl:input message="impl:getQuoteRequest" name="getQuoteRequest"/>
+
+            <wsdl:output message="impl:getQuoteResponse" name="getQuoteResponse"/>
+
+        </wsdl:operation>
+
+    </wsdl:portType>
+
+    <wsdl:binding name="StockQuoteWebServiceSoapBinding" type="impl:StockQuoteWebService">
+
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <wsdl:operation name="getQuote">
+
+            <wsdlsoap:operation soapAction=""/>
+
+            <wsdl:input name="getQuoteRequest">
+
+                <wsdlsoap:body use="literal"/>
+
+            </wsdl:input>
+
+            <wsdl:output name="getQuoteResponse">
+
+                <wsdlsoap:body use="literal"/>
+
+            </wsdl:output>
+
+        </wsdl:operation>
+
+    </wsdl:binding>
+
+    <wsdl:service name="StockQuoteWebServiceService">
+
+        <wsdl:port binding="impl:StockQuoteWebServiceSoapBinding" name="StockQuoteWebService">
+
+            <wsdlsoap:address location="http://localhost:8123/StockQuoteWebService/services/StockQuoteWebService"/>
+
+        </wsdl:port>
+
+    </wsdl:service>
+
+</wsdl:definitions>

Modified: incubator/tuscany/java/sca/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/pom.xml?rev=381211&r1=381210&r2=381211&view=diff
==============================================================================
--- incubator/tuscany/java/sca/pom.xml (original)
+++ incubator/tuscany/java/sca/pom.xml Sun Feb 26 16:45:05 2006
@@ -30,7 +30,7 @@
         <module>common</module>
         <module>model</module>
         <module>core</module>
-<!--        <module>binding.axis</module> -->
+        <module>binding.axis</module>
         <module>container.java</module>
         <module>container.js</module>
         <module>tomcat</module>