Search code examples
clojurewsdl

Consuming WSDL in Clojure


I need to consume a WSDL web service and the Java client-side code I've seen so far looks bloated and complicated. I was wondering whether a cleaner solution might exist in Clojure so that I may perhaps implement that part in Clojure and expose a simpler API to the Java code.


Solution

  • cd your_project_dir/src
    wsimport -p some.import.ns http://.../service?wsdl
    

    It would create ./some.import.ns/*.class. So you can just use them in your clojure project

    (ns your.ns ...
      (:import [some.import.ns some_WS_Service ...]))
    
    (let [port (-> (some_WS_Service.) 
                   .getSome_WS_ServicePort]
      (... (.someMethod port) ...))