Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consuming WSDL in Clojure

Tags:

wsdl

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.

like image 305
Marcus Junius Brutus Avatar asked Jan 18 '13 20:01

Marcus Junius Brutus


1 Answers

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) ...))
like image 168
mobyte Avatar answered Oct 05 '22 22:10

mobyte