|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Suggestion for approach in finding the bookquote with least priceHi All,
Let us assume there are 2 bookstores (bookstoreA and bookstoreB) which expose CXF based web service to get the price of a book given the ISBN. (These are external applications.) The web application (let us call it *CustomerWebApp*) which needs to display the least price to the customer contacts the Mule based web application (Mule embedded ). [ *CustomerWebApp *invokes Mule based web application through a CXF inbound endpoint (using JAXWS)] Inturn the Mule based web application should contact bookstoreA and bookstoreB and return a single Book object (which has the least price) synchronously to CustomerWebApp. I have read the posts, webinar and wiki regarding proxy but I am not sure it will fit here as I need to return only one Book object in the SOAP response (after comparing the Books from bookstoreA and bookstore B). Can you please suggest the optimal approach in implementing the above scenario? Thanks, Karthikeyan C |
|
|
Re: Suggestion for approach in finding the bookquote with least priceThis is a classic case. 2 things to get you started:
Andrew |
|
|
Re: Suggestion for approach in finding the bookquote with least priceYou may want to study this example: http://www.mulesource.org/display/MULE2INTRO/Loan+Broker+Example
D.
On Fri, Jul 3, 2009 at 10:34 AM, Karthikeyan Chockalingam <bercolax@...> wrote:
|
|
|
Re: Suggestion for approach in finding the bookquote with least priceThanks 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> |
|
|
|
|
|
Re: Suggestion for approach in finding the bookquote with least priceThanks for the suggestion.
Is it possible to skip the invoke of implementation class of CXF inbound end-point (the component mentioned) without setting proxy="true" ? |
| Free embeddable forum powered by Nabble | Forum Help |