You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Zhou Ruiyi <zh...@sunjapan.com.cn> on 2001/05/17 08:10:26 UTC

Calling ejb throught soap.

Hi,
    I have a problem with calling ejb method . The Ejb is deployed as a SOAP
service(SessionStateless).
I made a client class to call ejb method .then it returned the fault
string --'Unable to initialize context'.
i have the following
'<isd:provider type="org.apache.soap.providers.StatelessEJBProvider"
                scope="Application"
                methods="create">
    <isd:java class="samples/HelloService"/>
    <isd:option key="FullHomeInterfaceName" value="samples.HelloServiceHome"
/>
    <isd:option key="ContextProviderURL" value="iiop://localhost:900" />
    <isd:option key="FullContextFactoryName"
value="com.ibm.ejs.ns.jndi.CNInitialContextFactory" />
  </isd:provider>'
to be service's descriptor,and i am using SOAP v2.1 ,it seems to support
ejb.then,what's the problem?

Regards

Zhou

Re: Calling ejb throught soap.

Posted by Saint-Martin Cecile <cs...@symetrx.com>.
You have to change ContextProviderURL option value to the URL of your EJB
container server and especially the right port number of its JNDI service.

For reference, when you call EJB via IIOP ("direct" access, not via SOAP),
you write this :
        System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");     // Example for Jboss
Container
        System.setProperty("java.naming.provider.url",  URL);
// URL of JNDI service on EJB container server
        InitialContext jndiContext = new InitialContext();
        Object ref = jndiContext.lookup("MyEJBName");

So the first property you set corresponds to the FullContextFactoryName
option of your SOAP deployment descriptor, and the second to the
ContextProviderURL option.
I think you have to read the documentation of your EJB server because those
informations are specific to each EJB Container... You'll find it in an
example of EJB call...


Cécile Saint-Martin
csaintmartin@symetrx.com

----- Original Message ----- 
  From: Zhou Ruiyi 
  To: soap-dev@xml.apache.org 
  Sent: Thursday, May 17, 2001 8:10 AM
  Subject: Calling ejb throught soap.


  Hi,
      I have a problem with calling ejb method . The Ejb is deployed as a SOAP service(SessionStateless).
  I made a client class to call ejb method .then it returned the fault string --'Unable to initialize context'.
  i have the following 
  '<isd:provider type="org.apache.soap.providers.StatelessEJBProvider"
                  scope="Application"
                  methods="create">
      <isd:java class="samples/HelloService"/>
      <isd:option key="FullHomeInterfaceName" value="samples.HelloServiceHome" />
      <isd:option key="ContextProviderURL" value="iiop://localhost:900" />
      <isd:option key="FullContextFactoryName" value="com.ibm.ejs.ns.jndi.CNInitialContextFactory" />
    </isd:provider>'
  to be service's descriptor,and i am using SOAP v2.1 ,it seems to support ejb.then,what's the problem?

  Regards

  Zhou