ejb-jpa2-sdo-service
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:
This example is based on the one posted by Edwin Biemond at: http://biemond.blogspot.be/2012/08/generating-ejb-sdo-service-interface.html

To purpose of this example was to expose the EJB based SDO example from above also through Soap.

To achieve this I had to do the following:

1) Add a WAR deployment profile to the ModelSDO project in JDeveloper:

Right click on the 'ModelSDO' project, choose 'Project Properties', go to 'Deployment' and create a new Deployment Profile by clicking on 'New...'.  In the Create Deployment Profile choose 'WAR File' as Achive Type and name it for example 'SdoEjbService', then click 'OK' to confirm.

2) Before we continue with the web archive part, we will first alter the EAR deployment profile so that the 'ModelSDO' EJB and WAR gets well deployed.

To achieve this click on the context menu right of the 'EjbSdoService' application and select 'Application Properties...'.
There you'll see a Deployment Profile named 'ejbsdoservice (EAR File)', select it and click on 'Edit...'.
Under 'Application Assembly', make sure 'hrSdoEjbService' and 'SdoEjbService' is selected and click on 'OK'.  This will allow the assembling of the EJB and WAR within the EAR.
Also click on 'OK' when you are returned to the 'Application Properties' popup.

3) Now that the ModelSDO is WAR aware, we need to add a web deployment descriptor (e.g. web.xml).  To achieve this do the following:

Right click on the 'ModelSDO' project, select 'New...' from the context menu.  In the tab 'Current Project Technologies', make sure the tree node 'Categories' is set to 'General' and 'Deployment Descriptors'.
There you need to select the item labeled 'Java EE Deployment Descriptor' and click on 'OK'. In the dialog 'Create Java EE Deployment Descriptor', make sure you select 'web.xml' in step 1 and click on 'Next >'.
Set the deployment descriptor version to 2.5 and hit 'Next >'. In the last step just click on 'Finish'.

Now you'll notice that the 'ModelSDO' project has a third directory named 'Web Content' containing a 'WEB-INF' directory with 2 files, namely 'weblogic.xml' and the just created deployment descriptor named 'web.xml'.

3) Now click on the source mode of the web.xml file and copy/paste the following content in it:


    
    
        nl.amis.sdo.jpa.services.HrSessionEJBBeanWSForward
        nl.amis.sdo.jpa.services.HrSessionEJBBeanWSForward
        oracle.j2ee.ws.server.WSForwardServlet
        
            to
            /HrSessionEJBBeanWS
        
    
    
        nl.amis.sdo.jpa.services.HrSessionEJBBean
        oracle.j2ee.ws.server.provider.ProviderServlet
        
            Oracle.JAX-WS.EjbLink
            ejb/HrSessionEJB
        
        
            Oracle.JAX-WS.ServiceEndpointBean
            nl.amis.sdo.jpa.services.HrSessionEJBBean
        
        1
    
    
        nl.amis.sdo.jpa.services.HrSessionEJBBean
        /HrSessionEJBBeanWS
    
    
        nl.amis.sdo.jpa.services.HrSessionEJBBeanWSForward
        /HrSessionEJBBeanWS/secure
    
    
        BASIC
    
    
        Admin
    
    
        
            nl.amis.sdo.jpa.services.HrSessionEJBBeanWS
            /HrSessionEJBBeanWS/secure
        
        
            Admin
        
        
            CONFIDENTIAL
        
    
    
        ejb/HrSessionEJB
        Session
        nl.amis.sdo.jpa.services.HrSessionEJB
        HrSessionEJB
    


If you're wondering how I defined the above web.xml file, I just took the content of a web.xml from an ADF-BC SDO generated WAR and modified it so that it matched my web service definition.

4) Then from that same generated ADF-BC SDO WAR file, I also copied the following files to the ModelSDO project directory under ‘public_html\WEB-INF’ (shown as Web Content/WEB-INF in JDeveloper):

	- oracle-webservices.xml
	- standard-webservices.xml
	
5) I also modified the content of both files so that they matched the definitions of my web service.

	For oracle-webservices.xml:
	
	

  EjbSdoService-ModelSDO-context-root
  
    true
    true
    
      
      
      
      
      
      
      
    
    
      false
      /HrSessionEJBBeanWS
    
    true
  


	Mind the content-root element (jbSdoService-ModelSDO-context-root), it the same as the one proposed by default when we created the WAR deployment profile.
	
	For standard-webservices.xml:
	
	

  
    {/nl.amis.sdo.jpa.services/}HrSessionEJBBeanWS
    WEB-INF/wsdl/nl/amis/sdo/jpa/services/HrSessionEJBBeanWS.wsdl
    
    
      HrSessionEJBBeanWS 
      ns0:HrSessionEJBBeanWS 
      ns1:HrSessionEJBBeanWSSoapHttpPort 
      false
      nl.amis.sdo.jpa.services.HrSessionEJB
      
        nl.amis.sdo.jpa.services.HrSessionEJBBean
      
    
  


	Mind that the element 'wsdl-file' points to the 'WEB-INF/wsdl'-directory, which doesn't exist yet.  This will be done in the next step.
	
6) First we need to copy the WSDL and XSD-files to the WEB-INF/wsdl directory, to do this we create a directory 'wsdl' under WEB-INF within JDeveloper.  Once the directory create we'll copy the WSDL and XSD-files from the 'src' directory of the ModelSDO project to the 'WEB-INF/wsdl' directory,
make sure the directory structure keeps intact. It should look like the following screenshot.

7) I also copied the SDO xsd specifications (origins from the commonj sdo library) from the generated ADF-BC SDO WAR file located under WEB-INF/wsdl/xml into our project.

Now the project should look like the following screenshot.  I didn't copy the ADF-BC xsd definitions as we don't use ADF-BC in our project.

8) Now the best part is the deployment of our EjbSdoService application and see if it is also exposed as a SOAP WebService so that we can invoke it from SoapUI.

If at runtime you receive the following weird exception (EclipseLink-45010):

Exception Description: A type could not be found for interface class [nl.amis.sdo.jpa.entities.EmployeesSDO]. Please make sure that the type has been defined.  In addition,  the interface classloader should be a member of the helper context classloader hierarchy:  it appears as if this is [false].

Then please go to the following url and do as explained there: https://forums.oracle.com/forums/thread.jspa?threadID=987232

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。