Please try out the attached proxy service.

If the Enrich mediator is not used, the response is as follows:

<ns:getSimpleQuoteResponse xmlns:ns="http://services.samples";>
         <ns:return xsi:type="ax21:GetQuoteResponse" xmlns:ax21="
http://services.samples/xsd"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>
            <ax21:change>-2.407460746099086</ax21:change>
            <ax21:earnings>13.802728019668734</ax21:earnings>
            <ax21:high>-64.20614218869392</ax21:high>
            *<ax21:last>64.68069669817943</ax21:last>*
            <ax21:lastTradeTimestamp>Tue May 15 14:19:25 IST
2012</ax21:lastTradeTimestamp>
            <ax21:low>66.6183213497676</ax21:low>
            <ax21:marketCap>-4102083.3154438296</ax21:marketCap>
            <ax21:name>IBM
         Company</ax21:name>
            <ax21:open>67.15772576031871</ax21:open>
            <ax21:peRatio>-18.067448665574926</ax21:peRatio>

<ax21:percentageChange>3.8247906308536113</ax21:percentageChange>
            <ax21:prevClose>-62.943595570400994</ax21:prevClose>
            <ax21:symbol>IBM</ax21:symbol>
            <ax21:volume>9444</ax21:volume>
            *<ax21:last>146.25431375681012</ax21:last>*
*            <ax21:last>91.35472786486967</ax21:last>*
         </ns:return>
      </ns:getSimpleQuoteResponse>


The "last" elements of the 2nd & 3rd response have been appended to the
entire response of the first response.

However, if you enable Enrich, then we get the expected response.

<ax21:last xmlns:ax21="http://services.samples/xsd
">182.77665583981906</ax21:last>
 <ax21:last xmlns:ax21="http://services.samples/xsd
">76.39416781337772</ax21:last>
 <ax21:last xmlns:ax21="http://services.samples/xsd
">174.62760689447015</ax21:last>

Why doesn't the Aggregate mediator handle this on its own? Is it a bug?

-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse"; name="ScatterGatherProxy" transports="https http" startOnLoad="true" trace="disable">
    <description/>
    <target>
        <inSequence>
            <clone>
                <target>
                    <endpoint name="vendorA">
                        <address uri="http://localhost:9000/services/SimpleStockQuoteService/"/>
                    </endpoint>
                </target>
                <target>
                    <endpoint name="vendorB">
                        <address uri="http://localhost:9000/services/SimpleStockQuoteService/"/>
                    </endpoint>
                </target>
                <target>
                    <endpoint name="vendorC">
                        <address uri="http://localhost:9000/services/SimpleStockQuoteService/"/>
                    </endpoint>
                </target>
            </clone>
        </inSequence>
        <outSequence>
            <!--enrich>
                <source xmlns:m1="http://services.samples/xsd"; clone="true" xpath="//m1:last"/>
                <target type="body"/>
            </enrich-->
            <aggregate>
                <completeCondition>
                    <messageCount min="3" max="-1"/>
                </completeCondition>
                <onComplete xmlns:m1="http://services.samples/xsd"; xmlns:m0="http://services.samples"; expression="//m1:last">
                    <send/>
                </onComplete>
            </aggregate>
        </outSequence>
    </target>
    <publishWSDL>
        <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:ns1="http://org.apache.axis2/xsd"; xmlns:ns="http://services.samples"; xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:ax21="http://services.samples/xsd"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; targetNamespace="http://services.samples";>
            <wsdl:documentation>SimpleStockQuoteService</wsdl:documentation>
            <wsdl:types>
                <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.samples/xsd";>
                    <xs:complexType name="PlaceOrder">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="price" type="xs:double"/>
                            <xs:element minOccurs="0" name="quantity" type="xs:int"/>
                            <xs:element minOccurs="0" name="symbol" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetQuoteResponse">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="change" type="xs:double"/>
                            <xs:element minOccurs="0" name="earnings" type="xs:double"/>
                            <xs:element minOccurs="0" name="high" type="xs:double"/>
                            <xs:element minOccurs="0" name="last" type="xs:double"/>
                            <xs:element minOccurs="0" name="lastTradeTimestamp" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="low" type="xs:double"/>
                            <xs:element minOccurs="0" name="marketCap" type="xs:double"/>
                            <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="open" type="xs:double"/>
                            <xs:element minOccurs="0" name="peRatio" type="xs:double"/>
                            <xs:element minOccurs="0" name="percentageChange" type="xs:double"/>
                            <xs:element minOccurs="0" name="prevClose" type="xs:double"/>
                            <xs:element minOccurs="0" name="symbol" nillable="true" type="xs:string"/>
                            <xs:element minOccurs="0" name="volume" type="xs:int"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetQuote">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="symbol" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetMarketActivity">
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" name="symbols" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetMarketActivityResponse">
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" name="quotes" nillable="true" type="ax21:GetQuoteResponse"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetFullQuote">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="symbol" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="GetFullQuoteResponse">
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" minOccurs="0" name="tradeHistory" nillable="true" type="ax21:TradingDay"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:complexType name="TradingDay">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="day" type="xs:int"/>
                            <xs:element minOccurs="0" name="quote" nillable="true" type="ax21:GetQuoteResponse"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:schema>
                <xs:schema xmlns:ax22="http://services.samples/xsd"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.samples";>
                    <xs:import namespace="http://services.samples/xsd"/>
                    <xs:element name="placeOrder">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="order" nillable="true" type="ax21:PlaceOrder"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getSimpleQuote">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="symbol" nillable="true" type="xs:string"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getSimpleQuoteResponse">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:GetQuoteResponse"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="SimpleStockQuoteServiceException">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="SimpleStockQuoteServiceException" nillable="true" type="ns:Exception"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:complexType name="Exception">
                        <xs:sequence>
                            <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string"/>
                        </xs:sequence>
                    </xs:complexType>
                    <xs:element name="getQuote">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="request" nillable="true" type="ax21:GetQuote"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getQuoteResponse">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:GetQuoteResponse"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getMarketActivity">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="request" nillable="true" type="ax21:GetMarketActivity"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getMarketActivityResponse">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:GetMarketActivityResponse"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getFullQuote">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="request" nillable="true" type="ax21:GetFullQuote"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="getFullQuoteResponse">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element minOccurs="0" name="return" nillable="true" type="ax21:GetFullQuoteResponse"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:schema>
            </wsdl:types>
            <wsdl:message name="getQuoteRequest">
                <wsdl:part name="parameters" element="ns:getQuote"/>
            </wsdl:message>
            <wsdl:message name="getQuoteResponse">
                <wsdl:part name="parameters" element="ns:getQuoteResponse"/>
            </wsdl:message>
            <wsdl:message name="SimpleStockQuoteServiceException">
                <wsdl:part name="parameters" element="ns:SimpleStockQuoteServiceException"/>
            </wsdl:message>
            <wsdl:message name="getMarketActivityRequest">
                <wsdl:part name="parameters" element="ns:getMarketActivity"/>
            </wsdl:message>
            <wsdl:message name="getMarketActivityResponse">
                <wsdl:part name="parameters" element="ns:getMarketActivityResponse"/>
            </wsdl:message>
            <wsdl:message name="getFullQuoteRequest">
                <wsdl:part name="parameters" element="ns:getFullQuote"/>
            </wsdl:message>
            <wsdl:message name="getFullQuoteResponse">
                <wsdl:part name="parameters" element="ns:getFullQuoteResponse"/>
            </wsdl:message>
            <wsdl:message name="getSimpleQuoteRequest">
                <wsdl:part name="parameters" element="ns:getSimpleQuote"/>
            </wsdl:message>
            <wsdl:message name="getSimpleQuoteResponse">
                <wsdl:part name="parameters" element="ns:getSimpleQuoteResponse"/>
            </wsdl:message>
            <wsdl:message name="placeOrderRequest">
                <wsdl:part name="parameters" element="ns:placeOrder"/>
            </wsdl:message>
            <wsdl:portType name="SimpleStockQuoteServicePortType">
                <wsdl:operation name="getQuote">
                    <wsdl:input message="ns:getQuoteRequest" wsaw:Action="urn:getQuote"/>
                    <wsdl:output message="ns:getQuoteResponse" wsaw:Action="urn:getQuoteResponse"/>
                    <wsdl:fault message="ns:SimpleStockQuoteServiceException" name="SimpleStockQuoteServiceException" wsaw:Action="urn:getQuoteSimpleStockQuoteServiceException"/>
                </wsdl:operation>
                <wsdl:operation name="getMarketActivity">
                    <wsdl:input message="ns:getMarketActivityRequest" wsaw:Action="urn:getMarketActivity"/>
                    <wsdl:output message="ns:getMarketActivityResponse" wsaw:Action="urn:getMarketActivityResponse"/>
                </wsdl:operation>
                <wsdl:operation name="getFullQuote">
                    <wsdl:input message="ns:getFullQuoteRequest" wsaw:Action="urn:getFullQuote"/>
                    <wsdl:output message="ns:getFullQuoteResponse" wsaw:Action="urn:getFullQuoteResponse"/>
                </wsdl:operation>
                <wsdl:operation name="getSimpleQuote">
                    <wsdl:input message="ns:getSimpleQuoteRequest" wsaw:Action="urn:getSimpleQuote"/>
                    <wsdl:output message="ns:getSimpleQuoteResponse" wsaw:Action="urn:getSimpleQuoteResponse"/>
                </wsdl:operation>
                <wsdl:operation name="placeOrder">
                    <wsdl:input message="ns:placeOrderRequest" wsaw:Action="urn:placeOrder"/>
                </wsdl:operation>
            </wsdl:portType>
            <wsdl:binding name="SimpleStockQuoteServiceSoap11Binding" type="ns:SimpleStockQuoteServicePortType">
                <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
                <wsdl:operation name="getMarketActivity">
                    <soap:operation soapAction="urn:getMarketActivity" style="document"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getQuote">
                    <soap:operation soapAction="urn:getQuote" style="document"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap:body use="literal"/>
                    </wsdl:output>
                    <wsdl:fault name="SimpleStockQuoteServiceException">
                        <soap:fault use="literal" name="SimpleStockQuoteServiceException"/>
                    </wsdl:fault>
                </wsdl:operation>
                <wsdl:operation name="getFullQuote">
                    <soap:operation soapAction="urn:getFullQuote" style="document"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getSimpleQuote">
                    <soap:operation soapAction="urn:getSimpleQuote" style="document"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="placeOrder">
                    <soap:operation soapAction="urn:placeOrder" style="document"/>
                    <wsdl:input>
                        <soap:body use="literal"/>
                    </wsdl:input>
                </wsdl:operation>
            </wsdl:binding>
            <wsdl:binding name="SimpleStockQuoteServiceSoap12Binding" type="ns:SimpleStockQuoteServicePortType">
                <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
                <wsdl:operation name="getMarketActivity">
                    <soap12:operation soapAction="urn:getMarketActivity" style="document"/>
                    <wsdl:input>
                        <soap12:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap12:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getQuote">
                    <soap12:operation soapAction="urn:getQuote" style="document"/>
                    <wsdl:input>
                        <soap12:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap12:body use="literal"/>
                    </wsdl:output>
                    <wsdl:fault name="SimpleStockQuoteServiceException">
                        <soap12:fault use="literal" name="SimpleStockQuoteServiceException"/>
                    </wsdl:fault>
                </wsdl:operation>
                <wsdl:operation name="getFullQuote">
                    <soap12:operation soapAction="urn:getFullQuote" style="document"/>
                    <wsdl:input>
                        <soap12:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap12:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getSimpleQuote">
                    <soap12:operation soapAction="urn:getSimpleQuote" style="document"/>
                    <wsdl:input>
                        <soap12:body use="literal"/>
                    </wsdl:input>
                    <wsdl:output>
                        <soap12:body use="literal"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="placeOrder">
                    <soap12:operation soapAction="urn:placeOrder" style="document"/>
                    <wsdl:input>
                        <soap12:body use="literal"/>
                    </wsdl:input>
                </wsdl:operation>
            </wsdl:binding>
            <wsdl:binding name="SimpleStockQuoteServiceHttpBinding" type="ns:SimpleStockQuoteServicePortType">
                <http:binding verb="POST"/>
                <wsdl:operation name="getMarketActivity">
                    <http:operation location="getMarketActivity"/>
                    <wsdl:input>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:input>
                    <wsdl:output>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getQuote">
                    <http:operation location="getQuote"/>
                    <wsdl:input>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:input>
                    <wsdl:output>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getFullQuote">
                    <http:operation location="getFullQuote"/>
                    <wsdl:input>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:input>
                    <wsdl:output>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="getSimpleQuote">
                    <http:operation location="getSimpleQuote"/>
                    <wsdl:input>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:input>
                    <wsdl:output>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="placeOrder">
                    <http:operation location="placeOrder"/>
                    <wsdl:input>
                        <mime:content type="text/xml" part="parameters"/>
                    </wsdl:input>
                </wsdl:operation>
            </wsdl:binding>
            <wsdl:service name="SimpleStockQuoteService">
                <wsdl:port name="SimpleStockQuoteServiceHttpSoap11Endpoint" binding="ns:SimpleStockQuoteServiceSoap11Binding">
                    <soap:address location="http://azmac.local:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpSoap11Endpoint"/>
                </wsdl:port>
                <wsdl:port name="SimpleStockQuoteServiceHttpsSoap11Endpoint" binding="ns:SimpleStockQuoteServiceSoap11Binding">
                    <soap:address location="https://azmac.local:9002/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpsSoap11Endpoint"/>
                </wsdl:port>
                <wsdl:port name="SimpleStockQuoteServiceHttpSoap12Endpoint" binding="ns:SimpleStockQuoteServiceSoap12Binding">
                    <soap12:address location="http://azmac.local:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpSoap12Endpoint"/>
                </wsdl:port>
                <wsdl:port name="SimpleStockQuoteServiceHttpsSoap12Endpoint" binding="ns:SimpleStockQuoteServiceSoap12Binding">
                    <soap12:address location="https://azmac.local:9002/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpsSoap12Endpoint"/>
                </wsdl:port>
                <wsdl:port name="SimpleStockQuoteServiceHttpEndpoint" binding="ns:SimpleStockQuoteServiceHttpBinding">
                    <http:address location="http://azmac.local:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpEndpoint"/>
                </wsdl:port>
                <wsdl:port name="SimpleStockQuoteServiceHttpsEndpoint" binding="ns:SimpleStockQuoteServiceHttpBinding">
                    <http:address location="https://azmac.local:9002/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpsEndpoint"/>
                </wsdl:port>
            </wsdl:service>
        </wsdl:definitions>
    </publishWSDL>
</proxy>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to