You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2006/11/08 10:48:48 UTC

svn commit: r472440 - in /incubator/cxf/trunk: distribution/src/main/assembly/ distribution/src/main/release/samples/j2ee/jca/inbound/ distribution/src/main/release/samples/j2ee/jca/inbound/etc/ distribution/src/main/release/samples/j2ee/jca/inbound/sr...

Author: ningjiang
Date: Wed Nov  8 01:48:47 2006
New Revision: 472440

URL: http://svn.apache.org/viewvc?view=rev&rev=472440
Log:
[CXF_80] Applied Unreal's patch for jca inbind

Added:
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java   (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/
    incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml   (with props)
Modified:
    incubator/cxf/trunk/distribution/src/main/assembly/bin.xml
    incubator/cxf/trunk/jca/pom.xml
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java

Modified: incubator/cxf/trunk/distribution/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/assembly/bin.xml?view=diff&rev=472440&r1=472439&r2=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/assembly/bin.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/assembly/bin.xml Wed Nov  8 01:48:47 2006
@@ -49,6 +49,7 @@
 	     <includes>
 	         <include>logging.properties</include>
 		 <include>log4j.properties</include>
+		 <include>ejb_servants.properties</include>
                  <include>web.xml</include>
 	     </includes>
 	 </fileSet>

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+
+<project name="Inbound Connection Demo" default="build" basedir=".">
+
+    <property name="demos.current.dir" value="."/>
+    <property name="build.classes.dir" value="${basedir}/build"/>
+    <property name="cxf.home" value="../../../.."/>
+    <property name="wsdl.dir" value="${basedir}/wsdl"/>
+    <property name="wsdl.location" value="${basedir}/wsdl/hello_world.wsdl"/>
+    <property name="build.archives" value="${basedir}/j2ee-archives"/> 
+    <property name="ejb.xml" location="./etc/ejb.xml"/>
+    
+    <property name="j2ee.resources.dir" location="${basedir}/../common/resources"/>
+    <property name="servants.props.file" location="${basedir}/../../../../etc/ejb_servants.properties"/>
+    <property file="${servants.props.file}"/>
+    <property name="j2ee.archives" value="j2ee-archives"/>
+
+ 
+    <path id="other.classpath">
+      <pathelement location="${basedir}/../../../../lib/geronimo-j2ee-connector_1.5_spec-1.0.1.jar"/>
+      <pathelement location="${basedir}/../../../../lib/geronimo-ejb_2.1_spec-1.0.1.jar"/>
+      <pathelement location="${repository}/javax/xml/jaxws-api/2.0-JAXWS-2.0-EA3/jaxws-api-2.0-JAXWS-2.0-EA3.jar"/>
+      <pathelement location="${basedir}/../../../../lib/jsr181-api-2.0-JAXWS-2.0-EA3.jar"/>
+    </path>
+    
+
+    <target name="build" depends="clean,init,j2ee.compile,build.ejb.jar"/> 
+
+    <target name="init"> 
+      <mkdir dir="${build.classes.dir}"/>
+      <mkdir dir="${j2ee.archives}"/>
+    </target>
+    
+    <target name="j2ee.compile">
+      <javac srcdir="${basedir}/src" destdir="${build.classes.dir}" debug="true" fork="yes">
+	<include name="**/*.java"/>
+	<classpath>
+	  <pathelement location="${cxf.home}/lib/cxf-incubator.jar"/>
+	  <pathelement location="${build.classes.dir}"/>
+	  <!--path refid="cxf.classpath"/-->
+	  <path refid="other.classpath"/>
+	</classpath>
+      </javac>
+    </target>
+    <target name="clean">
+      <delete failonerror="no">
+	<fileset dir="./src" includes="**/*.class"/>
+	<fileset dir="." includes="**/*.jar"/>
+	<fileset dir="." includes="**/*.rar"/>
+      </delete>
+    </target>
+    
+    <target name="build.ejb.jar"> 
+      <jar destfile="${j2ee.archives}/greeterejb.jar"> 
+	<metainf dir="./etc"> 
+	    <include name="*ejb*.xml"/>
+	</metainf>
+	<fileset dir="${build.classes.dir}/" includes="org/**/*.class"/>
+	<fileset dir="${build.classes.dir}">
+	  <include name="**/ejb/*.class"/>
+	</fileset>
+      </jar>
+    </target> 
+
+    <!-- 
+	 this target appends the necessary entry to ejb_servants.properties 
+	 to activate the web services facade for the greeterejb.jar application.
+    -->
+    <target name="activate" description="updates ejb_servants.properties for demo " unless="GreeterBean">
+      <property name="servant.definition" 
+		value="GreeterBean={http://apache.org/hello_world_soap_http}Greeter@file:"/>
+      <echo message="updating ${servants.props.file}" />
+
+      <echo file="${servants.props.file}" append="true">
+	# entry for the j2ee inbound demo
+	${servant.definition}
+      </echo>
+      <replace file="${servants.props.file}" token="\" value="/"/> 
+    </target>
+
+    <target name="client"> 
+      <java classname="demo.client.GreeterClient" fork="true"> 
+	<arg value="${wsdl.location}"/> 
+	<classpath> 
+	  <pathelement location="${build.classes.dir}"/>
+	  <pathelement path="../../../../lib/cxf.jar"/>
+	</classpath>
+      </java> 
+    </target> 
+</project>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<!DOCTYPE connection-factories
+    PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+<connection-factories>
+  <no-tx-connection-factory>
+    <jndi-name>CXFConnector</jndi-name>
+    <rar-name>cxf.rar</rar-name>
+    <connection-definition>org.apache.cxf.connector.CXFConnectionFactory</connection-definition>
+  </no-tx-connection-factory>
+</connection-factories>
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/cxfj2ee_1_5-ds.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE ejb-jar PUBLIC 
+'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 
+'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
+
+<ejb-jar>
+    <enterprise-beans>
+      <session>
+	<ejb-name>GreeterBean</ejb-name>
+	<home>demo.ejb.GreeterHome</home>
+	<remote>demo.ejb.GreeterRemote</remote>
+	<ejb-class>demo.ejb.GreeterBean</ejb-class>
+	<session-type>Stateless</session-type>
+	<transaction-type>Container</transaction-type>
+      </session>
+    </enterprise-beans>
+
+    <assembly-descriptor>
+    <method-permission>
+      <unchecked/>
+      <method>
+	<ejb-name>GreeterBean</ejb-name>
+	<method-name>*</method-name>
+      </method>
+    </method-permission>
+      <container-transaction>
+	<description/>
+	<method>
+	  <description/>
+	  <ejb-name>GreeterBean</ejb-name>
+	  <method-name>*</method-name>
+	</method>
+	<trans-attribute>Supports</trans-attribute>
+      </container-transaction>
+    </assembly-descriptor>
+</ejb-jar>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/ejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,25 @@
+<!--
+  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.
+-->
+<jboss-web>
+  <resource-ref>
+    <res-ref-name>eis/CXFConnector</res-ref-name>
+    <res-type>org.apache.cxf.connector.CXFConnectionFactory</res-type>
+    <jndi-name>java:/CXFConnector</jndi-name>
+  </resource-ref>
+</jboss-web>
\ No newline at end of file

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/jboss-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+
+<jboss-ejb-jar>
+
+   <jboss-enterprise-bean>
+      <ejb-name>GreeterBean</ejb-name>
+      <jndi-name>GreeterBean</jndi-name>
+   </jboss-enterprise-bean>
+
+</jboss-ejb-jar>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/etc/weblogic-ejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,58 @@
+/**
+ * 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 demo.client;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import javax.xml.namespace.QName;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.jaxws.ServiceImpl;
+
+/**
+ * validate call to ejb in jboss from command line
+ */
+public final class GreeterClient {
+
+    public static void main(String[] args) throws Exception {
+        Bus bus = new SpringBusFactory().getDefaultBus();
+        QName serviceQName = new QName("http://apache.org/hello_world_soap_http", "Greeter");
+        QName portQName = new QName("http://apache.org/hello_world_soap_http", "HelloPort");
+        String bindingId = "http://schemas.xmlsoap.org/soap/";
+
+        String hostName = "";
+        try {
+            InetAddress addr = InetAddress.getLocalHost();
+            //hostName = addr.getHostName();
+            hostName = addr.getCanonicalHostName();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
+        
+        String address = "http://" + hostName + ":9999/Greeter";
+
+        ServiceImpl ss = new ServiceImpl(bus, null, serviceQName, null);
+        ss.addPort(portQName, bindingId, address);
+        //Hello port = ss.createPort(portQName, Hello.class);
+        org.apache.hello_world_soap_http.Greeter port = ss.getPort(portQName, org.apache.hello_world_soap_http.Greeter.class);
+        String response = port.greetMe(" CXF");
+        System.out.println(" server return: " + response);
+    }
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/client/GreeterClient.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,58 @@
+/**
+ * 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 demo.ejb;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+
+public class GreeterBean implements SessionBean {
+
+    private SessionContext sessionCtx;
+    private String response = "";
+
+    public String sayHi() throws RemoteException {
+        System.out.println("sayHi invoked");
+        return "Hi from an EJB"; 
+    }
+
+    public String greetMe(String user) throws RemoteException {
+        System.out.println("greetMe invoked user:" + user);
+        return "Hi " + user + " from an EJB"; 
+    }
+
+    public void ejbActivate() {
+    }
+    
+    public void ejbRemove() {
+    }
+    
+    public void ejbPassivate() {
+    }
+    
+    public void ejbCreate() throws CreateException {
+    }
+    
+    public void setSessionContext(SessionContext con) {
+        this.sessionCtx = con;
+    }
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,30 @@
+/**
+ * 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 demo.ejb;
+
+import java.rmi.RemoteException;
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+//import org.objectweb.hello_world_soap_http.Greeter;
+
+
+public interface GreeterHome extends EJBHome {
+    GreeterRemote create() throws CreateException, RemoteException;
+}
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterHome.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,27 @@
+/**
+ * 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 demo.ejb;
+
+import javax.ejb.EJBObject;
+import org.apache.hello_world_soap_http.Greeter;
+
+public interface GreeterRemote extends EJBObject, Greeter {
+}
+
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/ejb/GreeterRemote.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java (added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.hello_world_soap_http;
+
+
+import java.rmi.RemoteException;
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+
+@WebService
+public interface Greeter {
+
+    @WebMethod
+    String sayHi() throws RemoteException;
+    @WebMethod
+    String greetMe(String user) throws RemoteException;
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/j2ee/jca/inbound/src/demo/org/apache/hello_world_soap_http/Greeter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/jca/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/pom.xml?view=diff&rev=472440&r1=472439&r2=472440
==============================================================================
--- incubator/cxf/trunk/jca/pom.xml (original)
+++ incubator/cxf/trunk/jca/pom.xml Wed Nov  8 01:48:47 2006
@@ -80,6 +80,12 @@
 
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-simple</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-tools-common</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -88,6 +94,13 @@
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http</artifactId>
             <version>${project.version}</version>
+        </dependency>
+
+         <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-local</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
 
         <dependency>

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=472440&r1=472439&r2=472440
==============================================================================
--- 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 Nov  8 01:48:47 2006
@@ -21,27 +21,30 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-//import java.lang.reflect.Method;
-//import java.lang.reflect.InvocationTargetException;
-//import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 //import java.lang.reflect.Proxy;
+import java.net.InetAddress;
 import java.net.URL;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashMap;
 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.ejb.EJBHome;
+import javax.ejb.EJBObject;
+import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.resource.ResourceException;
-//import javax.rmi.PortableRemoteObject;
+import javax.rmi.PortableRemoteObject;
 //import javax.wsdl.Binding;
 //import javax.wsdl.Definition;
 //import javax.wsdl.Port;
@@ -51,36 +54,51 @@
 //import javax.wsdl.extensions.soap.SOAPAddress;
 //import javax.wsdl.factory.WSDLFactory;
 //import javax.wsdl.xml.WSDLReader;
+import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 //import javax.xml.ws.Endpoint;
 //import org.xml.sax.InputSource;
 
 import org.apache.cxf.Bus;
-//import org.apache.cxf.BusException;
+import org.apache.cxf.BusException;
 import org.apache.cxf.BusFactory;
 //import org.apache.cxf.jaxws.EndpointImpl;
-//import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.SoapBindingFactory;
+import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.common.util.PackageUtils;
+//import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 //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.jaxb.JAXBDataBinding;
+import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 //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.service.Service;
-//import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-//import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.Service;
+//import org.apache.cxf.service.factory.HelloService;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.service.factory.ServerFactoryBean;
+//import org.apache.cxf.service.model.InterfaceInfo;
 
 //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.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.WSDLManagerImpl;
+//import org.apache.cxf.transport.local.LocalTransportFactory;
+//import org.apache.cxf.transport.local.LocalTransportFactory;
 //import org.apache.cxf.ws.addressing.EndpointReferenceType;
 //import org.apache.cxf.wsdl.EndpointReferenceUtils;
+//import org.apache.cxf.wsdl.WSDLManager;
+//import org.apache.cxf.wsdl11.WSDLManagerImpl;
 
 //import org.xmlsoap.schemas.wsdl.http.AddressType;
 
@@ -113,15 +131,11 @@
         return busArgs;
     }
 
-    protected Bus initBus(ClassLoader loader) throws ResourceException {
-
+    protected Bus createBus(ClassLoader loader) throws ResourceException {
         try {
             Class busClazz = Class.forName(getBusClassName(), true, loader);
             bf = (org.apache.cxf.BusFactory) busClazz.newInstance();
             bus = bf.getDefaultBus();
-//             Method method = busClazz.getMethod("init", String[].class);            
-//             bus = (Bus)method.invoke(null, new Object[] {getBusArgs()});
-//             LOG.config("initialize complete, bus=" + bus);
         } catch (Exception ex) {
             throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
         }
@@ -129,6 +143,40 @@
         return bus;
     }
     
+    protected void initBus() throws ResourceException {
+        try {
+            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();
+            soapDF.setBus(bus);
+            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/http", httpTransport);
+            //dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
+            //dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", httpTransport);
+
+            ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
+            //extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, httpTransport);
+            extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", httpTransport);
+            extension.registerConduitInitiator("http://schemas.xmlsoap.org/http/http", httpTransport);
+            //extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", httpTransport);
+            
+            bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
+
+        } catch (Exception ex) {
+//            throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
+            throw new ResourceAdapterInternalException("Failed to initialize cxf runtime", ex);
+        }
+    }
+    
+
+    
     protected synchronized void init() throws ResourceException {
         LOG.config("initialising... the bus");
         new UriHandlerInit();
@@ -141,14 +189,17 @@
             Thread.currentThread().setContextClassLoader(cl);
             //Thread.currentThread().setContextClassLoader(appserverClassLoader);
             //TODO Check for the managed connection factory properties
-            //mcf.validateProperties();            
-            bus = initBus(cl);
+            //mcf.validateProperties();     
+            bus = createBus(cl);
+            initBus();
             //bus = initBus(appserverClassLoader);
+
             initialiseServants();
         } catch (Exception ex) {
             if (ex instanceof ResourceAdapterInternalException) {
                 throw (ResourceException)ex;
             } else {
+                ex.printStackTrace();
                 throw new ResourceAdapterInternalException("Failed to initialize connector runtime", ex);
             }
         } finally {
@@ -171,7 +222,6 @@
     
     void initialiseServantsFromProperties(Properties ejbServants, boolean abortOnFailure)
         throws ResourceException {
-
         // Props format: jndi name = service string
         //
         // java:/ejbs/A={http:/a/b/b}SoapService@http://localost:wsdls/a.wsdl
@@ -184,7 +234,6 @@
                        + 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...");
@@ -197,8 +246,7 @@
             LOG.config("Found ejb endpoint: jndi name=" + jndiName + ", wsdl service=" + serviceName);
             
             try {
-                initialiseServant(jndiName, serviceName);
-                
+                initialiseServant(jndiName, serviceName);      
             } catch (ResourceException re) {
                 LOG.warning("Error initialising servant with jndi name " 
                             + jndiName + " and service name "
@@ -207,7 +255,6 @@
                 if (abortOnFailure) {
                     throw re;
                 }
-
             }
         }
     }
@@ -215,92 +262,126 @@
     void initialiseServant(String jndiName, String serviceName) throws ResourceException {
 
         Object servant = null;
-//         EJBObject ejb = null;
-//         QName serviceQName = null;
-        String wsdlLocation = "";
-//         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);
-            serviceQNameFromString(serviceName);
-            // Get ejbObject
-//            ejb = getEJBObject(jndiName); 
-
-//             nameSpace = serviceQName.getNamespaceURI();
-            wsdlLocation = wsdlLocFromString(serviceName);
-            if (wsdlLocation == null) {
-//                 servant = publishServantWithoutWSDL(ejb, jndiName, nameSpace);
+        EJBObject ejb = null;
+        QName serviceQName = null;
+//        String wsdlLocation = "";
+//        String portName = "";
+        String nameSpace = "";
+        String interfaceName = "";
+        String packageName = "";
+        Class interfaceClass = null;
+        ClassLoader ejbClassLoader = null;
+        ClassLoader currentThreadContextClassLoader = null;
+        try {
+            if ("".equals(serviceName)) {
+                throw new ResourceAdapterInternalException(
+                              "A WSDL service QName must be specified as the value of the EJB JNDI name key: "
+                              + jndiName);
             } else {
-                mcf.validateURLString(wsdlLocation,
-                        "WSDL location specified using '@' notation"
-                        + " in service string is invalid, value="
-                        + wsdlLocation);
-//                 portName = portNameFromString(serviceName);
+                serviceQName = serviceQNameFromString(serviceName);
+
+                serviceQNameFromString(serviceName);
+
+                // so far inbound doesn't support wsdl file
+//                wsdlLocation = wsdlLocFromString(serviceName);
+                
+                // Get ejbObject
+                ejb = getEJBObject(jndiName); 
+                ejbClassLoader = ejb.getClass().getClassLoader();
+
+                currentThreadContextClassLoader = Thread.currentThread().getContextClassLoader();
+                Thread.currentThread().setContextClassLoader(ejbClassLoader);
+ 
+                
+                Thread.currentThread().setContextClassLoader(currentThreadContextClassLoader);
+
+                nameSpace = serviceQName.getNamespaceURI();
+                packageName = PackageUtils.parsePackageName(nameSpace, null);
+                
+                // Get interface of ejbObject
+                interfaceName = jndiName.substring(0, jndiName.length() - 4);
+                interfaceName = packageName + "." + interfaceName;
+
+                interfaceClass = Class.forName(interfaceName);
+
 
+
+
+//                if (wsdlLocation == null) {
+                // process service with simple frontend
+                servant = publishServantWithoutWSDL(ejb, jndiName, nameSpace, interfaceClass);
+//                } else {
+                // process service with jax-ws frontend
+//                }        
+//            } else {
+//                mcf.validateURLString(wsdlLocation,
+//                        "WSDL location specified using '@' notation"
+//                        + " in service string is invalid, value="
+//                        + wsdlLocation);
+//                 portName = portNameFromString(serviceName);
+//            }
             }
+        } catch (Exception e) {
+            throw new ResourceAdapterInternalException(e.getMessage());
         }
-        
         synchronized (servantsCache) {
             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();
+    
+    public Object publishServantWithoutWSDL(EJBObject ejb, String jndiName,
+                                            String nameSpace, Class interfaceClass) 
+        throws Exception {
+
+        String hostName = "";
+        try {
+            InetAddress addr = InetAddress.getLocalHost();
+            //hostName = addr.getHostName();
+            hostName = addr.getCanonicalHostName();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
+        String address = "http://" + hostName + ":9999/" + jndiName;
+
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        Service service = createService(interfaceClass, bean);
         
-        // set invoker to ejbObject
         service.setInvoker(new JAXWSMethodInvoker(ejb));
+
+        ServerFactoryBean svrFactory = new ServerFactoryBean();
+
+        return createServer(svrFactory, bean, address);
+
         
-        // create server 
-        ServerFactoryBean serverFactory = new ServerFactoryBean();
+    }
+
+    protected Service createService(Class interfaceClass, ReflectionServiceFactoryBean serviceFactory) 
+        throws JAXBException {
+        serviceFactory.setDataBinding(new JAXBDataBinding());
+        serviceFactory.setBus(bus);
+        serviceFactory.setServiceClass(interfaceClass);
         
-        serverFactory.setAddress(nameSpace);
-//        serverFactory.setAddress("http://localhost/Hello");
-        serverFactory.setTransportId("http://schemas.xmlsoap.org/soap/");
-        serverFactory.setServiceFactory(serviceFactory);
-        serverFactory.setBus(bus);
+        Map<String, Object> props = new HashMap<String, Object>();
+        props.put("test", "test");
+        serviceFactory.setProperties(props);
         
-        Server servant = serverFactory.create();
-        return servant;
+        return serviceFactory.create();
     }
     
-    private EJBObject getEJBObject(String jndi) {
+    protected Server createServer(ServerFactoryBean serverFactory, 
+                                  ReflectionServiceFactoryBean serviceFactory, 
+                                  String address) {
+        serverFactory.setAddress(address);
+        serverFactory.setTransportId("http://schemas.xmlsoap.org/soap/http");
+        serverFactory.setServiceFactory(serviceFactory);
+        serverFactory.setBus(bus);
+
+        return serverFactory.create();
+    }
+   
+    private EJBObject getEJBObject(String jndi) throws BusException {
         try {
             EJBHome home = getEJBHome(jndiContext, jndi);
 
@@ -325,91 +406,7 @@
         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;
-//         System.out.println("************************************************");
-//         System.out.println("              jndiName: " + jndiName);
-//         System.out.println("              serviceQName: " + serviceQName.toString());
-//         System.out.println("              wsdlLocation: " + wsdlLocation);
-//         System.out.println("              portName: " + portName);
-//         System.out.println("************************************************");
-        URL wsdlUrl = new URL(wsdlLocation);
-        WSDLFactory factory = WSDLFactory.newInstance();
-        WSDLReader reader = factory.newWSDLReader();
-        reader.setFeature("javax.wsdl.verbose", false);
-        InputSource input = new InputSource(wsdlUrl.openStream());
-        Definition wsdlDef = reader.readWSDL(wsdlUrl.toString(), input);
-            
-        // get service and port from wsdl definition
-        Service wsdlService = wsdlDef.getService(serviceQName);      
-
-        Port port = null;
-        if (portName == null) {
-            Map ports = wsdlService.getPorts();
-            Iterator it = ports.values().iterator();
-            if (it.hasNext()) {
-                port = (Port) it.next();
-                portName = port.getName();
-            }
-        } else {
-            port = wsdlService.getPort(portName);
-        }
-        
-        // get bindingId from wsdl definition
-        String bindingId = null;
-        Binding binding = port.getBinding();
-        if (null != binding) {            
-            List list = binding.getExtensibilityElements();
-            if (!list.isEmpty()) {
-                bindingId = ((ExtensibilityElement) list.get(0)).getElementType().getNamespaceURI();
-            }
-        }
-        PortType pt = binding.getPortType();
-        QName portTypeQName = pt.getQName();
-        // get address
-        String address = "";
-        List<?> list = port.getExtensibilityElements();
-        for (Object ep : list) {
-            ExtensibilityElement ext = (ExtensibilityElement) ep;
-            if (ext instanceof SOAPAddress) {
-                if (bindingId == null) {
-                    bindingId = ((SOAPAddress) ext).getLocationURI();
-                }
-                address = ((SOAPAddress) ext).getLocationURI();
-            }
-            if (ext instanceof AddressType) {
-                if (bindingId == null) {
-                    bindingId = ((AddressType) ext).getLocation();
-                }
-                address = ((AddressType) ext).getLocation();
-            }
-        }
-        
-//         EndpointReferenceType ref = EndpointReferenceUtils.getEndpointReference(wsdlUrl,
-//                                                                                 serviceQName,
-//                                                                                 portName);
-
-        EJBServant servant = new CXFConnectEJBServant(this, wsdlLocation, jndiName, null);
 
-        servant.getTargetObject();
-        
-        String interfaceClassPackage = ProcessorUtil.parsePackageName(nameSpace, null);
-        String interfaceClassString = interfaceClassPackage + "." + portTypeQName.getLocalPart();
-        Class seiClass = Class.forName(interfaceClassString);
-        Class[] proxyInterfaces = new Class[] {seiClass};
-
-        Object fimpl = Proxy.newProxyInstance(seiClass.getClassLoader(),
-                                              proxyInterfaces,
-                                              servant);
-
-//         ei = new EndpointImpl(bus, fimpl, bindingId, ref);
-        ei = new EndpointImpl(bus, fimpl, bindingId);
-        ei.publish(address);
-        return ei;
-    }
-    */
     void startPropertiesMonitorThread() throws ResourceException {
         Integer pollIntervalInteger = mcf.getEJBServicePropertiesPollInterval();
         int pollInterval = pollIntervalInteger.intValue();

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,32 @@
+/**
+ * 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.cxf.jca.cxf;
+
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService()
+//@WebService
+
+public interface HelloInterface {
+
+    @WebMethod
+    String sayHi(String s);
+}

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/HelloInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java Wed Nov  8 01:48:47 2006
@@ -0,0 +1,33 @@
+/**
+ * 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.cxf.jca.cxf;
+
+
+import javax.jws.WebService;
+
+
+
+@WebService
+public class Imple implements HelloInterface {
+    
+    
+    public String sayHi(String s) {
+        return "hello world ." + s;
+    }
+}

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/Imple.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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=472440&r1=472439&r2=472440
==============================================================================
--- 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 Nov  8 01:48:47 2006
@@ -21,7 +21,7 @@
 
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.net.MalformedURLException;
+//import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Properties;
 // import java.util.ResourceBundle;
@@ -29,26 +29,49 @@
 import javax.resource.ResourceException;
 import javax.xml.namespace.QName;
 
+import org.w3c.dom.Node;
+
 import junit.framework.Test;
-import junit.framework.TestCase;
+//import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
-
 import org.apache.cxf.Bus;
 // import org.apache.cxf.BusException;
 // import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.SoapBindingFactory;
+import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.WSDLManagerImpl;
 // import org.apache.cxf.jca.cxf.test.DummyBus;
 import org.easymock.classextension.EasyMock;
 
-public class JCABusFactoryTest extends TestCase {
+public class JCABusFactoryTest extends AbstractCXFTest {
    
-    public JCABusFactoryTest(String name) {
-        super(name);
-    }
+    private Bus bus;
+    
+//    public JCABusFactoryTest(String name) {
+//        super(name);
+//    }
 
-   
+    public void setUp() throws Exception {
+        super.setUp();
+        
+        bus = getBus();
+    }
+    
     public void testSetAppserverClassLoader() {
         ClassLoader loader = new DummyClassLoader();
         JCABusFactory bf = new JCABusFactory(new ManagedConnectionFactoryImpl());
@@ -299,6 +322,72 @@
         jcaBusFactory.initialiseServants();
         
     }
+    
+    public void testCreateService() throws Exception {
+        Bus springBus = new SpringBusFactory().createBus();
+        
+        JCABusFactory jcaBusFactory = new JCABusFactory(null);
+        jcaBusFactory.setBus(springBus);
+        jcaBusFactory.initBus();
+        
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        Service service = jcaBusFactory.createService(HelloInterface.class, bean);
+        assertEquals("test", service.get("test"));
+    }
+
+    public void testCreateServer() throws Exception {
+        //Bus springBus = new SpringBusFactory().createBus();
+        
+        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();
+        soapDF.setBus(bus);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
+        
+        LocalTransportFactory localTransport = new LocalTransportFactory();
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
+        dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
+        dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);
+
+        ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
+        extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
+        extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", localTransport);
+        extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
+        extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", localTransport);
+        
+        bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
+
+        
+        JCABusFactory jcaBusFactory = new JCABusFactory(null);
+        jcaBusFactory.setBus(bus);
+        jcaBusFactory.initBus();
+        
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        Service service = jcaBusFactory.createService(HelloInterface.class, bean);
+        assertEquals("test", service.get("test"));
+        
+        Imple im = new Imple();
+        
+        service.setInvoker(new JAXWSMethodInvoker(im));
+
+        ServerFactoryBean svrFactory = new ServerFactoryBean();
+
+        String address = "http://localhost:9999/Hello";
+        Server server = jcaBusFactory.createServer(svrFactory, bean, address);
+        assertNotNull("The server should not be null", server);
+        
+        Node res = invoke("http://localhost:9999/Hello", 
+                          LocalTransportFactory.TRANSPORT_ID,
+                          "sayHi.xml");
+        assertNotNull("We should get the result ", res);
+    }
+  
     /*
     public void testAddServantsCache() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
@@ -367,8 +456,8 @@
     public void testInitServantsFromPropertiesWithNoServiceQName() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
-        Bus bus = EasyMock.createMock(Bus.class);
-        jcaBusFactory.setBus(bus);
+        Bus mockBus = EasyMock.createMock(Bus.class);
+        jcaBusFactory.setBus(mockBus);
         final String jndiName = "/a/b";
         try {
             Properties props = new Properties();
@@ -380,10 +469,12 @@
         }
     }
 
+/*  so far doesn't support wsdl file  
     public void testInitFromPropsWithInvalidWsdlLocUrls() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
 
+      
         try {
             Properties props = new Properties();
             props.put("/a/b", "{http://ns}ServiceA@unknownprotocol:/a");
@@ -421,7 +512,7 @@
         }
           
     }
-
+*/
     
     public void testInitFromPropsDoesNotThrowExceptionWhenSomethingGoesWrong() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml?view=auto&rev=472440
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml Wed Nov  8 01:48:47 2006
@@ -0,0 +1,26 @@
+<!--
+  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.
+-->
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+	<soap:Body>
+	<sayHi xmlns="http://service.jaxws.cxf.apache.org">
+		<text>hi</text>
+	</sayHi>
+	</soap:Body>
+
+</soap:Envelope>
\ No newline at end of file

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/sayHi.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml