Hi Adi,
This is an interesting work you did ...
We are currently developing an Open-Source SOAP package (ZOAP) under the
jBoss flag that incorporates many of the things you presented more tightly
coupled to the app-server (your servlet is replaced by a dedicated container
invoker for each bean, a SOAP invocation handler can be installed in JNDI to
connect to the invoker transparently ... !). This is a) to benefit from the
decoupled, XML-based data exchange not only between client and server, but
also between server-side application components and b) to provide a more
lightweight implementation than the reference implementations (for example,
there will be a default mode that builds the meta-data from Java
serialisation and reflection on the fly - no service description is needed).
As a publication date, we had originally July in mind. Due to the ubiquitous
resource and legal problems, I intend now to do it by the end of next week
.... Stay tuned and join ;-)
With respect to your transaction question, I�d see the possibility of
implementing a SOAP-remote access to transaction manager and an XML
representation of transactions, such that
also SOAP-communicating beans can coordinate. The association between client
threads and server threads (important for managing any kind of stateful
resources) can be initially made via persistant HTTP1.1 connections. What do
you think?
Best,
CGJ
-----Urspr�ngliche Nachricht-----
Von: Adi Lev [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 3. August 2000 10:06
An: jBoss Developer
Betreff: [jBoss-Dev] JBoss SOAP to EJB mapping and using usassing
togehter discussion
SOAP is XML RPC that run over the post of HTTP, so the server is a
WEB server HTTP protocol. I myself use a home made HTTP server.
I use the IBM SOAP implementation and found it connivance.
I have just finish written a client and servlet that run on the Server that
use IBM-SOAP.jar I found it very convience (converting the supplied
rpcrouter.jsp code to a servlet). I found I need to use a definition file
that define the exposed methods, the class,If it is static or not (if not
you create or use from a pool a newInstance of the class). It use the
description to locate the class and call method.invoke.
This is the client side code using IBM SOAP:
import java.net.*;
import java.util.*;
import com.ibm.soap.*;
import com.ibm.cs.xml.*;
import com.ibm.soap.rpc.*;
import com.ibm.soap.encoding.*;
import com.ibm.soap.encoding.soapenc.*;
public class SoapTester
{
static public String testURI="urn:TestIt";
static public String testURL="http://localhost:8082/servlet/soap";
public final static void main(String args[])
throws MalformedURLException, SOAPException
{
Call call = new Call();
call.setTargetObjectURI(testURI);
call.setMethodName("reverse");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter("st",String.class,
"hello world",null));
call.setParams(params);
URL url = new URL(testURL);
Response resp =
call.invoke(url,testURI);
if(!resp.generatedFault())
{
Parameter ret = resp.getReturnValue();
System.out.println(ret.getValue());
}
else
{
Fault fault = resp.getFault();
System.err.println(fault.getFaultCode() + " / " +
fault.getFaultString());
}
}
}
This is a sample of reverse.xml descriptor file for deployment:
<isd:service xmlns:isd="http://www.ibm.com/namespaces/ibm-soap/deployment"
id="urn:TestIt">
<isd:provider type="java"
scope="Application"
methods="reverse">
<isd:java class="test.TestIt" static="false"/>
</isd:provider>
</isd:service>
---------------------->>>>>>>>>>>>>>>>>>>>>>>
OK - now for the disscusion itself
Using SOAP calling to use to EJB BEAN first:
Be aware that you need to deploy a descriptor file (xml) to serviceManager:
(see later for example)
This code will deploy it:
DeploymentDescriptor dd=
DeploymentDescriptor.fromXML(doc.getDocumentElement());
serviceManager.deploy(dd);
Now how do you deploy an EJB and create an EJB servlet service that
automatically use EJB insteads of standard bean.
You can create an automatic method that read the ejb.jar and
locate the home and remote interface from the xml and create
the list of methods that are public. Set the URI (logical name of
the resource in SOAP) and set static to false in case of stateless bean.
Now how do you know it is an EJB and not standard bean.
Currently the servlet directly use method.invoke.
Instead you can recognize from some convention that the bean is EJB (e.g.
define new provider type e.g. JNDI, currently one of them is Java)
The user use soap as regular method.
Basically the user should call first the home interface (which contains the
create and findBy methods). Then the servlet do lookup for the Class using
the URI name as the Lookup name in the JNDI.
Mapping between the user (via session? or host? or cookie?) to an hashtable
that contain the EJB instance. When calling a remote interface use this
hashtable to return the EJB. (if define static - stateless use a pool
instead).
Then invoke this EJB (will method.invoke work on the instance EJB at the
client side?)
This is the basic schema for automatically invoking EJB from soap calls,
thus solving the firewall problems, which usually open only the http
connection.Only the deployed ejb into this servlet will have outside access.
How you support user transaction via a call to a class that start and end
transaction, which uses the hashtable for mapping the user and the
transaction. Can you elaborate on it?
OK - how JNDI will use SOAP
This describe user who want to use EJB methods and JNDI will map
the call to soap instead of RMI or IIOP/CORBA
A remote JNDI entity (e.g with cluster implementation where the protocol
to use the remote computer is via soap) will convert EJB calls to SOAP
calls.
On the server side it either a WebServer running directly under the JBOSS
will talks directly with JBOSS or use the same above servlet a local JNDI
to route the request to EJB.