Registering the EJB Web Service Providers with OC4J

Before you can deploy a web service based on an EJB for the first time, you must register the providers for the EJB web service types that are supported:

These instructions apply to the embedded OC4J server in JDeveloper or a standalone OC4J instance.

Throughout this topic, <jdev_install> refers to the location where JDeveloper is installed.

To register the providers:
  1. If necessary, install OC4J, or if it is running, stop it according to the instructions in Installing, Starting, and Stopping OC4J.
  2. Modify the following file, <jdev_install> /soap/webapps/soap/soap/WEB-INF/soap.xml, to include the following lines:

    <osc:providerManager> <osc:option name="autoDeploy" value="true" /> </osc:providerManage
  3. You have to create three XML files that contain provider information for stateless EJBs, stateful EJBs, and entity EJBs. For each of the following, copy the code into a text editor, change <hostname.domain> to the domain qualified hostname for your machine, and save as instructed:

    Save the following as <jdev_install>/j2ee/home/statelessejb-provider.xml
    	
       <isd:provider xmlns:isd="http://xmlns.oracle.com/soap/2001/04/deploy/provider" 
          id="stateless-ejb-provider" class="oracle.soap.providers.ejbprov.StatelessEJBProvider"> 
        <isd:option key="SecurityPrincipal" value="admin"/> 
        <isd:option key="SecurityCredential" value="welcome"/> 
        <isd:option key="ContextProviderURL" value="ormi://<hostname.domain>"/> 
        <isd:option key="FullContextFactoryName" value="com.evermind.server.rmi.RMIInitialContextFactory"/> 
        </isd:provider>
    	        
    Save the following as <jdev_install> /j2ee/home/statefulejb-provider.xml:
    	
        <isd:provider xmlns:isd="http://xmlns.oracle.com/soap/2001/04/deploy/provider" 
        id="stateful-ejb-provider" class="oracle.soap.providers.ejbprov.StatefulEJBProvider"> 
        <isd:option key="SecurityPrincipal" value="admin"/> 
        <isd:option key="SecurityCredential" value="welcome"/> 
        <isd:option key="ContextProviderURL" value="ormi://<hostname.domain>"/> 
        <isd:option key="FullContextFactoryName" value="com.evermind.server.rmi.RMIInitialContextFactory"/> 
        </isd:provider>          
    Save the following as <jdev_install> /j2ee/home/entityejb-provider.xml:
       
       <isd:provider xmlns:isd="http://xmlns.oracle.com/soap/2001/04/deploy/provider" 
      id="entity-ejb-provider" class="oracle.soap.providers.ejbprov.EntityEJBProvider"> 
      <isd:option key="SecurityPrincipal" value="admin"/> 
      <isd:option key="SecurityCredential" value="welcome"/> 
      <isd:option key="ContextProviderURL" value="ormi://<hostname.domain>"/> 
      <isd:option key="FullContextFactoryName" value="com.evermind.server.rmi.RMIInitialContextFactory"/> 
      </isd:provider>        
  4. Cut and paste the following command into a text editor (it is all on one line), and replace <jdev_install> with the appropriate path:

    Java -cp <jdev_install> /lib/xmlparserv2.jar;<jdev_install>/soap/lib/soap.jar; <jdev_install>/j2ee/home/lib/http_client.jar; <jdev_install>/j2ee/home/lib/javax-ssl-1_2.jar; <jdev_install>/j2ee/home/lib/jssl-1_2.jar;<jdev_install> /j2ee/home/activation.jar;<jdev_install>/j2ee/home/mail.jar oracle.soap.client.ProviderManagerClient
  5. Copy the edited command and paste it into the command prompt. The current usage details of the provider manager are displayed.
  6. Run the same command with parameters to register the EJB providers. At the command prompt, run the command in step 4 three times, each time followed by one of:

    http://localhost:8888/soap/servlet/soaprouter deploy <jdev_install> /j2ee/home/statelessejb-provider.xml
    http://localhost:8888/soap/servlet/soaprouter deploy <jdev_install> /j2ee/home/statefulejb-provider.xml
    http://localhost:8888/soap/servlet/soaprouter deploy <jdev_install> /j2ee/home/entityejb-provider.xml
  7. Check that the providers are registered using the list command. At the command line, enter the command in step 3 followed by:
    http://localhost:8888/soap/servlet/soaprouter list
  8. Start OC4J, using the instructions in Installing, Starting, and Stopping OC4J.

Now that you have the EJB providers registered at OC4J's SOAP server, you can create web services based on an EJB by invoking the Create Web Services wizard, and entering the EJB remote interface as the class to publish.


Developing SOAP Web Services

 

Copyright © 1997, 2004, Oracle. All rights reserved.