De: Amila Suriarachchi [mailto:am...@wso2.com] 
Enviado el: martes, 02 de agosto de 2011 11:12
Para: Jorge Infante Osorio
CC: carbon-dev@wso2.org
Asunto: Re: Unable to perform XSLT transformation in Integrate Rules with
SOA tutorial


On Tue, Aug 2, 2011 at 7:30 PM, Jorge Infante Osorio <jorg...@uci.cu> wrote:
I don´t have the previous BRS version.
The problem is with the message that came from BRS?

yes. it is different from the BRS 1.1.0 and 1.2.0. The xslt is written suite
for 1.1.0. 
Infact this is a bug in 1.1.0 and we have fixed with 1.2.0.

you can change the xslt as given in this article[1].

Thanks Amila, I found the differentiate between messages so I made the
chance in the xslt and in the first enrich mediator too.
I would be great if the tutorial can be update with the necessary changes
for BRS 1.2.0

Also in the sample_1.zip file , in the README file, in the sections 1 and 2
it´s not specified the result type sample.rule.pojo.Customer so the service
just have an input message. In the aar file it´s ok, but not in this
instructions.

Now with the change you suggested  it work just fine. Great work.

Jorge.

thanks,
Amila.

[1]
http://wso2.org/library/articles/2011/06/securing-web-service-integration 

This is the message out from BRS PriceCalculatorService:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
  <soapenv:Header />
  <soapenv:Body>
     <brs:CalculatePriceResponse xmlns:brs="http://wso2.org/sample/rule";>
        <brs:Order xmlns:ax26="http://pojo.rule.sample/xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="ax26:Order">
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>50.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>60.0</ax26:price>
              <ax26:type>TypeB</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>70.0</ax26:price>
              <ax26:type>TypeC</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>80.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>80.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:orderID>Order1</ax26:orderID>
           <ax26:price>316.70000000000005</ax26:price>
        </brs:Order>
        <brs:Order xmlns:ax26="http://pojo.rule.sample/xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:type="ax26:Order">
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>50.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>60.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>70.0</ax26:price>
              <ax26:type>TypeC</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>80.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:items xsi:type="ax26:Item">
              <ax26:price>80.0</ax26:price>
              <ax26:type>TypeA</ax26:type>
           </ax26:items>
           <ax26:orderID>Order2</ax26:orderID>
           <ax26:price>314.90000000000003</ax26:price>
        </brs:Order>
     </brs:CalculatePriceResponse>
  </soapenv:Body>
</soapenv:Envelope>
Saludos,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
Fac. 5.
UCI.
De: Amila Suriarachchi [mailto:am...@wso2.com]
Enviado el: martes, 02 de agosto de 2011 5:14
Para: Jorge Infante Osorio
CC: carbon-dev@wso2.org
Asunto: Re: Unable to perform XSLT transformation in Integrate Rules with
SOA tutorial

Can you please try with the BRS 1.1.0 as given in the article?

thanks,
Amila.
On Tue, Aug 2, 2011 at 12:57 PM, Jorge Infante Osorio <jorg...@uci.cu>
wrote:
Hi folks.

BRS: 1.2.0
ESB: 4.0.0

I´m working in this tutorial: “Integrate Rules with SOA” and in the sequence
CustomerOrderOutSequence I have this error:

TID: [] [WSO2 ESB] [2011-08-02 03:02:46,386] ERROR
{org.apache.synapse.mediators.transform.XSLTMediator} -  Unable to perform
XSLT transformation using : Value {name ='null', keyValue
='conf:/xslt/OrderSelectorInputTransfer.xslt'} against source XPath :
s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1]
{org.apache.synapse.mediators.transform.XSLTMediator}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException:
Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
                at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
                at
org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocument
Impl.java:109)
                at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuil
der.java:570)
                at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuil
der.java:566)
                at
org.apache.synapse.util.jaxp.StreamResultBuilder.getNode(StreamResultBuilder
.java:87)
                at
org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator
.java:295)
                at
org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.jav
a:191)
                at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediat
or.java:60)
                at
org.apache.synapse.config.xml.AnonymousListMediator.mediate(AnonymousListMed
iator.java:30)
                at
org.apache.synapse.config.xml.SwitchCase.mediate(SwitchCase.java:66)
                at
org.apache.synapse.mediators.filters.SwitchMediator.mediate(SwitchMediator.j
ava:108)
                at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediat
or.java:60)
                at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.
java:114)
                at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2Syn
apseEnvironment.java:219)
                at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseC
allbackReceiver.java:364)
                at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbac
kReceiver.java:159)
                at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
                at
org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:274)
                at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerP
ool.java:173)
                at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
                at java.lang.Thread.run(Thread.java:619)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
                at
com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686)
                at
com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
                at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040
)
                at
com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
                at
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamRead
erWrapper.java:225)
                at
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java
:681)
                at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
                ... 21 more
TID: [] [WSO2 ESB] [2011-08-02 03:02:46,402]  INFO
{org.apache.synapse.mediators.builtin.LogMediator} -  To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
MessageID: urn:uuid:87d96a7c-95c3-4bd1-9c78-bbc9da46adc2, Direction:
response, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0,
ERROR_MESSAGE = Unable to perform XSLT transformation using : Value {name
='null', keyValue ='conf:/xslt/OrderSelectorInputTransfer.xslt'} against
source XPath : s11:Body/child::*[position()=1] |
s12:Body/child::*[position()=1], Envelope: <?xml version='1.0'
encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Body><brs:C
alculatePriceResponse xmlns:brs="http://wso2.org/sample/rule";><brs:Order
xmlns:ax26="http://pojo.rule.sample/xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="ax26:Order"><ax26:items
xsi:type="ax26:Item"><ax26:price>50.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>60.0</ax26:price><ax26:type>TypeB</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>70.0</ax26:price><ax26:type>TypeC</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>80.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>80.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:orderID>Order1</ax26:orderID><ax26:price>316.7000000000
0005</ax26:price></brs:Order><brs:Order
xmlns:ax26="http://pojo.rule.sample/xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="ax26:Order"><ax26:items
xsi:type="ax26:Item"><ax26:price>50.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>60.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>70.0</ax26:price><ax26:type>TypeC</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>80.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:items
xsi:type="ax26:Item"><ax26:price>80.0</ax26:price><ax26:type>TypeA</ax26:typ
e></ax26:items><ax26:orderID>Order2</ax26:orderID><ax26:price>314.9000000000
0003</ax26:price></brs:Order></brs:CalculatePriceResponse></soapenv:Body></s
oapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

I use a PostgreSQL database so this is my DBlookup mediator:

            <dblookup>
                <connection>
                    <pool>
                        <password>###</password>
                        <user>postgres</user>
                       
<url>jdbc:postgresql://127.0.0.1:5432/DATASERVICE_SAMPLE</url>
                        <driver>org.postgresql.Driver</driver>
                    </pool>
                </connection>
                <statement>
                    <sql> SELECT "RATING_C", "MAX_AMOUNT_C" FROM
"CUSTOMER_T" where "NAME_C" = ?
                    /sql>
                    <parameter expression="get-property('name')"
type="VARCHAR"/>
                    <result name="maxAmount" column="MAX_AMOUNT_C"/>
                    <result name="rating" column="RATING_C"/>
                </statement>
            </dblookup>

Any idea?

Saludos,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
Fac. 5.
UCI.




_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to