[ 
https://issues.apache.org/jira/browse/CXF-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13744723#comment-13744723
 ] 

Bin Zhu commented on CXF-5216:
------------------------------

Thanks Freeman for the clue.
In client side, it doesn't know when the WSDL will be changed before the error 
thrown.
So I guess I need to clear the cache each time before invoke the client code.
If there is only a URL for the WSDL in client side, then how can I build the 
Definition for it? maybe 
getBus().getExtension(WSDLManager.class)getDefinition(url)? If so, the code 
will be like 
bus.getExtension(WSDLManager.class).removeDefinition(bus.getExtension(WSDLManager.class).getDefinition(url));
 right?
                
> WSDL definition cache issue for web service client when WSDL in service war 
> changed
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-5216
>                 URL: https://issues.apache.org/jira/browse/CXF-5216
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.6.2
>            Reporter: Bin Zhu
>            Assignee: Freeman Fang
>
> In current design, the WSDL definition will be cached in case the the same 
> wsdl will be queried later.(WSDLManagerImpl.getDefinition)
> e.g.
>     public Definition getDefinition(String url) throws WSDLException {
>         synchronized (definitionsMap) {
>             if (definitionsMap.containsKey(url)) {
>                 return definitionsMap.get(url);
>             }
>         }
>         return loadDefinition(url);
>     }
> The cache mechanism indeed improves the performance in most scenarios. But if 
> the WSDL file in service provider app changed, the client will not get the 
> correct WSDL definition even using retrieves the wsdl from server dynamically 
> (http://hostname:portname/xxx?wsdl),unless restarting the client app.
> It would be more reasonable to introduce a client property to allow user to 
> disable the definition cache so that they can choose if they get WSDL 
> definition from cache or the URL dynamically for their scenarios. Any 
> thoughts? Thanks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to