2
我有一項服務,我有一種方法可以調用,並且如何訪問此服務。 我看到短信插件,並安裝了它,我怎樣才能從我的應用程序不同mobiles.I發送短信遵循Grails的短信插件,但我沒有得到任何結果ecxept ecxeptions如何使用Groovy在Grails中調用服務
class SipgateService {
static transactional = true
def serviceMethod() {
def sipgateService
//def phoneNumber = 'XXXXXXXXXX' //phoneNumber according to E.164 specification
//working alternative:
println "service"
def phoneNumber = 'XXXXXXXXXX'
def result = sipgateService.sendSMS(phoneNumber, 'This is my Text to send!')
result ? 'Sending Successful':'Sending failed'
println "after service"
}
}
請解釋我一個例子。 提前感謝。
的dublicate:http://stackoverflow.com/questions/6250914/如何在Grails中調用控制器服務? – elCapitano 2011-06-06 12:24:31