Over at the Amis weblog Sjoerd Michels has posted some example code illustrating how you can read values from an xml document into ant: Using Ant to inspect Connection Properties in WSDL Files that are generated by Oracle SOA Suite Adapters . This can be very handy at times when you are automating deployment of for example esb projects in ant.
I recently solved a similar problem, but using some standard ant features. Actually, i just found this solution in a build file generated by jdeveloper for a bpel project, and used it to determine the guid of an esb component.
The definition of every esb component is stored in an xml document with the extension .esbsvc. Here’s an example of the first few lines of such a file:
<service name="RelatieServiceRouter"
guid="7BB43571367A11DCBFA3770D27346396"
qname="DefaultSystem.RelatieServiceRouter"
status="ENABLED"
serviceType="RoutingService"
typeDescription="Routing Service"
isWSDLEditable="false"
soapEndpointStatus="ENABLED" dirty="true">
<versioninfo>
<id>1186037612567</id>
If you want to undeploy an esb component you need the guid. Using xml properties you can easily determine the guid in ant:
<xmlproperty file="DefaultSystem_RelatieServiceRouter.esbsvc"/>
<property name="relatierouter.guid" value="${service(guid)}"/>
<undeploy -esb guid="${relatierouter.guid}"/>
As you can see, you can target specific elements and attributes in your xml document. It’s not as powerfull as xpath, but often it’s good enough to do the job. More info in the ant documentation: XmlProperty. Btw, Undeploy-esb is just a macro which calls an ant esb task to undeploy the esb entity.

August 17th, 2007 at 13:31:46
[...] Original post by Andrej Koelewijn [...]
September 8th, 2007 at 01:42:35
[...] From it-eye.nl [...]