2015-03-19 62 views
0

我使用wsimport生成Web服務客戶端。諸如此類使用grails項目中的wsimport生成java調用Web服務

的wsimport -keep -extension -p [包裝] [WSDL文件]

它通過在Java項目中使用效果很好。

但我想在Grails項目中調用它。 所以我把這些生成的類通過wsimport放到src/java文件夾中。 我調用它在Grails項目中的「控制器」,如

*Holder<String> result = new Holder<String>() 
Holder<String> description = new Holder<String>() 
RCCWebServiceClientHandler.createSubscription(591, "1234", "1234324543", "453452345", "", 0, "78",4, "", "", result, description) 
println(result.value) 
println(description.value)* 

好發的例外是

2015-03-19 17:44:13,162 [http-bio-8080-exec-1] ERROR errors.GrailsExceptionResolver - WebServiceException occurred when processing request: [GET] /GrailsExample/webservice/index 
Method __execute is exposed as WebMethod, but there is no corresponding wsdl operation with name __execute in the wsdl:portType{http://syniverse.com}soap. Stacktrace follows: 
Message: Method __execute is exposed as WebMethod, but there is no corresponding wsdl operation with name __execute in the wsdl:portType{http://syniverse.com}soap 
    Line | Method 
->> 341 | freeze     in com.sun.xml.internal.ws.model.JavaMethodImpl 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|  94 | freeze     in com.sun.xml.internal.ws.model.AbstractSEIModelImpl 
| 240 | buildRuntimeModel . . in com.sun.xml.internal.ws.model.RuntimeModeler 
| 672 | createSEIPortInfo  in com.sun.xml.internal.ws.client.WSServiceDelegate 
| 660 | addSEI . . . . . . . . in  '' 
| 329 | getPort    in  '' 
| 312 | getPort . . . . . . . in  '' 
| 294 | getPort    in  '' 
| 119 | getPort . . . . . . . in javax.xml.ws.Service 
|  72 | getSoapServiceImplPort in com.syniverse.sponsordata.ws.client.Soap_Service 
|  38 | createSubscription . . in com.syniverse.sponsordata.ws.client.handler.RCCWebServiceClientHandler 
|  16 | ws      in com.syniverse.sponsordata.GroovyTest 
|  15 | index . . . . . . . . in grailsexample.WebserviceController 
| 198 | doFilter    in grails.plugin.cache.web.filter.PageFragmentCachingFilter 
|  63 | doFilter . . . . . . . in grails.plugin.cache.web.filter.AbstractFilter 
| 1145 | runWorker    in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 745 | run     in java.lang.Thread 

我不知道哪種方法調用__execute方法。爲什麼它使用java調用很好,但在Grails項目中失敗了?


更新:

  1. 請參考https://stackoverflow.com/questions/27317033/spring-wsdl-no-corresponding-wsdl-operation-with-name知道這是關於從春季的類加載器的問題。

  2. 我用GGTS IDE,它添加 Dependency: compile ":ws-client:1.0" 後進入BuildConfig.groovy

它的工作原理。但我仍然完全不知道原因。

+0

http://stackoverflow.com/questions/27317033/spring-wsdl-no-corresponding-wsdl-operation-with-name – 2015-03-20 02:44:39

回答

1

我最近碰到這個問題。

有了一個Grails 2.3.9,這個問題似乎解決了,如果你把這種依賴關係到酸味BuildConfig.groovy:

runtime "com.sun.xml.ws:jaxws-rt:2.1.7" 

也許,Grails的環境在默認情況下有一個較舊的JAX-WS運行時,所以需要更新。

另請參閱Alex Xu-s鏈接(在評論中)。

相關問題