October 25, 2010

"ORAMED-01003:[Invalid assign source expression]Invalid source used while assigning"

Problem:

I did an "Assign Value" in a Mediator component as follows. Basically, what this does is use an XPath condition to choose from 1 of 2 endpoints and then override the endpointURI, thus mimicking dynamic routing.

From:
if ('1' = '1') then ' http://server1:8001/wsdl1' else ' http://server2:8001/wsdl2'
To:
property: endpointURI
Unfortunately, at runtime, I received the following error:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header/>
  <env:Body>
    <env:Fault>
      <faultcode>env:Server</faultcode>
      <faultstring> oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01003:[Invalid assign source expression]Invalid source used while assigning. Check if source expression are valid. ["if ('1' = '1') then '
http://server1:8001/wsdl1' else 'http://server2:8001/wsdl2'"]Possible Fix:Modify source for valid expression
      </faultstring>      <faultactor/>      <detail>
        <exception/>
      </detail>
    </env:Fault>
  </env:Body>
</env:Envelope>

Solution:

For some reason, the "Assign Values" field does not support certain XPath features, such as conditions.

To work around this, I moved the statement to my XSL as follows:
<xsl:choose>
  <xsl:when test="'1' = '1'">
    <xsl:variable name="LocationOut"
 select="mhdr:setProperty('out.property.endpointURI','http://server1:8001/wsdl1')"/>
  </xsl:when>
  <xsl:otherwise>
    <xsl:variable name="LocationOut"
 select="mhdr:setProperty('out.property.endpointURI','http://server2:8001/wsdl2')"/>
  </xsl:otherwise>
</xsl:choose>

Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.3)

5 comments:

  1. link 12bet Casino in Vie Casino
    Vie happyluke Casino. Vie Casino is the only place you can go 12bet to play games and win cash without making any losses! Sign Up Today and Claim matchpoint a Welcome Bonus!

    ReplyDelete
  2. How To Download The Super Slots Mobile App - JTG Hub
    Download 동두천 출장샵 the app from 양산 출장안마 the App Store and enjoy playing the 여주 출장마사지 games and 하남 출장안마 apps on your iPhone or iPad. 부천 출장안마 You'll be able to customize the games

    ReplyDelete