在Clojure中使用WSDL [英] Consuming WSDL in Clojure

查看:71
本文介绍了在Clojure中使用WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用WSDL Web服务,到目前为止,我所看到的Java客户端代码看起来很肿且复杂。我想知道Clojure中是否可能存在更干净的解决方案,以便我也许可以在Clojure中实现该部分,并将更简单的API公开给Java代码。

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.

推荐答案

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

它将创建 ./ some.import.ns / *。class 。因此,您可以在Clojure项目中使用

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) ...))

这篇关于在Clojure中使用WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆