Thanks for the input. I have gone through the LoanBroker example and have also implemented the lowest book price quote in a similar fashion (which works and yields the desired result).
The Book quote differs in that it has two consecutive layers of webservice invocation (Loan Broker does not have 2 layers of consecutive CXF invocation)
- The point which i am not sure if it is the right way of doing things in my implementation (code provided below) is the invocation of BookPriceServiceImpl component (The input to the webservice is the ISBN String.) as I have to return a Book as per the contract as in the below Java code.
As we see I have to return a Book object instead of just the ISBN String for follow up CXF invocations of BookStoreA and BookStoreB which take only the ISBN String. So again a transformation of Book--> String is required which may be redundant.
I may be implementing it in the wrong manner as I am a Mule begineer. Kindly suggest if there are better ways.
package com.ta.bscentral.wsimpl;
import com.ta.bscentral.ws.BookPriceService;
import com.ts.dto.Book;
import javax.jws.WebService;
@WebService(serviceName="BookPriceService", endpointInterface="com.ta.bscentral.ws.BookPriceService")
public class BookPriceServiceImpl implements BookPriceService {
@Override
public Book getLowestPrice(String isbn) {
Book book=new Book();
book.setIsbn(isbn);
return book;
}
}
My Mule config file looks as below.
<service name="LowestPriceService">
<inbound>
<inbound-endpoint address="cxf:
http://0.0.0.0:8777/bplow/services/BookPriceService" synchronous="true"/>
</inbound>
<component>
<singleton-object class="com.ta.bscentral.wsimpl.BookPriceServiceImpl" />
</component>
<outbound>
<multicasting-router>
<jms:outbound-endpoint queue="bookstoreA" synchronous="false"/>
<jms:outbound-endpoint queue="bookstoreB" synchronous="false"/>
<reply-to address="resultq" />
</multicasting-router>
</outbound>
<async-reply timeout="20000">
<inbound-endpoint ref="resultq" />
<custom-async-reply-router class="com.ta.mule.LowestPriceResponseAggregator" />
</async-reply>
</service>