Oracle Composite – leftover oramds imports

On designtime we use the oramds to develop our processflows in our bpel processes.

Basically the composite.xml part for a bpel process would look like this :
[code language=”xml”]






[/code]

<component name="saveEmployee" version="1.0">
    <implementation.bpel src="BPEL/saveEmployee.bpel"/>
    <componentType>
      <service name="client_ep" ui:wsdlLocation="oramds:/apps/xsd/myapp/1.0/saveEmployee.wsdl">
        <interface.wsdl interface="http://mynamespace.nl/saveEmployee#wsdl.interface(bewaarB2bEmployeeServicePort)"/>
      </service>   

When you open the bpel in jdeveloper, jdeveloper will automatically add the next import to your .bpel file :
[code language=”xml”]

[/code]

The value from the ui:wsdlLocation-attribute is copied to the import/@location.
The ui:* attribute would suggest it’s only used for ui-related things (like the development in jdeveloper).

When we manually remove the whole import-element from the .bpel file and try a redeployment it will just deploy the composite. On runtime the service will also complete in a valid way so the import in the .bpel file is only used on designtime and not on runtime.

To have one central place for publishing artifacts and make them available for other interested parties (in our case other internal applications), we expose them by using a simple apache http server.

So in this case the uri “oramds:/apps/xsd/myapp/1.0/saveEmployee.wsdl” would also be retrievable at “htp://myapacheserver.nl/xsd/myapp/1.0/saveEmployee.wsdl”.

Since we only use the mds on designtime and use the apache location at runtime in the whole otap we need a simple cfgplan to change the locations in the artifacts.
When we generate a sample cfgplan (rightmouseclick on the composite.xml > Generate config plan), we will notice the .bpel file artifacts won’t get customized
The wsdlAndSchema section lists all the wsdls, schemas and jca files but no bpel files.
[code language=”xml”]





oramds:/apps/xsd
htp://myapacheserver.nl/xsd





oramds:/apps/xsd
htp://myapacheserver.nl/xsd



[/code]

When we look in the logfiles we see some errors coming by.
[code language=”java”]
info.log:[2016-02-25T16:58:01.928+01:00] [xxx-MS1] [WARNING] [] [oracle.fabric.common.wsdl] [tid: 127] [userId: weblogic] [ecid: 40869563-6b99-4a25-81a5-ed030a64e4df-00000001,0:2] [APP: soa-infra] Initial loading of WSDL at oramds://apps/xsd/myapp/1.0/saveEmployee.wsdl failed due to: Error in getting XML input stream: oramds:/apps/xsd/myapp/1.0/saveEmployee.wsdl: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded /apps/xsd/myapp/1.0/saveEmployee.wsdl does not exist.. Will retry the load using the metadata manager associated with the composite..
[/code]

So although the bpel itself just works it does try to resolve the oramds imports in the .bpel file (since those aren’t customized and still use oramds imports instead of http imports).

To remove the import from the bpel we use the the maven-antrun-plugin and the xmltask in ant to edit the .bpel file at the prepare-package phase.
[code language=”xml”]
org.apache.maven.plugins
maven-antrun-plugin
1.7


com.oopsconsultancy
xmltask
1.16


xalan
xalan
2.7.1



prepare-package
run













[/code]

We added the plugin to a parent pom so it will be active for all composite projects.
Since we also use some embedded java in the processes the xpath match should be on “//*[local-name()=’import’][@importType=’http://schemas.xmlsoap.org/wsdl/’]”.
Imports like
[code language=”xml”]

[/code]
won’t be removed.

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Comments are closed.