Reply to comment

This may be help (GroovyWS)

This may be help (GroovyWS)

I experienced that GroovyWS issue too. So as a work-around, I made a separate groovy class which offers methods for the WS calls I want to use. The class is realized as singleton and its "getInstance" method initializes the proxy (which is a member of the class), but only once. Looks like this:


...
def proxy = null

static MyWSClass instance = null

private MyWSClass(){
super()
}

static String wsdl = "http://somwhere/someWSDL?wsdl"

public static MyWSClass getInstance(){
if (!instance){
instance = new WSAccountMgmt()
instance.proxy =
new WSClient(wsdl, instance.class.classLoader)
instance.proxy.initialize()
}
return instance
}

public String getSomething(Sting input){
def result = proxy.getSomething(input)?:null
...

Hence the proxy is initialized only once - which of course may take some time. But after that it is "recycled" -> speeds up the process.

And if you invoke "MyWSClass.getInstance()" in "Bootstrap.groovy", the initialization will be done on start-up - once the application is running, the user will not experience the slow-down of the initialization.

That's just my suggestion. Maybe it works for you too.

Timo
(sorry for my english - I am not a native speaker)

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options