summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java77
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java77
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java140
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions17
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory19
-rw-r--r--sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml41
6 files changed, 0 insertions, 371 deletions
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java
deleted file mode 100644
index 45463fcd53..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSBindingProviderFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.sca.binding.ws.jaxws.ri;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
-import org.apache.tuscany.sca.runtime.RuntimeProperties;
-
-/**
- * JAXWSBindingProviderFactory
- *
- * @version $Rev$ $Date$
- */
-
-public class JAXWSBindingProviderFactory implements BindingProviderFactory<WebServiceBinding> {
-
- private FactoryExtensionPoint modelFactories;
- private ServletHost servletHost;
- private DataBindingExtensionPoint dataBindings;
- private String defaultPort = "8085";
-
- public JAXWSBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- dataBindings = extensionPoints.getExtensionPoint(DataBindingExtensionPoint.class);
-
- RuntimeProperties ps = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class);
- String pp = ps.getProperties().getProperty(this.getClass().getName() + ".defaultPort");
- if (pp != null) {
- this.defaultPort = ps.getProperties().getProperty(this.getClass().getName() + ".defaultPort");
- }
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) {
- return new JAXWSReferenceBindingProvider(endpointReference, modelFactories, dataBindings);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
- return new JAXWSServiceBindingProvider(endpoint, servletHost, modelFactories, dataBindings, defaultPort);
- }
-
- public Class<WebServiceBinding> getModelType() {
- return WebServiceBinding.class;
- }
-}
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java
deleted file mode 100644
index 7a1b8f356a..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSReferenceBindingProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.sca.binding.ws.jaxws.ri;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingInvoker;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.w3c.dom.Node;
-
-public class JAXWSReferenceBindingProvider implements ReferenceBindingProvider {
-
- private javax.xml.soap.MessageFactory messageFactory;
- private WebServiceBinding wsBinding;
- private RuntimeEndpointReference endpointReference;
-
- public JAXWSReferenceBindingProvider(RuntimeEndpointReference endpointReference,
- FactoryExtensionPoint modelFactories,
- DataBindingExtensionPoint dataBindings) {
-
- this.endpointReference = endpointReference;
- this.messageFactory = modelFactories.getFactory(javax.xml.soap.MessageFactory.class);
- this.wsBinding = (WebServiceBinding) endpointReference.getBinding();
-
- // A WSDL document should always be present in the binding
- if (wsBinding.getGeneratedWSDLDocument() == null) {
- throw new ServiceRuntimeException("No WSDL document for " + endpointReference.getURI());
- }
-
- // Set to use the DOM data binding
- InterfaceContract contract = wsBinding.getBindingInterfaceContract();
- if (contract.getInterface() != null) {
- contract.getInterface().resetDataBinding(Node.class.getName());
- }
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-
- public Invoker createInvoker(Operation operation) {
- return new JAXWSBindingInvoker(operation, null, messageFactory, wsBinding, endpointReference);
- }
-
-}
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java
deleted file mode 100644
index 516ca62c11..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.sca.binding.ws.jaxws.ri;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.soap.SOAPBinding;
-
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.apache.tuscany.sca.binding.ws.jaxws.JAXWSBindingProvider;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-
-@WebServiceProvider
-@ServiceMode(Mode.MESSAGE)
-public class JAXWSServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeEndpoint endpoint;
- private WebServiceBinding wsBinding;
-
- private JAXWSBindingProvider jaxwsBindingProvider;
-
- private Endpoint wsEndpoint;
-
- public JAXWSServiceBindingProvider(RuntimeEndpoint endpoint,
- ServletHost servletHost,
- FactoryExtensionPoint modelFactories,
- DataBindingExtensionPoint dataBindings, String defaultPort) {
-
- this.endpoint = endpoint;
- this.wsBinding = (WebServiceBinding)endpoint.getBinding();
-
- jaxwsBindingProvider = new JAXWSBindingProvider(endpoint,
- servletHost,
- modelFactories,
- dataBindings,
- defaultPort);
- }
-
- public void start() {
- // create the JAXWS endpoint based on the provider
- wsEndpoint = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, jaxwsBindingProvider);
-
- // TODO - There is something odd in the way that service name is calculated in
- // some circumstances
- // sometimes getServiceName() returns null
- // sometimes getService().getQName returns a QName namespace that doesn't match the WSDL
- // sometimes getNamespace() returns null
- // So here we delve directly into the WSDL4J model as the Tuscany model isn't up to date
- String targetNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getDefinition().getTargetNamespace();
-
- //set up WSDL for Provider
- List<Source> metadata = new ArrayList<Source>();
-
- // WSDL DOM seems to be null here so went with writing out
- // string version of WSDL and reading it back in again
- //Node node = wsBinding.getWSDLDefinition().getDefinition().getDocumentationElement();
- //Source source = new DOMSource(node);
-
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- try {
- WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
- writer.writeWSDL(wsBinding.getUserSpecifiedWSDLDefinition().getDefinition(), outStream);
- } catch (Exception ex){
- ex.printStackTrace();
- }
-
- //System.out.println(outStream.toString());
- ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
- Source source = new StreamSource(inStream);
- source.setSystemId(targetNamespace);
-
- metadata.add(source);
-
- Map<String, Object> properties = new HashMap<String, Object>();
-
- QName portName = new QName(targetNamespace,
- wsBinding.getPort().getName());
- properties.put(Endpoint.WSDL_PORT, portName);
-
- QName serviceName = new QName(targetNamespace,
- wsBinding.getService().getQName().getLocalPart());
- properties.put(Endpoint.WSDL_SERVICE, serviceName);
-
- wsEndpoint.setMetadata(metadata);
- wsEndpoint.setProperties(properties);
-
- // Start up the endpoint
- wsEndpoint.publish(wsBinding.getURI());
-
- jaxwsBindingProvider.start();
- }
-
- public void stop() {
- jaxwsBindingProvider.stop();
- wsEndpoint.stop();
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return wsBinding.getBindingInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return true;
- }
-}
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
deleted file mode 100644
index 452c9f2f5e..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index 9a36d0e461..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory;model=org.apache.tuscany.sca.binding.ws.WebServiceBinding
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml b/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
deleted file mode 100644
index 74a35634ee..0000000000
--- a/sca-java-2.x/branches/2.0-Beta1/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
--->
-
-<!-- $Rev: 907636 $ $Date: 2010-02-09 01:39:16 +1300 (Tue, 09 Feb 2010) $ -->
-
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <sca:bindingType type="sca:binding.ws" mayProvide="sca:SOAP sca:SOAP.v1_1 sca:SOAP.v1_2 tuscany:MTOM" alwaysProvides=""/>
-
- <!-- see the file sca-policy-1.1-intents-definitions.xml in the -->
- <!-- assembly-xsd module for spec defined intents -->
-
- <!-- PolicyIntents defined by the SCA Runtime Extension for WS Binding Axis 2 -->
-
- <sca:intent name="MTOM" constrains="sca:binding.ws">
- <sca:description>
- Communication through this binding requires MTOM support
- </sca:description>
- </sca:intent>
-
- </sca:definitions>