Pages

Monday, November 14, 2011

Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g.


Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g:

Because of the container change from 10g to 11g, the web services developed in 10g has to be migrated to latest format.

The main step for the migration is changing the deployment descriptors created for OC4J to vendor specific descriptor format.


Steps to migrate the JAVA web services from Oracle SOA Suite 10g to 11g:

1. Change the Web.xml (<Webservice Home>/public_html/WEB-INF) contents:-
Replace the below contents in the web.xml.
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns: xsi=http://www.w3.org/2001/XMLSchema-instance xsi: schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version="2.4">
With the following contents
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns: xsi=http://www.w3.org/2001/XMLSchema-instance xsi: schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd version="2.5">
In 10g:-



In 11g:-



2. Create the deployment descriptor file weblogic-webservices.xml

Create the weblogic-webservices.xml in the following location<Webservice Home>/public_html/WEB-INF
<? xml version='1.0' encoding='UTF-8'?>
<weblogic-webservices xmlns="http://www.bea.com/ns/weblogic/weblogic-webservices"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-webservices/1.0/weblogic-webservices.xsd"><webservice-description>
<webservice-description-name>CrossRefService</webservice-description-name>
<port-component>
<port-component-name>CrossRefServiceSplitOrderSOAPPort</port-component-name>
<service-endpoint-address>
<webservice-contextpath>/CrossRefService</webservice-contextpath>
<webservice-serviceuri>/CrossRefService</webservice-serviceuri>
</service-endpoint-address>
</port-component>
</webservice-description>
</weblogic-webservices>
Change the value of the following tags <webservice-description-name> and <port-component-name> with the value of corresponding tags from oracle-webservice.xml.

Configure the value of <webservice-contextpath> and <webservice-serviceuri> as the value of <webservice-description-name> (append "/"in front of the name as shown in the sample file)

In 10g:-



In 11g:-




3. Change the soapAction in the wsdl (<Webservice Home>/public_html/WEB-INF/wsdl) file.
If the soapAction has configured as soapAction="urn:#NewOperation" then change the soapAction as soapAction=" " otherwise invalid soapAction error will be thrown at runtime. The soapAction is not used by the latest version anymore.
In 10g:-




In 11g:-




4. 10g to 11g JAXB class issue.

If we are using the existing JAXB classes generated by 10g and reusing the same in 11g without regenerating it then we would need to ensure following changes are implemented in 10G JAXB source.
If the JAXB class refer the other JAXB class as array of elements as mentioned below

In 10g:-



Initialize the array element as shown below otherwise the request will not be passed properly to the webservice.

In 11g:-




5. Delete all the OC4J related configuration files from the webservice application such as oracle-webservices.xml from the following location /public_html/WEB-INF.


6. Deploy the application to the server and test the webservice.

7. Make sure the request send to the webservice is in the same namespace as what the webservice expects. In 10g the namespace of the request will not be validated but 11g validates the namespace, if the namespace mismatch’s, the request will not be received by the webservice properly.






1 comment: