วันนี้ผมจะมานำเสนอการทำ Web Service ตัดคำภาษาไทย โดยใช้ grails framework (ภาค SOAP)
- สั่ง grails create-app _appname_ เพื่อสร้าง grails application
- cd _appname_
- แล้วสั่ง grails install-plugin xfire เพื่อติดตั้ง plug-in เพื่อทำ webservice ฉบับ soap
- สั่ง grails create-service TokenizeService เพื่อสร้าง Service ตัดคำ
- copy LexTo.jar ไว้ใน /lib แล้วเอา lexitron.txt ไว้ใน /
- เขียน Code นิดหน่อย ดังนี้
/grails-app/conf/BootStrap.groovy (อยากจะ new Object ครั้งเดียว)
code :
/grails-app/services/TokenizeService.groovy ให้เพิ่ม method
code :
- เรียบร้อยแล้ว สั่ง grails run-app ได้เลย !!!
เข้าhttp://localhost:8080/TokenizerService/services จะเห็นแบบนี้ครับ (มัน generate wsdl มาให้เลย)
ขอทดสอบ webservice ด้วย soap ui โดยใส่ url ของ wsdl ไปเลยแบบนี้
แล้วก็ทดสอบ operation การตัดคำของเรา
เรียบร้อย !
ปล. ไม่ชอบ soap แต่ว่าใน grails มันง่ายเลยทำก่อน (ขี้เกียจสร้าง controller + render as xml)
Related Blogs
- Riddell Pittsburgh Steelers NFL Full Size Proline VSR4 Helmet …
- Successful People Start Fast and Finish Strong | Bud Bilanich
- Airsoft BBs .20 gram 4000 round bag SRC Brand | Airsoft Gun Store
- Sonnd › <a href="http://www.mondaynote.com/2010/05/02/balkanizing …
- Opera Finds Flash Unappetizing For Web Video [Blockquote] | Gadget …
- Opera Finds Flash Unappetizing For Web Video [Blockquote]
- Is Hyundai really considering full-size pickup truck? » Car News …
- AA9PW FCC Exam Practice " Morse Code Practice « mbt tunisha grape …
- Why Most Stock Pick Service Fails « YUG.com
- Lebanon wins UN's Public Service Award | Ya Libnan | World News …
- Weight Watchers Canada Coupon Replaces Promotional Code …
- Medianet launches ebook catalog and distribution service …
- Opera Finds Flash Unappetizing For Web Video [Blockquote …
- Whats the code to hide the comments but KEEP the add comment link …
- What is the difference between HREF and SRC links? « TagFocus.com
- Zooming in on Coverings 2010
- Ceramic Tiles of Italy Design Competition Winners
- -->





