Integer variables are expected to be defined as INT inside the xquery mediators
-------------------------------------------------------------------------------
Key: SYNAPSE-197
URL: https://issues.apache.org/jira/browse/SYNAPSE-197
Project: Synapse
Issue Type: Bug
Components: Core
Affects Versions: 1.1
Environment: Ubuntu7.04, JDK1.5.0_12
Reporter: Evanthika Amarasiri
Fix For: 1.1.1-QA-B1
Created the following sequence and sent a request to a service which adds up
two integer values. When the variable type is defined as "INTEGER", I received
an exception saying that the type specified is unsupported. See below for the
exception. When INTEGER was replaced by INT, the configuration was successful.
<sequence name="xquery_calc">
<in>
<xquery key="xquery-key-req-add">
<variable xmlns:m0="http://calc.math.com"
xmlns:ns1="http://org.apache.synapse/xsd"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" name="x"
expression="self::node()//m0:add/m0:x/child::text()" type="INTEGER"/>
<variable xmlns:m0="http://calc.math.com"
xmlns:ns1="http://org.apache.synapse/xsd"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" name="y"
expression="self::node()//m0:add/m0:y/child::text()" type="INTEGER"/>
</xquery>
<send>
<endpoint>
<address uri="http://localhost:9000/soap/Calculator"/>
</endpoint>
</send>
</in>
<out>
<xquery key="xquery-key-res-add">
<variable xmlns:m0="http://calc.math.com"
xmlns:ns1="http://org.apache.synapse/xsd"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" name="return"
expression="//m0:addResponse/m0:return/child::text()" type="INTEGER"/>
</xquery>
<send/>
</out>
</sequence>
Exception thrown
==============
2007-12-18 11:42:27,572 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Start : XQuery mediator
2007-12-18 11:42:27,572 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Performing XQuery using query resource with key :
xquery-key-req-add
2007-12-18 11:42:27,576 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Creating a connection from the XQDataSource
2007-12-18 11:42:27,577 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Picked up the xquery source
declare namespace m0="http://calc.math.com";
declare namespace xs="http://www.w3.org/2001/XMLSchema";
declare variable $x as xs:integer external;
declare variable $y as xs:integer external;
<m0:add xmlns:m0="http://calc.math.com">
<m0:x>{$x+$x*10}</m0:x>
<m0:y>{$y+$y*10}</m0:y>
</m0:add>
from the key xquery-key-req-add
2007-12-18 11:42:27,577 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Prepare an expression for the query
2007-12-18 11:42:27,596 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Binding external variables to the DynamicContext
2007-12-18 11:42:27,597 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] DEBUG
XQueryMediator Binding a variable to the DynamicContext with a name : x and a
value : [EMAIL PROTECTED]
2007-12-18 11:42:27,598 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] ERROR
XQueryMediator Unsupported type for the binding type14 in the variable name x
2007-12-18 11:42:27,604 [10.100.1.97-testc-ubuntu] [HttpServerWorker-10] ERROR
XQueryMediator Unable to execute the query
declare namespace m0="http://calc.math.com";
declare namespace xs="http://www.w3.org/2001/XMLSchema";
declare variable $x as xs:integer external;
declare variable $y as xs:integer external;
<m0:add xmlns:m0="http://calc.math.com">
<m0:x>{$x+$x*10}</m0:x>
<m0:y>{$y+$y*10}</m0:y>
</m0:add>
org.apache.synapse.SynapseException: Unsupported type for the binding type14
in the variable name x
at
org.apache.synapse.mediators.xquery.XQueryMediator.handleException(XQueryMediator.java:561)
at
org.apache.synapse.mediators.xquery.XQueryMediator.bindVariable(XQueryMediator.java:514)
at
org.apache.synapse.mediators.xquery.XQueryMediator.performQuery(XQueryMediator.java:245)
at
org.apache.synapse.mediators.xquery.XQueryMediator.mediate(XQueryMediator.java:134)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
at
org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:60)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:122)
at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:171)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:122)
at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:154)
at
org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:89)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at
org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:219)
at
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:183)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]