Caching a WSDL file rather than fetching it on every SOAP request
I'm in the process of building a rails app tha开发者_运维百科t will basically wrap around a bunch of SOAP commands.
Rather than fetch the WSDL each time I'd like to implement some sort of caching method, though I'm not quite sure on where to even start to do this.
Is there something specific to Rails that would help me out or should I just download the file through Ruby and load it in? Just looking for some sort of general direction...
If you're using savon then a remote WSDL will be downloaded once per client instance:
the (remote) WSDL has to be downloaded and parsed once for every client and so comes with a performance penalty
If that is too often, you can load the WSDL from a local file:
client = Savon::Client.new do
wsdl.document = '/path/to/wsdl.xml'
end
精彩评论