Note that there are some explanatory texts on larger screens.

plurals
  1. POWiring wsclient Webservices in resources.groovy
    primarykey
    data
    text
    <p>I have a situation where I need to be able to shovel data down in three classic environments: dev, itg, and CAT. I have working code in my webservice controller, but am now factoring that logic out to its own service for two reasons. First, to separate concerns, second to better performance. Keeping the webservice initialization in a controller means that the transformation from wsdl to groovy object is repeated every time the controller is invoked--not ideal.</p> <p>However I keep getting initialization errors when attempting to wire these together. </p> <pre><code>spring.GrailsRuntimeConfigurator [RuntimeConfiguration] Unable to load beans from resources.groovy org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: static org.grails.plugins.wsclient.service.WebService.getClient() is applicable for argument types: (java.lang.String) values: [WSDL-LOCATION-HERE] Possible solutions: getClient(java.lang.String), getClient(java.lang.String, groovyx.net.ws.cxf.SoapVersion), getClass(), getAt(java.lang.String) </code></pre> <p>The offending code is:</p> <pre><code>// Place your Spring DSL code here import org.grails.plugins.wsclient.service.WebService; beans = { itgFilenetService(testbed.webservices.FileNetService) { wsdlLocation = "WSDL-LOCATION-HERE" webService = WebService.getClient(wsdlLocation) } // FileNetController(testbed.webservices){ // fileNet = itgFilenetService // } } </code></pre> <p>I get the idea that I'm doing something really wrong here, because clearly... <code>WebService.getClient(String)</code> is and has been a legal constructor for ages... what am I missing?</p> <p>I attempted a suggestion here, doing:</p> <pre><code>def ib = [ afterPropertiesSet:{ itgWebService = WebService.getClient("WSDL") catWebService = WebService.getClient("WSDL") } ] as InitializingBean </code></pre> <p>But this code was never invoked at runtime.<br> I realize (now) that one big problem was treating the Webservice.getClient() as a static call. I hadn't done it before, but well... learn by doing... SOLVED Below:</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload