Hello Adi & others,

I just had a look at the up-to-date Apache SOAP stuff 
(I tried the IBM implementation one or two month ago and found it unusable
for putting it into jBoss, then). It seems like I have to change my mind
because a lot has happened since
then. Thank you Adi, for triggering me to do that.

Now before continuing with a proprietary ZOAP implementation, 
I�m trying to do a server-side connection from jBoss (invoker, invocation
handler, ...) to find out whether the situation has changed. If everything
runs smoothly, you will get that plugin code next week.

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.






Reply via email to