开发者

Generate a webservice on the fly (dynamically) - How to?

Here's a scenario:

I have a webservice, let's call this StockQuoteService deployed on tomcat (axis). There is this method getStockQuote() exposed via this webservice.

Now, I would like to build a GUI tool which would build a webservice called StockQuoteServiceEx on the fly. The new webservice would expose the same methods as S开发者_C百科tockQuoteService. However, when getStockQuote() is invoked on StockQuoteServiceEx, this method act like a webservices client, thereby invoking getStockQuote() on StockQuoteService, obtaining the result from it. The purpose of doing this is in manipulating(data masked/shuffled/encrypted) the original result.

Once the webservice is generated, existing clients would update end points from StockQuoteService to StockQuoteServiceEx. So, the question here is, what would be the steps to dynamically generating a web service on the fly?


Since your willing to expose the same webservice interface/operations: Wouldn't it be easier to let your GUI tool act as a HTTP proxy and place that tool between the client and the actual webservice? Like:

Client(s) ==> GUI Tool (http proxy) ==> StockQuoteService.

That way the client(s) are build against the WSDL of the actual StockQuoteService, but make use of the endpoint address of the GUI tool. You can implement the HTTP proxy in your GUI tool as a simple Servlet which dispatches the request (after manipulation) to the actual webservice using Apache HTTPClient.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜