We are going to create StockQuote web service which will return quotes for given symbol. We will be using the WSO2 WSF/Spring demo application for this. Source code for this post can be found here. If you have not already read “WSO2 WSF/Spring - Apache Axis2 for spring web services developers”, please have a look at it first.
Oky now, let's look at the bean that we want to expose as a web service.
So we have to put this java source file in the source directory [wsfspring/src/main/java/] under the correct package structure.
package org.wso2.training.wsfspring;
import java.util.Map;
public class StockQuoteService {
private MapquotesMap;
public MapgetQuotesMap() {
return quotesMap;
}
public void setQuotesMap(MapquotesMap) {
this.quotesMap = quotesMap;
}
public String getQuote(String company) throws Exception {
if (quotesMap.containsKey(company)) {
return quotesMap.get(company);
} else {
throw new Exception("Ooops, " + company + " is not listed with us");
}
}
}
Now let's look at the applicationContext.xml [src/main/webapp/WEB-INF/applicationContext.xml] where all the Spring configuration is done. First we define the "StockQuote" bean.
<bean id="StockQuote" class="org.wso2.training.wsfspring.StockQuoteService">
<property name="quotesMap">
<map>
<entry key="wso2" value="150"/>
<entry key="ibm" value="100"/>
<entry key="microsoft" value="100"/>
</map>
</property>
</bean>
Now we have defined the bean and we need expose it as a web service. We use “services” bean for that. Using the “serviceBean” property we refer to actual bean we want to expose as web service and "serviceName" defines the name of the service as given below.
And that is all you need to do to expose your Spring bean as a web service.
<bean id="services" class="org.wso2.spring.ws.WebServices">
<property name="services">
<list>
<bean id="StockQuoteService" class="org.wso2.spring.ws.SpringWebService">
<property name="serviceBean" ref="StockQuote"/>
<property name="serviceName" value="StockQuoteService"/>
</bean>
</list>
</property>
</bean>
Oky, let's try this out. As described in the previous post all you got to do is run the maven build.
~../wsfspring$ mvn jetty:runNow if you go to
http://localhost:8080/wsfspring/you will be able to find StockQuoteService under services/available services.
So how can we invoke this service. Axis2 allows you to invoke the services through the web browser in a RESTful manner. So if we invoke StockQuoteService through the browser using
http://localhost:8080/wsfspring/services/StockQuoteService/getQuote?company=wso2we will be able to see
and if we try a company that is not listed using
http://localhost:8080/wsfspring/services/StockQuoteService/getQuote?company=oracle
So that's it. As you can see, it is very easy to create web services with WSO2 WSF/Spring. Next we will be look at how to secure WSF/Spring web services with Apache Rampart.Apache Rampart integration is a great advantage in WSF/Spring as Apache Rampart already supports most of the WS - Sec* specifications including
- WS - Security 1.0 / 1.1
- WS - Security Policy 1.1 / 1.3
- WS - Secure Conversation 2005 / WS-SX
- WS - Trust 2005 / WS-SX












23 comments:
There are spyder jackets 10 pcs of excellent Ralph Lauren multi-colored stripe big pony cheap columbia jackets. These products are more soft and comfortable for being made of breathable and durable mesh cotton .cheap polo shirtsthere are lots of colors and sizes for your choice, just pick up one you like ,it is absolutely value for money.
A study last yearnike tn, the author in the essay read NIKE , a reporter at the Shanghai headquarters in an interview, nike chaussuressee a pr in high school to read a league plans, employees interviewed told reporters in Beijing's streets, they children to interview, the children said, "truly understand them." tn chaussures These words, if the author touches product function, brand spirit and culture is to become part of the consumer of two basic methods
Lacoste Polo Shirts, ralph Lauren polo shirts , Burberry Polo Shirts.wholesale Lacoste polo shirts and polo ralph laurenwith great price. clothingol.com offers lot of 10 lacoste polo shirts and lot of 20 cheap polo shirts. clothingol.com offers classic fit polo shirts. polo clothing
Bon March¨¦ Chaussure PumaChaussure Sports Shop:baskets pumaChaussure Puma Femme,Chaussure Puma Homme,Chaussure Nike Femme,Chaussure Nike homme,nike shoxChaussure Sport et plus. Livraison Rapide.Cheap Brand Jeans ShopMen Jeans - True Religion Jeans, Women JeansGUCCI Jeans, Levi's Jeans, D&G Jeans, RED MONKEY Jeans, Cheap JeansArmani Jeans, Diesel Jeans, Ed hardy Jeans, Evisu Jeans, Jack&Jones Jeans...
There are ed hardy shirts
,pretty ed hardy shirt for men,
ed hardy womens in the ed hardy online store
designed by ed hardy ,
many cheap ed hardy shirt ,glasses,caps,trouers ed hardy shirts on sale ,
You can go to edhardyshirts.com to have a look ,you may find one of ed hardy clothing fit for you
Top qualitymen's jacket,
These cheap jacket are on sale now,you can find
north face jackets inmage on our web
Ralph Lauren Polo Shirts,buberry polo shirts
Do you wannaghd hair straighteners for you own , we have many
cheap ghd hair straightenersin style and great,you can choose one from these
hair straighteners
Authentic chaussure puma
chaussure sport
And chaussure nike shoes
Come here to have a look of our Wholesale Jeans
Many fashionMens Jeans ,eye-catching
Womens Jeans ,and special out standing
Blue Jeans ,you can spend less money on our
Discount Jeans but gain really fine jeans, absolutely a great bargain.
www.crazypurchase.com
China Wholesale
wholesale from china
buy products wholesale
China Wholesalers
http://www.weddingdressseason.com
http://CLOTHES-WHOLESALE.US
http://straighthairgirl.blog126.fc2.com/
http://seriousblogging.com/crazygirlsshirts"
http://free-blog-site.com/iammyself
http://d.hatena.ne.jp/hotfishing
http://www3.atword.jp/deepseaworld
http://kandypurity.blogspot.com
http://blog.oricon.co.jp/jacket-love-girl/
http://blog.360.yahoo.com/
http://azcentral.com/members/Blog/hotfish234
http://www2.atword.jp/chaussurespuma/
http://www2.atword.jp/edhardyshirts/
http://edhardywomens.blogspot.com/
http://weddingdressseason.com
http://seriousblogging.com/chaussurenike/
http://d.hatena.ne.jp/chaussuresport/
http://mensjacketscheap.blogspot.com/
http://pumashoes.cocolog-nifty.com/blog/
http://free-blog-site.com/mensjeans
http://d.hatena.ne.jp/womenjeanswholesale/
http://www2.atword.jp/wholesalejean/
http://blog.goo.ne.jp/cheapjeans
http://blog.360.yahoo.com/
http://azcentral.com/members/Blog/discountjeans
http://ameblo.jp/mycooljeans/
http://coolgirlloved.blog.shinobi.jp/
http://pumashoescrazy.blog.drecom.jp/
http://pumafamouseshoes.cocolog-nifty.com
http://actiblog.com/mycoolshoes/
http://kurumaro.com/myshoescollection/
http://blog.qlep.com/blog.php/famouseshoes
http://mybrandshoes.jugem.jp/
http://ed-hardy-shirts.com/ed-hardy-shirts-show/
http://chaussuerpumamylove.blog126.fc2.com/
http://myfashioncollection.blog126.fc2.com/
http://community.fox2now.com/
http://sweetheartgirl.wordpress.com
http://www.soulcast.com/post/
http://lightblueeyes.blog.co.uk/
http://yellowbanana.blogsome.com
http://shiningeyes.edublogs.org/
http://edhardyclothingfashion.blogspot.com/
http://seriousblogging.com/mensjacketscool/
http://www.free-blog-site.com/alisasea
http://alisasweety.blog126.fc2.com/
http://d.hatena.ne.jp/chinawholesalers/
http://www4.atword.jp/wholesalefromchina/
http://blog.goo.ne.jp/buyproductswholesale
http://chinawholesalers.easyjournal.com/
http://blog.360.yahoo.com/
http://chinawholedalers.blog126.fc2.com/
http://ameblo.jp/wholesaleproducts/
Thank you so much!!polo shirt men'ssweate,Burberry Polo Shirts lacoste sweater, ralph lauren Columbia Jackets,ski clothing. Free Shipping, PayPal Payment. Enjoy your shopping experience on mensclothingus.com.You can find the father who desire fashionable, intellectual mens clothing simultaneously.
Awesome!!!Best wishes for you !!cheap polo shirts is the father of the summer should be prepared to most commonly used item, it has both style and shape of Ralph Lauren Polo, and vest with a random function polo ralph lauren, so that in the short-sleeved apply to both on many occasions, the pink and black color men's polo shirts brought into effect, lightweight cotton, linen texture to demonstrate masculine temperament and sense of fashion exhaustively.
God bless you!I really agree with your opinions.Also,there are some new fashion things here,gillette razor blades.gillette mach3 razor bladesfor men.As for ladies,gillette venus razor blades must the best gift for you in summer,gillette fusion blades are all the best choice for you.
Perfect!!You are a outstanding person!Have you ever wore chaussures puma,Here are the most popular puma CAT,Puma shoes store gives some preview of puma speed cat,and casual but no sweat puma basket.
Do not mean bad.Thank you so much!I just want to show some fashion things to all of you.I like puma speed, puma femmes and other puma shoes. These puma sport items are at store recently and available for anyone.
fantastic!God bless you!Meanwhile,you can visit my China Wholesale,we have the highest quality but the lowest price fashion products wholesale from China.Here are the most popular China Wholesale productsfor all of you.You can visit http://chinaclothes.net.Also the polo clothing is a great choice for you.
Puma sport
polo shirts
polo shirts
gillette razor blades
Queen--ugg boots
original polo clothing
Burberry polo shirt the steady, solid, so many young girls also love it. Speaking of people of a ralph lauren polo, think it a sign of nobility elegant waving in the horse club.spyder jacket in the cold in your winter activities can be easily.columbia jacket it is expensive, but here you do not need to consider the price of it. the north face jacket one of my favorite money, I do not know how many in this world of its fans.
ed hardy clothing
ed hardy clothes
ed hardy shirts
ed hardy t-shirts
ed hardy sunglasses
ed hardy mens
ed hardy womens
In preparation for the purchase of a tennis racquetbefore, we must consider your financial ability to bear; On this basis, a further comparison, as far as possible, choose your head tennis racquets. Now a lot of babolat pure drive and more mixed materials, the proportion of mixed-use to control the stiffness of the babolat aeropro drive and the shock-absorbing capacity, the more rigid babolat tennis racket, the swing more powerful force; but the relative resilience of the shock-absorbing capacity and wilson k factor performance of talks on the easier it is for the wrist and elbow injury.
Wholesale Handbags
Cheap Handbags
Womens Handbags
Cheap Purses
Designer Handbags
http://2009tennis.blogspot.com/
http://www.free-blog-site.com/tennis
http://o3.indiatimes.com/racquet/
http://cid-8c8a918b06ff68fd.spaces.live.com/?lc=2052
http://2009tennis.cocolog-nifty.com/
http://2009tennis.blog.drecom.jp/
http://2009tennis.blog.shinobi.jp/
http://www.actiblog.com/slary/
http://pshirts.blog126.fc2.com/
http://www.free-blog-site.com/shirts
http://nikepuma.blog.shinobi.jp/
http://hardy55.blog126.fc2.com/
http://cid-f80137f6d1a8020b.spaces.live.com/?lc=2052
http://www2.atword.jp/sdgdyhd/
http://kurumaro.com/hardy/
http://hardyclothes.jugem.jp/
http://www.actiblog.com/sfawagfra/
http://thediary.org/cheaphandbags/
http://ameblo.jp/kaowy/
http://sale.edublogs.org/
http://www2.atword.jp/jak/
http://09handbags.blog126.fc2.com/
http://sun15.cocolog-nifty.com/
http://ameblo.jp/ailsa15/
http://junior2tennis.blog.shinobi.jp/
Post a Comment