« July 16, 2007 | Main | July 20, 2007 »

July 18, 2007 Archives

July 18, 2007

Tokenizing WSDL imports while deploying to mutliple environments

Your BPEL Process might have one or more WSDLs that import another WSDL or an XSD from the server. This might result in hardcoded URLs in your WSDL - for instance


<definitions ....>


   <import namespace="http://www.oracle.com/po" location="http://localhost:7779/schemas/xml/createpo.wsdl"/>


  . ....


 </definitions>


 


When you are deploying to multiple environments, you might want to change the host and port for the URL that points to this WSDL, so that it points to the current server, or whatever you wish to use.


There is useful task named <customizeWSDL> that allows you to do this.


For this, follow the same instructions I had mentioned in the earlier blog entry for deployment to multiple environments,but with the following difference.


Instead of the <customize> task, use the <customizeWSDL> task


For e.g.


         <bpelc>


               . . . . .


          <customizeWSDL  inFile="${process.dir}/bpel/PurchaseOrder.wsdl" outFile="${process.dir}/bpel/PurchaseOrder.wsdl">    
           <wsdlImport namespace="http://www.oracle.com/po" locationURI="http://${deploy_host}:${deploy_port}/schemas/xml/createpo.wsdl"/>              
           </customizeWSDL>


        </bpelc>


 

Subtracting 2 dateTime values into a duration using XPath 2.0

Here is a simple XSLT that allows you to subtract two xsd:dateTime values into a xsd:duration value.


The given XSLT uses XPath 2.0. Hence to get it to work, ensure that the "version" attribute on the <xsl:stylesheet> element is set to "2.0". I have used Oracle BPEL 10.1.3.1 for this illustration.


XSL Source


<xsl:stylesheet version="2.0" xmlns:ns1="http://www.output.org"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:ns0="http://www.input.org"
                exclude-result-prefixes="xsl xsd ns0 ns1">
  <xsl:template match="/">
    <ns1:output>
      <ns1:durationValue>
        <xsl:value-of select="(xsd:dateTime(/ns0:input/ns0:date1) - xsd:dateTime(/ns0:input/ns0:date2))"/>
      </ns1:durationValue>
    </ns1:output>
  </xsl:template>
</xsl:stylesheet>


Input


<?xml version="1.0" encoding="UTF-8" ?>
<input xmlns="http://www.input.org">
   <date1>2007-07-17T12:50:28.256</date1>
   <date2>2007-07-18T12:52:28.257</date2>
</input>


Output


<?xml version = '1.0' encoding = 'UTF-8'?>
<ns1:output xmlns:ns1="http://www.output.org">
   <ns1:durationValue>-P1DT2M0.1S</ns1:durationValue>
</ns1:output>


 

About July 2007

This page contains all entries posted to Ramkumar Menon's Blog in July 2007. They are listed from oldest to newest.

July 16, 2007 is the previous archive.

July 20, 2007 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle