You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by jpmad4it <jp...@fortvale.com> on 2009/02/05 17:38:02 UTC

Re: Tomcat and openEJB - how to do this simple config?

Can anyone help, I'm still struggling with this??



EDIT: I think I managed to call the Calculator web service through PHP. I
used the script soap.php:

<?php
$client = new SoapClient("http://ww3.mysite.com/Calculator?wsdl");
var_dump($client->__getTypes());
?>

When I access soap.php in the browser I get:

array(4) { [0]=> string(41) "struct multiply { int arg0; int arg1; }" [1]=>
string(40) "struct multiplyResponse { int return; }" [2]=> string(36)
"struct sum { int arg0; int arg1; }" [3]=> string(35) "struct sumResponse {
int return; }" } 

So I think that it has successfully called the service and grabbed the types
from it? I don't know how to code the PHP to actually do a simple addition
though.

Maybe I should start to think about getting a service setup for the MySQL
database?

EDIT2: I am now trying to setup the injection-of-datasource example, I've
changed the test java file so that its correct for my mysql database, but
during "mvn clean install" the process fails, saying it cannot find the jdbc
driver com.mysql.jdbc.Driver. The mysql-connector/J.jar is in my tomcat/lib
folder: 

lin003:/home/tomcat/webapps/injection-of-datasource # mvn clean install
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building OpenEJB :: Examples :: @Resource DataSource Injection
[INFO]    task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
/home/tomcat/webapps/injection-of-datasource/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading:
http://people.apache.org/repo/m2-snapshot-repository//org/apache/activemq/activeio-core/3.0.0-incubator/activeio-core-3.0.0-incubator.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/activemq/activeio-core/3.0.0-incubator/activeio-core-3.0.0-incubator.pom
[INFO] [compiler:compile]
[INFO] Compiling 3 source files to
/home/tomcat/webapps/injection-of-datasource/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to
/home/tomcat/webapps/injection-of-datasource/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory:
/home/tomcat/webapps/injection-of-datasource/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.superbiz.injection.MoviesTest
Apache OpenEJB 3.1    build: 20081009-03:31
http://openejb.apache.org/
INFO - openejb.home = /home/tomcat/webapps/injection-of-datasource
INFO - openejb.base = /home/tomcat/webapps/injection-of-datasource
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabase, type=Resource,
provider-id=Default JDBC Database)
INFO - Found EjbModule in classpath:
/home/tomcat/webapps/injection-of-datasource/target/classes
INFO - Beginning load:
/home/tomcat/webapps/injection-of-datasource/target/classes
INFO - Configuring enterprise application: classpath.ear
INFO - Configuring Service(id=Default Stateful Container, type=Container,
provider-id=Default Stateful Container)
INFO - Auto-creating a container for bean Movies: Container(type=STATEFUL,
id=Default Stateful Container)
INFO - Auto-linking resource-ref
'org.superbiz.injection.MoviesImpl/movieDatabase' in bean Movies to
Resource(id=movieDatabase)
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
INFO - Jndi(name=MoviesLocal) --> Ejb(deployment-id=Movies)
INFO - Created Ejb(deployment-id=Movies, ejb-name=Movies, container=Default
Stateful Container)
INFO - Deployed Application(path=classpath.ear)
ERROR - The bean instance business method encountered a system exception:
Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class
'com.mysql.jdbc.Driver'
        at
org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1259)
        at
org.apache.commons.dbcp.managed.BasicManagedDataSource.createConnectionFactory(BasicManagedDataSource.java:99)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1192)
        at
org.apache.openejb.resource.jdbc.BasicManagedDataSource.createDataSource(BasicManagedDataSource.java:75)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:884)
        at org.superbiz.injection.MoviesImpl.construct(MoviesImpl.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
        at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$LifecycleInvocation.invoke(ReflectionInvocationContext.java:189)
        at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
        at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
        at
org.apache.openejb.core.stateful.StatefulContainer.newInstance(StatefulContainer.java:559)
        at
org.apache.openejb.core.stateful.StatefulContainer.createEJBObject(StatefulContainer.java:300)
        at
org.apache.openejb.core.stateful.StatefulContainer.invoke(StatefulContainer.java:263)
        at
org.apache.openejb.core.ivm.EjbHomeProxyHandler.create(EjbHomeProxyHandler.java:270)
        at
org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:161)
        at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
        at $Proxy3.create(Unknown Source)
        at
org.apache.openejb.core.ivm.naming.BusinessLocalReference.getObject(BusinessLocalReference.java:33)
        at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:150)
        at
org.apache.openejb.core.ivm.naming.ContextWrapper.lookup(ContextWrapper.java:115)
        at javax.naming.InitialContext.lookup(InitialContext.java:455)
        at org.superbiz.injection.MoviesTest.test(MoviesTest.java:40)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:228)
        at junit.framework.TestSuite.run(TestSuite.java:223)
        at
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at java.lang.Class.forName(Class.java:136)
        at
org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1253)
        ... 48 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 20.332 sec
<<< FAILURE!

Results :

Tests in error:
  test(org.superbiz.injection.MoviesTest)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to
/home/tomcat/webapps/injection-of-datasource/target/surefire-reports for the
individual test results.
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8 minutes 7 seconds
[INFO] Finished at: Thu Jan 29 15:17:25 GMT 2009
[INFO] Final Memory: 32M/58M
[INFO]
------------------------------------------------------------------------



I do have another concern......from studying the injection example, all the
SQL is wrote in Java. This is something that we don't really want to do. We
want to call the connection written in Java from PHP, and then use that
connection to carry out mysql queries within PHP - is this going to be
possible? Or does all the SQL have to be writtin in the Java?












David Blevins wrote:
> 
> 
>> Sorry for the delay -- we're a bit backed up at the moment :)
> 
> No problem!
> 
>> I see. This is a very different approach to accessing the bean than  
>> via SOAP as shown in the other article.  With SOAP you have 100%  
>> native client.  This technique uses java on the client which as a  
>> result is going to use our binary protocol to do the remote  
>> invocations.  This is fine.  If you go this route you'll need to  
>> follow a different example, the one I created for you won't work.  The  
>> main difference is that you'd remove the @WebService and then you'd  
>> need to add an @Remote interface.  The "component-interfaces" example  
>> matches that article the best as it uses the old style home/remote  
>> interfaces.  A newer approach would be to follow the "telephone- 
>> stateful" example.
> 
> Lets take the SOAP route for now, and access the Calculator service from
> PHP. Once this is done I can think about getting a web service set up for
> MySQL database access via JDBC type 4 or JNDI (required for the IDMS
> database JDBC driver), and then calling this from PHP. If it all works
> well I can implement this into the IDMS config - just change the JNDI /
> JDBC configs hopefully?
> 
>> I suspect though that there's going to be a slight learning curve on  
>> either one, though.
> 
> I'm ready for it!
> 
>> Which startup script are you referring to?  If you mean the tomcat/bin/ 
>> startup.sh than, no, you don't need to modify that.  We'll find our  
>> libraries and load them automatically.
> 
> My .bashrc file for Linux startup. I dont think this applies.
> 
>> One idea for you as I know getting started in a new technology is  
>> extremely difficult due to all the very large pieces that have to be  
>> learned before much of anything can be done.  Rather than buying bunch  
> of books, you might try finding the mailing list for the local java  
>> user group and offering a 100 bucks and a few beers (or coffees and  
>> snacks) for an afternoon side by side hacking.  Just let them know  
>> what your trying to do and what technologies you're using (PHP, EJB,  
>> JDBC, Servlets).  In this economy there's guaranteed to be a few  
>> people who'd take you up on that offer.  Will be the best 100 you ever  
>> spent.
> 
> Agreed, is this forum US based? I am in the UK, I wonder if there is
> anyone here willing to do that??
> 
> As for SOAP and PHP, I now have the SOAP extension installed - I
> recompiled PHP with --enable-soap and its now available in PHP as an
> extension.
> 
> Can I access the Calculator web service using the PHP SOAP extension
> without adding axis2 or any other SOAP service for Apache2 and Tomcat? ( I
> read above that you use Apache CXF?)
> 
> I've got to a point now where I'm stuck again - I saw that you gave me the
> following:
> 
>> As an FYI, the client-side SOAP message associated with that call   
>> looks like this: 
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
>    <soap:Body> 
>      <ns1:multiply xmlns:ns1="http://superbiz.org/wsdl"> 
>        <arg0>3</arg0> 
>        <arg1>4</arg1> 
>      </ns1:multiply> 
>    </soap:Body> 
> </soap:Envelope>
> 
> Where do I insert this config? 
> 
> Also, how do I actually get the Calculator web service to do some
> calculations? Can I add variables to the URL to get some output e.g.
> www.localhost:8080/Calculator?some_variable_add etc
> 
> PHP can call a WSDL file using the following code (this requires NuSOAP):
> 
> < ?php
> 
> // include the SOAP classes
> require_once(’nusoap.php’);
> 
> $client = new soapclient(’http://example.com/url/to/some/valid.wsdl’,
> True);
> 
> $err = $client->getError();
> if ($err) {
> // Display the error
> echo ‘client construction error: ‘ . $err ;
> } else {
> $answer = $client->call(’someSOAPMethod’,
> array(
> ‘param1′=>’foo’
> ,’param2′=>’bar’));
> 
> $err = $client->getError();
> if ($err) {
> // Display the error
> echo ‘Call error: ‘ . $err;
> print_r($client->response);
> print_r($client->getDebug());
> } else {
> print_r($answer);
> }
> }
> ?>
> 
> Is it possible to create a WSDL file for the Calculator service? How is
> this done? If I can do this I can call it from PHP.
> 
> Sorry that my questions are really poor quality, but I've got really
> confused and prety stuck. 
> 
> Any help will be fantastic again.
> king regards
> Jp
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21855662.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Tomcat and openEJB - how to do this simple config?

Posted by jpmad4it <jp...@fortvale.com>.
Hi David, 

Yeah I got it working :-)

I can run TYPO3 in Apache and send any JDBC calls to the PHP-Java bridge
running in Tomcat. So this allows us to use TYPO3 as normal with MySQL, and
any JDBC requests for IDMS can be sent to Tomcat. This is good because my
first thought was that I would have to run TYPO3 fully in Tomcat, and the
PHP-Java Bridge would have to be used to implement all of the PHP.......this
worried me because I didn't want ALL of the PHP to implemented using the
bridge. I like using PHP in the way it is designed to run, and the few IDMS
requests that we need are handled using the bridge.

Sweet!


David Blevins wrote:
> 
> 
> On Feb 13, 2009, at 12:12 AM, jpmad4it wrote:
> 
>> I have had a chance to look into the EJB issue a lot more, and I think
>> you're right in saying that maybe its not the best solution.
>>
>> Basically, at a high level view here is what we want to achieve:
>>
>>
>> IDMS --------JDBC-------Tomcat------ PHP/Java Bridge-----PHP------- 
>> TYPO3 CMS
>>
>> |
>>
>> |
>>
>> MySQL
>>
>>
>> The non-IDMS technologies are running on Linux.
>>
>> The issue causing all the problems is getting PHP to connect to  
>> IDMS. We
>> have to use JDBC because there is no IDMS ODBC driver available on  
>> Linux. So
>> this is where JDBC and Tomcat come into it.
> 
> Have you tried using the JDBC Driver directly from the PHP/Java  
> Bridge.  Seems if you could get that to work that'd be the most direct  
> approach.
> 
> 
> -David
> 
> 
>> I have been experimenting with
>> the PHP/Java Bridge, and Quercus on Resin. I have found out that I can
>> actually run the TYPO3 CMS (all written in PHP) in Tomcat using the  
>> PHP/Java
>> Bridge. It allows me to connect to (via JDBC) and query both MySQL  
>> and IDMS
>> using SQL which is pretty cool.....but I'm worried that somewhere  
>> down the
>> line problems will crop up due to TYPO3 running in Tomcat (which its  
>> not
>> made to do). I tried Resin but that wouldn't install, so I tried  
>> quercus
>> standalone in Tomcat but it didnt give the same results as the PHP/ 
>> Java
>> bridge.
>>
>> I'd rather run TYPO3 in Apache and somehow send the JDBC requests to  
>> IDMS
>> via Tomcat.....but I dont know if that is possible? I do have Apache  
>> and
>> Tomcat mod_proxy(ed) together if that helps? Maybe someone knows of  
>> a better
>> setup?
>>
>> In my posts I was only using EJB-----MySQL as an example, as the  
>> IDMS has
>> its own JDBC driver so the setup would have been pretty much the same.
>>
>> So I was trying to get EJB to handle the JDBC connection to  
>> IDMS......but
>> I've learnt that I was going down the wrong route now.
>>
>> Kind regards
>> Jonathan
>>
>>
>>
>>
>> David Blevins wrote:
>>>
>>>
>>> On Feb 5, 2009, at 8:38 AM, jpmad4it wrote:
>>>
>>>> Can anyone help, I'm still struggling with this??
>>>
>>> Hi Jp, and thanks again for the patience.
>>>
>>> Answering the middle question first as the first and last question
>>> seem related.
>>>
>>>> EDIT2: I am now trying to setup the injection-of-datasource example,
>>>> I've
>>>> changed the test java file so that its correct for my mysql
>>>> database, but
>>>> during "mvn clean install" the process fails, saying it cannot find
>>>> the jdbc
>>>> driver 	. The mysql-connector/J.jar is in my tomcat/lib
>>>> folder:
>>>
>>> For build the code via maven, there simply needs to be a <dependency>
>>> section added to the pom.xml file to get it included into the build/
>>> test classpath.
>>>
>>> I think this is the right dep:
>>>
>>> <dependency>
>>>     <groupId>mysql</groupId>
>>>     <artifactId>mysql-connector-java</artifactId>
>>>     <version>5.1.6</version>
>>> </dependency>
>>>
>>> You can add that next to the openejb dep in the examples pom.xml  
>>> file.
>>>
>>>> EDIT: I think I managed to call the Calculator web service through
>>>> PHP. I
>>>> used the script soap.php:
>>> [...]
>>>> So I think that it has successfully called the service and grabbed
>>>> the types
>>>> from it? I don't know how to code the PHP to actually do a simple
>>>> addition
>>>> though.
>>>>
>>>> Maybe I should start to think about getting a service setup for the
>>>> MySQL
>>>> database?
>>> [...]
>>>> I do have another concern......from studying the injection example,
>>>> all the
>>>> SQL is wrote in Java. This is something that we don't really want to
>>>> do. We
>>>> want to call the connection written in Java from PHP, and then use
>>>> that
>>>> connection to carry out mysql queries within PHP - is this going  
>>>> to be
>>>> possible? Or does all the SQL have to be writtin in the Java?
>>>
>>> From this feedback it seems like the webservice approach may not
>>> quite be the right direction for you.
>>>
>>> Maybe we should zoom out a bit and get the bigger picture view of  
>>> what
>>> you want to do at a very high level and the motivation behind it.   
>>> The
>>> biggest question in my mind is what are you looking to get from the
>>> java side of things and what limitations are you dealing with that
>>> motivates it.
>>>
>>>
>>> -David
>>>
>>>>
>>>> David Blevins wrote:
>>>>>
>>>>>
>>>>>> Sorry for the delay -- we're a bit backed up at the moment :)
>>>>>
>>>>> No problem!
>>>>>
>>>>>> I see. This is a very different approach to accessing the bean  
>>>>>> than
>>>>>> via SOAP as shown in the other article.  With SOAP you have 100%
>>>>>> native client.  This technique uses java on the client which as a
>>>>>> result is going to use our binary protocol to do the remote
>>>>>> invocations.  This is fine.  If you go this route you'll need to
>>>>>> follow a different example, the one I created for you won't work.
>>>>>> The
>>>>>> main difference is that you'd remove the @WebService and then  
>>>>>> you'd
>>>>>> need to add an @Remote interface.  The "component-interfaces"
>>>>>> example
>>>>>> matches that article the best as it uses the old style home/remote
>>>>>> interfaces.  A newer approach would be to follow the "telephone-
>>>>>> stateful" example.
>>>>>
>>>>> Lets take the SOAP route for now, and access the Calculator service
>>>>> from
>>>>> PHP. Once this is done I can think about getting a web service set
>>>>> up for
>>>>> MySQL database access via JDBC type 4 or JNDI (required for the  
>>>>> IDMS
>>>>> database JDBC driver), and then calling this from PHP. If it all
>>>>> works
>>>>> well I can implement this into the IDMS config - just change the
>>>>> JNDI /
>>>>> JDBC configs hopefully?
>>>>>
>>>>>> I suspect though that there's going to be a slight learning  
>>>>>> curve on
>>>>>> either one, though.
>>>>>
>>>>> I'm ready for it!
>>>>>
>>>>>> Which startup script are you referring to?  If you mean the  
>>>>>> tomcat/
>>>>>> bin/
>>>>>> startup.sh than, no, you don't need to modify that.  We'll find  
>>>>>> our
>>>>>> libraries and load them automatically.
>>>>>
>>>>> My .bashrc file for Linux startup. I dont think this applies.
>>>>>
>>>>>> One idea for you as I know getting started in a new technology is
>>>>>> extremely difficult due to all the very large pieces that have  
>>>>>> to be
>>>>>> learned before much of anything can be done.  Rather than buying
>>>>>> bunch
>>>>> of books, you might try finding the mailing list for the local java
>>>>>> user group and offering a 100 bucks and a few beers (or coffees  
>>>>>> and
>>>>>> snacks) for an afternoon side by side hacking.  Just let them know
>>>>>> what your trying to do and what technologies you're using (PHP,  
>>>>>> EJB,
>>>>>> JDBC, Servlets).  In this economy there's guaranteed to be a few
>>>>>> people who'd take you up on that offer.  Will be the best 100 you
>>>>>> ever
>>>>>> spent.
>>>>>
>>>>> Agreed, is this forum US based? I am in the UK, I wonder if there  
>>>>> is
>>>>> anyone here willing to do that??
>>>>>
>>>>> As for SOAP and PHP, I now have the SOAP extension installed - I
>>>>> recompiled PHP with --enable-soap and its now available in PHP as  
>>>>> an
>>>>> extension.
>>>>>
>>>>> Can I access the Calculator web service using the PHP SOAP  
>>>>> extension
>>>>> without adding axis2 or any other SOAP service for Apache2 and
>>>>> Tomcat? ( I
>>>>> read above that you use Apache CXF?)
>>>>>
>>>>> I've got to a point now where I'm stuck again - I saw that you gave
>>>>> me the
>>>>> following:
>>>>>
>>>>>> As an FYI, the client-side SOAP message associated with that call
>>>>>> looks like this:
>>>>>
>>>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
>>>>> envelope/">
>>>>>  <soap:Body>
>>>>>    <ns1:multiply xmlns:ns1="http://superbiz.org/wsdl">
>>>>>      <arg0>3</arg0>
>>>>>      <arg1>4</arg1>
>>>>>    </ns1:multiply>
>>>>>  </soap:Body>
>>>>> </soap:Envelope>
>>>>>
>>>>> Where do I insert this config?
>>>>>
>>>>> Also, how do I actually get the Calculator web service to do some
>>>>> calculations? Can I add variables to the URL to get some output  
>>>>> e.g.
>>>>> www.localhost:8080/Calculator?some_variable_add etc
>>>>>
>>>>> PHP can call a WSDL file using the following code (this requires
>>>>> NuSOAP):
>>>>>
>>>>> < ?php
>>>>>
>>>>> // include the SOAP classes
>>>>> require_once(’nusoap.php’);
>>>>>
>>>>> $client = new soapclient(’http://example.com/url/to/some/
>>>>> valid.wsdl’,
>>>>> True);
>>>>>
>>>>> $err = $client->getError();
>>>>> if ($err) {
>>>>> // Display the error
>>>>> echo ‘client construction error: ‘ . $err ;
>>>>> } else {
>>>>> $answer = $client->call(’someSOAPMethod’,
>>>>> array(
>>>>> ‘param1′=>’foo’
>>>>> ,’param2′=>’bar’));
>>>>>
>>>>> $err = $client->getError();
>>>>> if ($err) {
>>>>> // Display the error
>>>>> echo ‘Call error: ‘ . $err;
>>>>> print_r($client->response);
>>>>> print_r($client->getDebug());
>>>>> } else {
>>>>> print_r($answer);
>>>>> }
>>>>> }
>>>>> ?>
>>>>>
>>>>> Is it possible to create a WSDL file for the Calculator service?
>>>>> How is
>>>>> this done? If I can do this I can call it from PHP.
>>>>>
>>>>> Sorry that my questions are really poor quality, but I've got  
>>>>> really
>>>>> confused and prety stuck.
>>>>>
>>>>> Any help will be fantastic again.
>>>>> king regards
>>>>> Jp
>>>>>
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21855662.html
>>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21991942.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p22095728.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Tomcat and openEJB - how to do this simple config?

Posted by David Blevins <da...@visi.com>.
On Feb 13, 2009, at 12:12 AM, jpmad4it wrote:

> I have had a chance to look into the EJB issue a lot more, and I think
> you're right in saying that maybe its not the best solution.
>
> Basically, at a high level view here is what we want to achieve:
>
>
> IDMS --------JDBC-------Tomcat------ PHP/Java Bridge-----PHP------- 
> TYPO3 CMS
>
> |
>
> |
>
> MySQL
>
>
> The non-IDMS technologies are running on Linux.
>
> The issue causing all the problems is getting PHP to connect to  
> IDMS. We
> have to use JDBC because there is no IDMS ODBC driver available on  
> Linux. So
> this is where JDBC and Tomcat come into it.

Have you tried using the JDBC Driver directly from the PHP/Java  
Bridge.  Seems if you could get that to work that'd be the most direct  
approach.


-David


> I have been experimenting with
> the PHP/Java Bridge, and Quercus on Resin. I have found out that I can
> actually run the TYPO3 CMS (all written in PHP) in Tomcat using the  
> PHP/Java
> Bridge. It allows me to connect to (via JDBC) and query both MySQL  
> and IDMS
> using SQL which is pretty cool.....but I'm worried that somewhere  
> down the
> line problems will crop up due to TYPO3 running in Tomcat (which its  
> not
> made to do). I tried Resin but that wouldn't install, so I tried  
> quercus
> standalone in Tomcat but it didnt give the same results as the PHP/ 
> Java
> bridge.
>
> I'd rather run TYPO3 in Apache and somehow send the JDBC requests to  
> IDMS
> via Tomcat.....but I dont know if that is possible? I do have Apache  
> and
> Tomcat mod_proxy(ed) together if that helps? Maybe someone knows of  
> a better
> setup?
>
> In my posts I was only using EJB-----MySQL as an example, as the  
> IDMS has
> its own JDBC driver so the setup would have been pretty much the same.
>
> So I was trying to get EJB to handle the JDBC connection to  
> IDMS......but
> I've learnt that I was going down the wrong route now.
>
> Kind regards
> Jonathan
>
>
>
>
> David Blevins wrote:
>>
>>
>> On Feb 5, 2009, at 8:38 AM, jpmad4it wrote:
>>
>>> Can anyone help, I'm still struggling with this??
>>
>> Hi Jp, and thanks again for the patience.
>>
>> Answering the middle question first as the first and last question
>> seem related.
>>
>>> EDIT2: I am now trying to setup the injection-of-datasource example,
>>> I've
>>> changed the test java file so that its correct for my mysql
>>> database, but
>>> during "mvn clean install" the process fails, saying it cannot find
>>> the jdbc
>>> driver 	. The mysql-connector/J.jar is in my tomcat/lib
>>> folder:
>>
>> For build the code via maven, there simply needs to be a <dependency>
>> section added to the pom.xml file to get it included into the build/
>> test classpath.
>>
>> I think this is the right dep:
>>
>> <dependency>
>>     <groupId>mysql</groupId>
>>     <artifactId>mysql-connector-java</artifactId>
>>     <version>5.1.6</version>
>> </dependency>
>>
>> You can add that next to the openejb dep in the examples pom.xml  
>> file.
>>
>>> EDIT: I think I managed to call the Calculator web service through
>>> PHP. I
>>> used the script soap.php:
>> [...]
>>> So I think that it has successfully called the service and grabbed
>>> the types
>>> from it? I don't know how to code the PHP to actually do a simple
>>> addition
>>> though.
>>>
>>> Maybe I should start to think about getting a service setup for the
>>> MySQL
>>> database?
>> [...]
>>> I do have another concern......from studying the injection example,
>>> all the
>>> SQL is wrote in Java. This is something that we don't really want to
>>> do. We
>>> want to call the connection written in Java from PHP, and then use
>>> that
>>> connection to carry out mysql queries within PHP - is this going  
>>> to be
>>> possible? Or does all the SQL have to be writtin in the Java?
>>
>> From this feedback it seems like the webservice approach may not
>> quite be the right direction for you.
>>
>> Maybe we should zoom out a bit and get the bigger picture view of  
>> what
>> you want to do at a very high level and the motivation behind it.   
>> The
>> biggest question in my mind is what are you looking to get from the
>> java side of things and what limitations are you dealing with that
>> motivates it.
>>
>>
>> -David
>>
>>>
>>> David Blevins wrote:
>>>>
>>>>
>>>>> Sorry for the delay -- we're a bit backed up at the moment :)
>>>>
>>>> No problem!
>>>>
>>>>> I see. This is a very different approach to accessing the bean  
>>>>> than
>>>>> via SOAP as shown in the other article.  With SOAP you have 100%
>>>>> native client.  This technique uses java on the client which as a
>>>>> result is going to use our binary protocol to do the remote
>>>>> invocations.  This is fine.  If you go this route you'll need to
>>>>> follow a different example, the one I created for you won't work.
>>>>> The
>>>>> main difference is that you'd remove the @WebService and then  
>>>>> you'd
>>>>> need to add an @Remote interface.  The "component-interfaces"
>>>>> example
>>>>> matches that article the best as it uses the old style home/remote
>>>>> interfaces.  A newer approach would be to follow the "telephone-
>>>>> stateful" example.
>>>>
>>>> Lets take the SOAP route for now, and access the Calculator service
>>>> from
>>>> PHP. Once this is done I can think about getting a web service set
>>>> up for
>>>> MySQL database access via JDBC type 4 or JNDI (required for the  
>>>> IDMS
>>>> database JDBC driver), and then calling this from PHP. If it all
>>>> works
>>>> well I can implement this into the IDMS config - just change the
>>>> JNDI /
>>>> JDBC configs hopefully?
>>>>
>>>>> I suspect though that there's going to be a slight learning  
>>>>> curve on
>>>>> either one, though.
>>>>
>>>> I'm ready for it!
>>>>
>>>>> Which startup script are you referring to?  If you mean the  
>>>>> tomcat/
>>>>> bin/
>>>>> startup.sh than, no, you don't need to modify that.  We'll find  
>>>>> our
>>>>> libraries and load them automatically.
>>>>
>>>> My .bashrc file for Linux startup. I dont think this applies.
>>>>
>>>>> One idea for you as I know getting started in a new technology is
>>>>> extremely difficult due to all the very large pieces that have  
>>>>> to be
>>>>> learned before much of anything can be done.  Rather than buying
>>>>> bunch
>>>> of books, you might try finding the mailing list for the local java
>>>>> user group and offering a 100 bucks and a few beers (or coffees  
>>>>> and
>>>>> snacks) for an afternoon side by side hacking.  Just let them know
>>>>> what your trying to do and what technologies you're using (PHP,  
>>>>> EJB,
>>>>> JDBC, Servlets).  In this economy there's guaranteed to be a few
>>>>> people who'd take you up on that offer.  Will be the best 100 you
>>>>> ever
>>>>> spent.
>>>>
>>>> Agreed, is this forum US based? I am in the UK, I wonder if there  
>>>> is
>>>> anyone here willing to do that??
>>>>
>>>> As for SOAP and PHP, I now have the SOAP extension installed - I
>>>> recompiled PHP with --enable-soap and its now available in PHP as  
>>>> an
>>>> extension.
>>>>
>>>> Can I access the Calculator web service using the PHP SOAP  
>>>> extension
>>>> without adding axis2 or any other SOAP service for Apache2 and
>>>> Tomcat? ( I
>>>> read above that you use Apache CXF?)
>>>>
>>>> I've got to a point now where I'm stuck again - I saw that you gave
>>>> me the
>>>> following:
>>>>
>>>>> As an FYI, the client-side SOAP message associated with that call
>>>>> looks like this:
>>>>
>>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
>>>> envelope/">
>>>>  <soap:Body>
>>>>    <ns1:multiply xmlns:ns1="http://superbiz.org/wsdl">
>>>>      <arg0>3</arg0>
>>>>      <arg1>4</arg1>
>>>>    </ns1:multiply>
>>>>  </soap:Body>
>>>> </soap:Envelope>
>>>>
>>>> Where do I insert this config?
>>>>
>>>> Also, how do I actually get the Calculator web service to do some
>>>> calculations? Can I add variables to the URL to get some output  
>>>> e.g.
>>>> www.localhost:8080/Calculator?some_variable_add etc
>>>>
>>>> PHP can call a WSDL file using the following code (this requires
>>>> NuSOAP):
>>>>
>>>> < ?php
>>>>
>>>> // include the SOAP classes
>>>> require_once(’nusoap.php’);
>>>>
>>>> $client = new soapclient(’http://example.com/url/to/some/
>>>> valid.wsdl’,
>>>> True);
>>>>
>>>> $err = $client->getError();
>>>> if ($err) {
>>>> // Display the error
>>>> echo ‘client construction error: ‘ . $err ;
>>>> } else {
>>>> $answer = $client->call(’someSOAPMethod’,
>>>> array(
>>>> ‘param1′=>’foo’
>>>> ,’param2′=>’bar’));
>>>>
>>>> $err = $client->getError();
>>>> if ($err) {
>>>> // Display the error
>>>> echo ‘Call error: ‘ . $err;
>>>> print_r($client->response);
>>>> print_r($client->getDebug());
>>>> } else {
>>>> print_r($answer);
>>>> }
>>>> }
>>>> ?>
>>>>
>>>> Is it possible to create a WSDL file for the Calculator service?
>>>> How is
>>>> this done? If I can do this I can call it from PHP.
>>>>
>>>> Sorry that my questions are really poor quality, but I've got  
>>>> really
>>>> confused and prety stuck.
>>>>
>>>> Any help will be fantastic again.
>>>> king regards
>>>> Jp
>>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21855662.html
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21991942.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Re: Tomcat and openEJB - how to do this simple config?

Posted by jpmad4it <jp...@fortvale.com>.
Hi David,

Thanks for the reply once again.

I have had a chance to look into the EJB issue a lot more, and I think
you're right in saying that maybe its not the best solution.

Basically, at a high level view here is what we want to achieve:


IDMS --------JDBC-------Tomcat------ PHP/Java Bridge-----PHP-------TYPO3 CMS
                                                                                   
|
                                                                                   
|
                                                                                
MySQL


The non-IDMS technologies are running on Linux.

The issue causing all the problems is getting PHP to connect to IDMS. We
have to use JDBC because there is no IDMS ODBC driver available on Linux. So
this is where JDBC and Tomcat come into it. I have been experimenting with
the PHP/Java Bridge, and Quercus on Resin. I have found out that I can
actually run the TYPO3 CMS (all written in PHP) in Tomcat using the PHP/Java
Bridge. It allows me to connect to (via JDBC) and query both MySQL and IDMS
using SQL which is pretty cool.....but I'm worried that somewhere down the
line problems will crop up due to TYPO3 running in Tomcat (which its not
made to do). I tried Resin but that wouldn't install, so I tried quercus
standalone in Tomcat but it didnt give the same results as the PHP/Java
bridge. 

I'd rather run TYPO3 in Apache and somehow send the JDBC requests to IDMS
via Tomcat.....but I dont know if that is possible? I do have Apache and
Tomcat mod_proxy(ed) together if that helps? Maybe someone knows of a better
setup?

In my posts I was only using EJB-----MySQL as an example, as the IDMS has
its own JDBC driver so the setup would have been pretty much the same.

So I was trying to get EJB to handle the JDBC connection to IDMS......but
I've learnt that I was going down the wrong route now.

Kind regards
Jonathan




David Blevins wrote:
> 
> 
> On Feb 5, 2009, at 8:38 AM, jpmad4it wrote:
> 
>> Can anyone help, I'm still struggling with this??
> 
> Hi Jp, and thanks again for the patience.
> 
> Answering the middle question first as the first and last question  
> seem related.
> 
>> EDIT2: I am now trying to setup the injection-of-datasource example,  
>> I've
>> changed the test java file so that its correct for my mysql  
>> database, but
>> during "mvn clean install" the process fails, saying it cannot find  
>> the jdbc
>> driver 	. The mysql-connector/J.jar is in my tomcat/lib
>> folder:
> 
> For build the code via maven, there simply needs to be a <dependency>  
> section added to the pom.xml file to get it included into the build/ 
> test classpath.
> 
> I think this is the right dep:
> 
> <dependency>
>      <groupId>mysql</groupId>
>      <artifactId>mysql-connector-java</artifactId>
>      <version>5.1.6</version>
> </dependency>
> 
> You can add that next to the openejb dep in the examples pom.xml file.
> 
>> EDIT: I think I managed to call the Calculator web service through  
>> PHP. I
>> used the script soap.php:
> [...]
>> So I think that it has successfully called the service and grabbed  
>> the types
>> from it? I don't know how to code the PHP to actually do a simple  
>> addition
>> though.
>>
>> Maybe I should start to think about getting a service setup for the  
>> MySQL
>> database?
> [...]
>> I do have another concern......from studying the injection example,  
>> all the
>> SQL is wrote in Java. This is something that we don't really want to  
>> do. We
>> want to call the connection written in Java from PHP, and then use  
>> that
>> connection to carry out mysql queries within PHP - is this going to be
>> possible? Or does all the SQL have to be writtin in the Java?
> 
>  From this feedback it seems like the webservice approach may not  
> quite be the right direction for you.
> 
> Maybe we should zoom out a bit and get the bigger picture view of what  
> you want to do at a very high level and the motivation behind it.  The  
> biggest question in my mind is what are you looking to get from the  
> java side of things and what limitations are you dealing with that  
> motivates it.
> 
> 
> -David
> 
>>
>> David Blevins wrote:
>>>
>>>
>>>> Sorry for the delay -- we're a bit backed up at the moment :)
>>>
>>> No problem!
>>>
>>>> I see. This is a very different approach to accessing the bean than
>>>> via SOAP as shown in the other article.  With SOAP you have 100%
>>>> native client.  This technique uses java on the client which as a
>>>> result is going to use our binary protocol to do the remote
>>>> invocations.  This is fine.  If you go this route you'll need to
>>>> follow a different example, the one I created for you won't work.   
>>>> The
>>>> main difference is that you'd remove the @WebService and then you'd
>>>> need to add an @Remote interface.  The "component-interfaces"  
>>>> example
>>>> matches that article the best as it uses the old style home/remote
>>>> interfaces.  A newer approach would be to follow the "telephone-
>>>> stateful" example.
>>>
>>> Lets take the SOAP route for now, and access the Calculator service  
>>> from
>>> PHP. Once this is done I can think about getting a web service set  
>>> up for
>>> MySQL database access via JDBC type 4 or JNDI (required for the IDMS
>>> database JDBC driver), and then calling this from PHP. If it all  
>>> works
>>> well I can implement this into the IDMS config - just change the  
>>> JNDI /
>>> JDBC configs hopefully?
>>>
>>>> I suspect though that there's going to be a slight learning curve on
>>>> either one, though.
>>>
>>> I'm ready for it!
>>>
>>>> Which startup script are you referring to?  If you mean the tomcat/ 
>>>> bin/
>>>> startup.sh than, no, you don't need to modify that.  We'll find our
>>>> libraries and load them automatically.
>>>
>>> My .bashrc file for Linux startup. I dont think this applies.
>>>
>>>> One idea for you as I know getting started in a new technology is
>>>> extremely difficult due to all the very large pieces that have to be
>>>> learned before much of anything can be done.  Rather than buying  
>>>> bunch
>>> of books, you might try finding the mailing list for the local java
>>>> user group and offering a 100 bucks and a few beers (or coffees and
>>>> snacks) for an afternoon side by side hacking.  Just let them know
>>>> what your trying to do and what technologies you're using (PHP, EJB,
>>>> JDBC, Servlets).  In this economy there's guaranteed to be a few
>>>> people who'd take you up on that offer.  Will be the best 100 you  
>>>> ever
>>>> spent.
>>>
>>> Agreed, is this forum US based? I am in the UK, I wonder if there is
>>> anyone here willing to do that??
>>>
>>> As for SOAP and PHP, I now have the SOAP extension installed - I
>>> recompiled PHP with --enable-soap and its now available in PHP as an
>>> extension.
>>>
>>> Can I access the Calculator web service using the PHP SOAP extension
>>> without adding axis2 or any other SOAP service for Apache2 and  
>>> Tomcat? ( I
>>> read above that you use Apache CXF?)
>>>
>>> I've got to a point now where I'm stuck again - I saw that you gave  
>>> me the
>>> following:
>>>
>>>> As an FYI, the client-side SOAP message associated with that call
>>>> looks like this:
>>>
>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ 
>>> envelope/">
>>>   <soap:Body>
>>>     <ns1:multiply xmlns:ns1="http://superbiz.org/wsdl">
>>>       <arg0>3</arg0>
>>>       <arg1>4</arg1>
>>>     </ns1:multiply>
>>>   </soap:Body>
>>> </soap:Envelope>
>>>
>>> Where do I insert this config?
>>>
>>> Also, how do I actually get the Calculator web service to do some
>>> calculations? Can I add variables to the URL to get some output e.g.
>>> www.localhost:8080/Calculator?some_variable_add etc
>>>
>>> PHP can call a WSDL file using the following code (this requires  
>>> NuSOAP):
>>>
>>> < ?php
>>>
>>> // include the SOAP classes
>>> require_once(’nusoap.php’);
>>>
>>> $client = new soapclient(’http://example.com/url/to/some/ 
>>> valid.wsdl’,
>>> True);
>>>
>>> $err = $client->getError();
>>> if ($err) {
>>> // Display the error
>>> echo ‘client construction error: ‘ . $err ;
>>> } else {
>>> $answer = $client->call(’someSOAPMethod’,
>>> array(
>>> ‘param1′=>’foo’
>>> ,’param2′=>’bar’));
>>>
>>> $err = $client->getError();
>>> if ($err) {
>>> // Display the error
>>> echo ‘Call error: ‘ . $err;
>>> print_r($client->response);
>>> print_r($client->getDebug());
>>> } else {
>>> print_r($answer);
>>> }
>>> }
>>> ?>
>>>
>>> Is it possible to create a WSDL file for the Calculator service?  
>>> How is
>>> this done? If I can do this I can call it from PHP.
>>>
>>> Sorry that my questions are really poor quality, but I've got really
>>> confused and prety stuck.
>>>
>>> Any help will be fantastic again.
>>> king regards
>>> Jp
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21855662.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21991942.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Tomcat and openEJB - how to do this simple config?

Posted by David Blevins <da...@visi.com>.
On Feb 5, 2009, at 8:38 AM, jpmad4it wrote:

> Can anyone help, I'm still struggling with this??

Hi Jp, and thanks again for the patience.

Answering the middle question first as the first and last question  
seem related.

> EDIT2: I am now trying to setup the injection-of-datasource example,  
> I've
> changed the test java file so that its correct for my mysql  
> database, but
> during "mvn clean install" the process fails, saying it cannot find  
> the jdbc
> driver 	. The mysql-connector/J.jar is in my tomcat/lib
> folder:

For build the code via maven, there simply needs to be a <dependency>  
section added to the pom.xml file to get it included into the build/ 
test classpath.

I think this is the right dep:

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <version>5.1.6</version>
</dependency>

You can add that next to the openejb dep in the examples pom.xml file.

> EDIT: I think I managed to call the Calculator web service through  
> PHP. I
> used the script soap.php:
[...]
> So I think that it has successfully called the service and grabbed  
> the types
> from it? I don't know how to code the PHP to actually do a simple  
> addition
> though.
>
> Maybe I should start to think about getting a service setup for the  
> MySQL
> database?
[...]
> I do have another concern......from studying the injection example,  
> all the
> SQL is wrote in Java. This is something that we don't really want to  
> do. We
> want to call the connection written in Java from PHP, and then use  
> that
> connection to carry out mysql queries within PHP - is this going to be
> possible? Or does all the SQL have to be writtin in the Java?

 From this feedback it seems like the webservice approach may not  
quite be the right direction for you.

Maybe we should zoom out a bit and get the bigger picture view of what  
you want to do at a very high level and the motivation behind it.  The  
biggest question in my mind is what are you looking to get from the  
java side of things and what limitations are you dealing with that  
motivates it.


-David

>
> David Blevins wrote:
>>
>>
>>> Sorry for the delay -- we're a bit backed up at the moment :)
>>
>> No problem!
>>
>>> I see. This is a very different approach to accessing the bean than
>>> via SOAP as shown in the other article.  With SOAP you have 100%
>>> native client.  This technique uses java on the client which as a
>>> result is going to use our binary protocol to do the remote
>>> invocations.  This is fine.  If you go this route you'll need to
>>> follow a different example, the one I created for you won't work.   
>>> The
>>> main difference is that you'd remove the @WebService and then you'd
>>> need to add an @Remote interface.  The "component-interfaces"  
>>> example
>>> matches that article the best as it uses the old style home/remote
>>> interfaces.  A newer approach would be to follow the "telephone-
>>> stateful" example.
>>
>> Lets take the SOAP route for now, and access the Calculator service  
>> from
>> PHP. Once this is done I can think about getting a web service set  
>> up for
>> MySQL database access via JDBC type 4 or JNDI (required for the IDMS
>> database JDBC driver), and then calling this from PHP. If it all  
>> works
>> well I can implement this into the IDMS config - just change the  
>> JNDI /
>> JDBC configs hopefully?
>>
>>> I suspect though that there's going to be a slight learning curve on
>>> either one, though.
>>
>> I'm ready for it!
>>
>>> Which startup script are you referring to?  If you mean the tomcat/ 
>>> bin/
>>> startup.sh than, no, you don't need to modify that.  We'll find our
>>> libraries and load them automatically.
>>
>> My .bashrc file for Linux startup. I dont think this applies.
>>
>>> One idea for you as I know getting started in a new technology is
>>> extremely difficult due to all the very large pieces that have to be
>>> learned before much of anything can be done.  Rather than buying  
>>> bunch
>> of books, you might try finding the mailing list for the local java
>>> user group and offering a 100 bucks and a few beers (or coffees and
>>> snacks) for an afternoon side by side hacking.  Just let them know
>>> what your trying to do and what technologies you're using (PHP, EJB,
>>> JDBC, Servlets).  In this economy there's guaranteed to be a few
>>> people who'd take you up on that offer.  Will be the best 100 you  
>>> ever
>>> spent.
>>
>> Agreed, is this forum US based? I am in the UK, I wonder if there is
>> anyone here willing to do that??
>>
>> As for SOAP and PHP, I now have the SOAP extension installed - I
>> recompiled PHP with --enable-soap and its now available in PHP as an
>> extension.
>>
>> Can I access the Calculator web service using the PHP SOAP extension
>> without adding axis2 or any other SOAP service for Apache2 and  
>> Tomcat? ( I
>> read above that you use Apache CXF?)
>>
>> I've got to a point now where I'm stuck again - I saw that you gave  
>> me the
>> following:
>>
>>> As an FYI, the client-side SOAP message associated with that call
>>> looks like this:
>>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ 
>> envelope/">
>>   <soap:Body>
>>     <ns1:multiply xmlns:ns1="http://superbiz.org/wsdl">
>>       <arg0>3</arg0>
>>       <arg1>4</arg1>
>>     </ns1:multiply>
>>   </soap:Body>
>> </soap:Envelope>
>>
>> Where do I insert this config?
>>
>> Also, how do I actually get the Calculator web service to do some
>> calculations? Can I add variables to the URL to get some output e.g.
>> www.localhost:8080/Calculator?some_variable_add etc
>>
>> PHP can call a WSDL file using the following code (this requires  
>> NuSOAP):
>>
>> < ?php
>>
>> // include the SOAP classes
>> require_once(’nusoap.php’);
>>
>> $client = new soapclient(’http://example.com/url/to/some/ 
>> valid.wsdl’,
>> True);
>>
>> $err = $client->getError();
>> if ($err) {
>> // Display the error
>> echo ‘client construction error: ‘ . $err ;
>> } else {
>> $answer = $client->call(’someSOAPMethod’,
>> array(
>> ‘param1′=>’foo’
>> ,’param2′=>’bar’));
>>
>> $err = $client->getError();
>> if ($err) {
>> // Display the error
>> echo ‘Call error: ‘ . $err;
>> print_r($client->response);
>> print_r($client->getDebug());
>> } else {
>> print_r($answer);
>> }
>> }
>> ?>
>>
>> Is it possible to create a WSDL file for the Calculator service?  
>> How is
>> this done? If I can do this I can call it from PHP.
>>
>> Sorry that my questions are really poor quality, but I've got really
>> confused and prety stuck.
>>
>> Any help will be fantastic again.
>> king regards
>> Jp
>>
>
> -- 
> View this message in context: http://www.nabble.com/Tomcat-and-openEJB---how-to-do-this-simple-config--tp21582249p21855662.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>