cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r467598 [2/2] - in /incubator/cxf/trunk: distribution/src/main/release/samples/j2ee/ distribution/src/main/release/samples/j2ee/jca/ distribution/src/main/release/samples/j2ee/jca/common/ distribution/src/main/release/samples/j2ee/jca/commo...
Date Wed, 25 Oct 2006 10:15:54 GMT
Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl?view=auto&rev=467598
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
Wed Oct 25 03:15:47 2006
@@ -0,0 +1,362 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"

+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://apache.org/hello_world_soap_http"
+    xmlns:x1="http://apache.org/hello_world_soap_http/types"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" 
+            xmlns="http://www.w3.org/2001/XMLSchema"
+	    xmlns:tns="http://apache.org/hello_world_soap_http/types"
+            elementFormDefault="qualified">
+	    <simpleType name="MyStringType">
+		<restriction base="string">
+		    <maxLength value="30" />
+		</restriction>
+	    </simpleType>
+
+            <element name="sayHi">
+                <complexType/>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="tns:MyStringType"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeOneWay">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="pingMe">
+                <complexType/>
+            </element>
+            <element name="pingMeResponse">
+                <complexType/>
+            </element>
+            <element name="faultDetail">
+                <complexType>
+                    <sequence>
+                        <element name="minor" type="short"/>
+                        <element name="major" type="short"/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part element="x1:sayHi" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part element="x1:sayHiResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+        <wsdl:part element="x1:greetMe" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+        <wsdl:part element="x1:greetMeResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+        <wsdl:part element="x1:greetMeOneWay" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeRequest">
+        <wsdl:part name="in" element="x1:pingMe"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeResponse">
+        <wsdl:part name="out" element="x1:pingMeResponse"/>
+    </wsdl:message>		
+    <wsdl:message name="pingMeFault">
+        <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+            <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+            <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+        </wsdl:operation> 
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="sayHiRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="greetMeResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeOneWayRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="pingMeFault">
+                <soap:fault name="pingMeFault" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+
+<?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.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"

+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://apache.org/hello_world_soap_http"
+    xmlns:x1="http://apache.org/hello_world_soap_http/types"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" 
+            xmlns="http://www.w3.org/2001/XMLSchema"
+	    xmlns:tns="http://apache.org/hello_world_soap_http/types"
+            elementFormDefault="qualified">
+	    <simpleType name="MyStringType">
+		<restriction base="string">
+		    <maxLength value="30" />
+		</restriction>
+	    </simpleType>
+
+            <element name="sayHi">
+                <complexType/>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="tns:MyStringType"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeOneWay">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="pingMe">
+                <complexType/>
+            </element>
+            <element name="pingMeResponse">
+                <complexType/>
+            </element>
+            <element name="faultDetail">
+                <complexType>
+                    <sequence>
+                        <element name="minor" type="short"/>
+                        <element name="major" type="short"/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part element="x1:sayHi" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part element="x1:sayHiResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+        <wsdl:part element="x1:greetMe" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+        <wsdl:part element="x1:greetMeResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+        <wsdl:part element="x1:greetMeOneWay" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeRequest">
+        <wsdl:part name="in" element="x1:pingMe"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeResponse">
+        <wsdl:part name="out" element="x1:pingMeResponse"/>
+    </wsdl:message>		
+    <wsdl:message name="pingMeFault">
+        <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+            <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+            <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+        </wsdl:operation> 
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="sayHiRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="greetMeResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeOneWayRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="pingMeFault">
+                <soap:fault name="pingMeFault" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/hello_world_soap_http/src/hello_world.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/jca/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/pom.xml?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/pom.xml (original)
+++ incubator/cxf/trunk/jca/pom.xml Wed Oct 25 03:15:47 2006
@@ -101,15 +101,12 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
             <version>1.0.1</version>
-            <scope>provided</scope>
         </dependency>
 
-        <!--TODO It's pretty unclear why there is code requiring ejb classes. Perhaps
the code doesn't belong here? -->
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ejb_2.1_spec</artifactId>
             <version>1.0.1</version>
-            <scope>provided</scope>
         </dependency>
 
     </dependencies>

Modified: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalException.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalException.java?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalException.java
(original)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalException.java
Wed Oct 25 03:15:47 2006
@@ -71,6 +71,7 @@
         }
     }
 
+    /*
     public Exception getLinkedException() {
         Exception linkedEx = null;
         if (getCause() instanceof Exception) {
@@ -78,4 +79,5 @@
         }
         return linkedEx;
     }
+    */
 }

Modified: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java (original)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java Wed Oct
25 03:15:47 2006
@@ -22,47 +22,67 @@
 import java.io.IOException;
 import java.io.InputStream;
 //import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
+//import java.lang.reflect.InvocationTargetException;
+//import java.lang.reflect.Method;
+//import java.lang.reflect.Proxy;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
+//import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.logging.Logger;
 
+//import javax.ejb.EJBHome;
+//import javax.ejb.EJBObject;
+//import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.resource.ResourceException;
-import javax.wsdl.Binding;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
+//import javax.rmi.PortableRemoteObject;
+//import javax.wsdl.Binding;
+//import javax.wsdl.Definition;
+//import javax.wsdl.Port;
+//import javax.wsdl.PortType;
+//import javax.wsdl.Service;
+//import javax.wsdl.extensions.ExtensibilityElement;
+//import javax.wsdl.extensions.soap.SOAPAddress;
+//import javax.wsdl.factory.WSDLFactory;
+//import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
-import javax.xml.ws.Endpoint;
-import org.xml.sax.InputSource;
+//import javax.xml.ws.Endpoint;
+//import org.xml.sax.InputSource;
 
 import org.apache.cxf.Bus;
+//import org.apache.cxf.BusException;
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.jaxws.EndpointImpl;
+//import org.apache.cxf.jaxws.EndpointImpl;
+//import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 //import org.apache.cxf.endpoint.EndpointImpl;
+//import org.apache.cxf.binding.BindingFactoryManager;
+//import org.apache.cxf.binding.soap.SoapBindingFactory;
+//import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.endpoint.Server;
+//import org.apache.cxf.jaxb.JAXBDataBinding;
 //import org.apache.cxf.jaxws.EndpointRegistry;
 import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
 import org.apache.cxf.jca.core.resourceadapter.UriHandlerInit;
-import org.apache.cxf.jca.servant.CXFConnectEJBServant;
-import org.apache.cxf.jca.servant.EJBServant;
-import org.apache.cxf.tools.util.ProcessorUtil;
+//import org.apache.cxf.jca.servant.CXFConnectEJBServant;
+//import org.apache.cxf.jca.servant.EJBServant;
+//import org.apache.cxf.service.Service;
+//import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+//import org.apache.cxf.service.factory.ServerFactoryBean;
+
+//import org.apache.cxf.tools.util.ProcessorUtil;
+//import org.apache.cxf.transport.ConduitInitiatorManager;
+//import org.apache.cxf.transport.DestinationFactoryManager;
+//import org.apache.cxf.transport.http.HTTPTransportFactory;
 //import org.apache.cxf.ws.addressing.EndpointReferenceType;
 //import org.apache.cxf.wsdl.EndpointReferenceUtils;
 
-import org.xmlsoap.schemas.wsdl.http.AddressType;
+//import org.xmlsoap.schemas.wsdl.http.AddressType;
 
 
 public class JCABusFactory {
@@ -71,12 +91,12 @@
 
     private Bus bus;
     private BusFactory bf;
-    private List<Endpoint> servantsCache = new ArrayList<Endpoint>();
+    private List<Object> servantsCache = new ArrayList<Object>();
     private InitialContext jndiContext;
     private ClassLoader appserverClassLoader;
     private ManagedConnectionFactoryImpl mcf;
     private Object raBootstrapContext;
-    private String nameSpace;
+//    private String nameSpace;
 
     public JCABusFactory(ManagedConnectionFactoryImpl aMcf) {
         this.mcf = aMcf;
@@ -94,6 +114,7 @@
     }
 
     protected Bus initBus(ClassLoader loader) throws ResourceException {
+
         try {
             Class busClazz = Class.forName(getBusClassName(), true, loader);
             bf = (org.apache.cxf.BusFactory) busClazz.newInstance();
@@ -115,11 +136,14 @@
         ClassLoader original = Thread.currentThread().getContextClassLoader();
         try {
             ClassLoader cl = this.getClass().getClassLoader();
+
             // ensure resourceadapter: url handler can be found by URLFactory
             Thread.currentThread().setContextClassLoader(cl);
+            //Thread.currentThread().setContextClassLoader(appserverClassLoader);
             //TODO Check for the managed connection factory properties
             //mcf.validateProperties();            
             bus = initBus(cl);
+            //bus = initBus(appserverClassLoader);
             initialiseServants();
         } catch (Exception ex) {
             if (ex instanceof ResourceAdapterInternalException) {
@@ -160,6 +184,7 @@
                        + ne, ne);
         }
 
+        // *** So far CXF can't deregister server and clean up resources, so there have memory
leak problem.
         deregisterServants(bus);
 
         LOG.config("Initialising EJB endpoints...");
@@ -188,47 +213,119 @@
     }
     
     void initialiseServant(String jndiName, String serviceName) throws ResourceException
{
-        Endpoint ei = null;
-        QName serviceQName = null;
+
+        Object servant = null;
+//         EJBObject ejb = null;
+//         QName serviceQName = null;
         String wsdlLocation = "";
-        String portName = "";
+//         String portName = "";
+//         String nameSpace = "";
         if ("".equals(serviceName)) {
             throw new ResourceAdapterInternalException(
                           "A WSDL service QName must be specified as the value of the EJB
JNDI name key: "
                           + jndiName);
         } else {
-            serviceQName = serviceQNameFromString(serviceName);
+//             serviceQName = serviceQNameFromString(serviceName);
+            serviceQNameFromString(serviceName);
+            // Get ejbObject
+//            ejb = getEJBObject(jndiName); 
+
+//             nameSpace = serviceQName.getNamespaceURI();
             wsdlLocation = wsdlLocFromString(serviceName);
             if (wsdlLocation == null) {
-                throw new ResourceAdapterInternalException(
-                          "Service string value:"
-                          + serviceName
-                          + " for key="
-                          + jndiName
-                          + " is incomplete. You must specify wsdl location using the '@'
notation, "
-                          + "eg: jndiName={namespace url}ServiceName@WsdlURL or configure"
-                          + " the relevant bus:" + "initial_contract in configuration");
+//                 servant = publishServantWithoutWSDL(ejb, jndiName, nameSpace);
+            } else {
+                mcf.validateURLString(wsdlLocation,
+                        "WSDL location specified using '@' notation"
+                        + " in service string is invalid, value="
+                        + wsdlLocation);
+//                 portName = portNameFromString(serviceName);
+
             }
         }
-        mcf.validateURLString(wsdlLocation,
-                              "WSDL location specified using '@' notation"
-                              + " in service string is invalid, value="
-                              + wsdlLocation);
-        portName = portNameFromString(serviceName);
-        try {
-            ei = processWSDL(jndiName, serviceQName, wsdlLocation, portName);
-        } catch (Exception e) {
-            throw new ResourceAdapterInternalException("Failed to register EJBServant for
jnidName "
-                                                       + jndiName, e);
-        }
         
         synchronized (servantsCache) {
-            if (ei instanceof Endpoint) {
-                servantsCache.add(ei);
+            if (servant != null) {
+                servantsCache.add(servant);
             }
         }
     }
+    /*
+    private Object publishServantWithoutWSDL (EJBObject ejb, String jndiName, String nameSpace)
{
+        // Get interface of ejbObject
+        String interfaceClassPackage = ProcessorUtil.parsePackageName(nameSpace, null);
+        String interfaceClassString = interfaceClassPackage + "." + portTypeQName.getLocalPart();
+        Class seiClass = Class.forName(interfaceClassString);
+
+        // Added by unreal for simple frontend
+        SoapBindingFactory bindingFactory = new SoapBindingFactory();
+
+        bus.getExtension(BindingFactoryManager.class)
+            .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
+
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        SoapDestinationFactory soapDF = new SoapDestinationFactory(dfm);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
+
+        HTTPTransportFactory httpTransport = new HTTPTransportFactory();
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", httpTransport);
+
+        ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
+        extension.registerConduitInitiator(HTTPTransportFactory.TRANSPORT_ID, httpTransport);
+        extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
+        extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", httpTransport);
+
+        // create service 
+        ReflectionServiceFactoryBean serviceFactory = new ReflectionServiceFactoryBean();
+        serviceFactory.setDataBinding(new JaxBDataBinnding(ejbinterfaceClass));
+        serviceFactory.setBus(bus);
+        serviceFactory.setServiceClass(ejbinterfaceClass);
+        Service service = serviceFactory.create();
+        
+        // set invoker to ejbObject
+        service.setInvoker(new JAXWSMethodInvoker(ejb));
+        
+        // create server 
+        ServerFactoryBean serverFactory = new ServerFactoryBean();
+        
+        serverFactory.setAddress(nameSpace);
+//        serverFactory.setAddress("http://localhost/Hello");
+        serverFactory.setTransportId("http://schemas.xmlsoap.org/soap/");
+        serverFactory.setServiceFactory(serviceFactory);
+        serverFactory.setBus(bus);
+        
+        Server servant = serverFactory.create();
+        return servant;
+    }
+    
+    private EJBObject getEJBObject(String jndi) {
+        try {
+            EJBHome home = getEJBHome(jndiContext, jndi);
+
+//      ejbHomeClassLoader = home.getClass().getClassLoader();
 
+            Method createMethod = home.getClass().getMethod("create", new Class[0]);
+
+            return (EJBObject) createMethod.invoke(home, new Object[0]);
+        } catch (NamingException e) {
+            throw new BusException(e);
+        } catch (NoSuchMethodException e) {
+            throw new BusException(e);
+        } catch (IllegalAccessException e) {
+            throw new BusException(e);
+        } catch (InvocationTargetException itex) {
+            Throwable thrownException = itex.getTargetException();
+            throw new BusException(thrownException);
+        }
+    }
+    
+    protected EJBHome getEJBHome(Context ejbContext, String jndiName) throws NamingException
{
+        Object obj = ejbContext.lookup(jndiName);
+        return (EJBHome) PortableRemoteObject.narrow(obj, EJBHome.class);
+    }
+    
     private Endpoint processWSDL(String jndiName, QName serviceQName, String wsdlLocation,
String portName)
         throws Exception {
         Endpoint ei = null;
@@ -312,7 +409,7 @@
         ei.publish(address);
         return ei;
     }
-    
+    */
     void startPropertiesMonitorThread() throws ResourceException {
         Integer pollIntervalInteger = mcf.getEJBServicePropertiesPollInterval();
         int pollInterval = pollIntervalInteger.intValue();
@@ -354,6 +451,13 @@
 //                     EndpointRegistry er = aBus.getEndpointRegistry();
 //                     er.unregisterEndpoint(ed);
 //                 }
+                Iterator servants = servantsCache.iterator();
+                while (servants.hasNext()) {
+                    Object servant = servants.next();
+                    if (servant instanceof Server) {
+                        ((Server) servant).stop();
+                    }
+                }
                 servantsCache.clear();
             }
         }
@@ -391,6 +495,7 @@
     
     QName serviceQNameFromString(String qns) throws ResourceAdapterInternalException {
         String lp = null;
+        String nameSpace = null;
 
         // String re = "(\[(.*)\])?([^\@]+)(@?(.*))??";
         // String[] qna = qns.split("(\[?+[^\]]*\])([^@])@?+(.*)");

Modified: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionImpl.java?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionImpl.java
(original)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionImpl.java
Wed Oct 25 03:15:47 2006
@@ -21,6 +21,7 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 import java.net.URL;
+//import java.util.Iterator;
 import java.util.logging.Logger;
 
 import javax.resource.NotSupportedException;
@@ -30,6 +31,7 @@
 import javax.resource.spi.ManagedConnectionMetaData;
 import javax.security.auth.Subject;
 import javax.transaction.xa.XAResource;
+//import javax.wsdl.Port;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 import javax.xml.ws.WebServiceException;
@@ -111,6 +113,7 @@
         if (getCXFService() == null) {
             initialiseCXFService(crInfo, subject);
             connection = getCXFService();
+            
         } else {
             if (!connectionHandleActive && this.crinfo.equals(crInfo)) {
                 connection = getCXFService();
@@ -124,12 +127,13 @@
 
     public synchronized Object getCXFServiceFromBus(Subject subject, ConnectionRequestInfo
crInfo)
         throws ResourceException {
+
         CXFConnectionRequestInfo arReqInfo = (CXFConnectionRequestInfo)crInfo;
         ClassLoader orig = Thread.currentThread().getContextClassLoader();
 
-        Bus bus = getBus();
+//         Bus bus = getBus();
 
-        Thread.currentThread().setContextClassLoader(bus.getClass().getClassLoader());
+        //Thread.currentThread().setContextClassLoader(bus.getClass().getClassLoader());
 
         QName serviceName = arReqInfo.getServiceQName();
         URL wsdlLocationUrl = arReqInfo.getWsdlLocationUrl();
@@ -138,6 +142,7 @@
             try {
                 Object obj = null;
                 Service service = Service.create(serviceName);
+            
                 obj = service.getPort(arReqInfo.getInterface());
                 setSubject(subject);
                 return createConnectionProxy(obj, arReqInfo, subject);
@@ -145,7 +150,7 @@
                 throw new ResourceAdapterInternalException("Failed to create proxy client
for service "
                                                            + crInfo, wse);
             } finally {
-                Thread.currentThread().setContextClassLoader(orig);
+//                Thread.currentThread().setContextClassLoader(orig);
             }
 
         }
@@ -153,9 +158,8 @@
         try {
             Object obj = null;
             Service service = Service.create(wsdlLocationUrl, serviceName);
-            if (arReqInfo.getPortQName() != null) {                                
+            if (arReqInfo.getPortQName() != null) {                
                 obj = service.getPort(arReqInfo.getPortQName(), arReqInfo.getInterface());
-               
             } else {
                 obj = service.getPort(arReqInfo.getInterface());
                 //obj = bus.createClient(wsdlLocationUrl, serviceName, arReqInfo.getInterface());

Modified: incubator/cxf/trunk/jca/src/main/rar/META-INF/ra.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/rar/META-INF/ra.xml?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/main/rar/META-INF/ra.xml (original)
+++ incubator/cxf/trunk/jca/src/main/rar/META-INF/ra.xml Wed Oct 25 03:15:47 2006
@@ -17,6 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
+
 <connector xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
@@ -24,11 +25,15 @@
   <display-name>CXFConnector</display-name>
   <vendor-name>Apache</vendor-name>
   <eis-type>CXF</eis-type>
-  <resourceadapter-version>2.0</resourceadapter-version>
+  <resourceadapter-version>1.0</resourceadapter-version>
   <license>
     <license-required>false</license-required>
   </license>
   <resourceadapter>
+    <!--
+    <connectionfactory-interface>org.apache.cxf.connector.CXFConnectionFactory</connectionfactory-interface>
+    <connection-interface>org.apache.cxf.connector.Connection</connection-interface>
+    -->
     <resourceadapter-class>org.apache.cxf.jca.cxf.ResourceAdapterImpl</resourceadapter-class>
     <outbound-resourceadapter>
       <connection-definition>
@@ -36,7 +41,7 @@
         <config-property>
           <config-property-name>LogLevel</config-property-name> 
           <config-property-type>java.lang.String</config-property-type> 
-          <config-property-value>WARNING</config-property-value> 
+          <config-property-value>INFO</config-property-value> 
         </config-property> 
         <config-property>
           <config-property-name>ConfigurationDomain</config-property-name> 
@@ -63,7 +68,7 @@
           <config-property-type>java.lang.Integer</config-property-type>
           <config-property-value>30</config-property-value>
         </config-property>
-        <connectionfactory-interface>org.apache.cxf.connector.CxfConnectionFactory</connectionfactory-interface>
+        <connectionfactory-interface>org.apache.cxf.connector.CXFConnectionFactory</connectionfactory-interface>
         <connectionfactory-impl-class>org.apache.cxf.jca.cxf.ConnectionFactoryImpl</connectionfactory-impl-class>
         <connection-interface>org.apache.cxf.connector.Connection</connection-interface>
         <connection-impl-class>org.apache.cxf.jca.cxf.ManagedConnectionImpl</connection-impl-class>

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalExceptionTest.java?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalExceptionTest.java
(original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/core/resourceadapter/ResourceAdapterInternalExceptionTest.java
Wed Oct 25 03:15:47 2006
@@ -126,6 +126,7 @@
         assertEquals(re.getCause(), cause);
     }
 
+    /*
     public void testGetLinkedExceptionReturnNullIfNoCause() throws Exception {
         ResourceAdapterInternalException re = new ResourceAdapterInternalException("ex");
         assertNull("getLinkedException return null", re.getLinkedException());
@@ -142,4 +143,5 @@
         ResourceAdapterInternalException re = new ResourceAdapterInternalException("ex",
cause);
         assertEquals("get same exception", cause, re.getLinkedException());
     }
+    */
 }

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java?view=diff&rev=467598&r1=467597&r2=467598
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java (original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java Wed
Oct 25 03:15:47 2006
@@ -346,23 +346,23 @@
 //         }
 //     }
 
-    public void testInitServantsFromPropertiesWithMissingWsdlLocInPropertiesAndConfig() throws
Exception {
-        ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
-        Bus mockBus = EasyMock.createMock(Bus.class);
-        jcaBusFactory.setBus(mockBus);
-        final String jndiName = "/a/b";
-        try {
-            Properties props = new Properties();
-            props.put(jndiName, "{http://ns}ServiceA");
-            jcaBusFactory.initialiseServantsFromProperties(props, true);
-            fail("expect ex on missing wsdl loc");
-        } catch (ResourceException expected) {
-            assertTrue("reasonable message", expected.toString().indexOf(jndiName) != -1);
-            assertTrue(expected instanceof ResourceAdapterInternalException);
-            assertTrue(expected.getMessage().indexOf("ServiceA") != -1);
-        }
-    }
+//     public void testInitServantsFromPropertiesWithMissingWsdlLocInPropertiesAndConfig()
throws Exception {
+//         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
+//         JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
+//         Bus mockBus = EasyMock.createMock(Bus.class);
+//         jcaBusFactory.setBus(mockBus);
+//         final String jndiName = "/a/b";
+//         try {
+//             Properties props = new Properties();
+//             props.put(jndiName, "{http://ns}ServiceA");
+//             jcaBusFactory.initialiseServantsFromProperties(props, true);
+//             fail("expect ex on missing wsdl loc");
+//         } catch (ResourceException expected) {
+//             assertTrue("reasonable message", expected.toString().indexOf(jndiName) !=
-1);
+//             assertTrue(expected instanceof ResourceAdapterInternalException);
+//             assertTrue(expected.getMessage().indexOf("ServiceA") != -1);
+//         }
+//     }
      
     public void testInitServantsFromPropertiesWithNoServiceQName() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();



Mime
View raw message