Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caching a WSDL file rather than fetching it on every SOAP request

I'm in the process of building a rails app that 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...

like image 802
Thomas V. Avatar asked Aug 26 '11 21:08

Thomas V.


People also ask

Does SOAP require WSDL?

The WSDL Generator component is not essential for using SOAP. Administrators can still write service calls to Content Server in SOAP if needed. The WSDL Generator provides flexibility in altering existing client applications.

What is WSDL file in SOAP?

What is a WSDL? WSDL, or Web Service Description Language, is an XML based definition language. It's used for describing the functionality of a SOAP based web service. WSDL files are central to testing SOAP-based services. SoapUI uses WSDL files to generate test requests, assertions and mock services.

In which location can we access WSDL document of a SOAP web service?

Typically, all WSDL or XSD files are initially placed into the META-INF/wsdl directory when using Enterprise JavaBeans (EJB) or the WEB-INF/wsdl directory when using Java™.


1 Answers

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
like image 89
Seamus Abshere Avatar answered Oct 24 '22 15:10

Seamus Abshere