xapix-io / paos Goto Github PK
View Code? Open in Web Editor NEWClojure SOAP client
License: Eclipse Public License 1.0
Clojure SOAP client
License: Eclipse Public License 1.0
i tried lein test
which gave me a response telling me that i don't have a project.clj
i'm not sure how to run the tests outside of a repl or using clj
/clojure
commands
I have a complex type like:
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="s:string"/>
</s:sequence>
</s:complexType>
Another complex type refers to it like so:
...
<s:element maxOccurs="1" minOccurs="0" name="ValidationGroupList" type="tns:ArrayOfString"/>
...
I have tried multiple options to set this attribute in the 'context' object
"ValidationGroupList" ({"string" {:__value "BO_GeneralInfoModule"}})
or
"ValidationGroupList" ({:__value "BO_GeneralInfoModule"}),
(service/wrap-body srv context)
converts the deeply nested object into proper namespaced xml, but ValidationGroupList is empty, given either of the above context objects.
Here, 'context' is the merged mapping and data (similar to your example in README). Note that every other attribute in the nested complex object is converted fine, except for the "array of strings" complex type.
There is no error and I can't debug this since it's using selma's template internally.
Suggestion?
Something like that
(defprotocol PSOAPClient
(soap-action [this])
(send [this context])
(parse [this])
(-request-body [this context])
(-response-body [this context]))
Object initializer how will implement that protocol should get as an arguments result of WSDL parsing for specific soap-action.
Incomming data:
{:soapenv:Envelope ;; Top level xml tag
{:soapenv:Header nil,
:soapenv:Body
{:v1:airlineByIcaoResponse
{:return|attrs ;; set of attributes for :return tag
{:offset nil}
:return ;; this xml tag can be found multiple times in parent tag (:v1:airlineByIcaoResponse)
[{:category nil,
:iata nil,
:name nil,
:icao nil,
:dateFrom nil,
:dateTo nil,
:active nil,
:phoneNumber nil,
:fs nil}]}}}}
Output:
fn xml_string => map
This function should use clojure.zip for lazy xml parsing without growing heap.
Hi!
I'm trying to build a request for a SOAP service that requires WS-Security headers. It expects a call like this:
I tried associating a map with the expected headers into the mapping like so:
(assoc-in mapping ["Envelope" "Header"] {"wsse:Security" {"wsse:UsernameToken" {"wsse:Username" "a" "wsse:Password" "c"}}})
The problem is that the wrap-body
fn seems to ignore this. Can you shed a light on how to add this type of headers into the SOAP envelope? Thanks!
I'm having trouble when I try to install the library, below my deps and the problem I've been having.
deps:
{:aliases {:deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.8.599"}}}
:depstar {:extra-deps {seancorfield/depstar {:mvn/version "0.3.4"}}}
:test {:extra-paths ["test"]}}
:deps {com.novemberain/langohr {:mvn/version "5.1.0"}
commons-codec/commons-codec {:mvn/version "1.13"}
commons-validator/commons-validator {:mvn/version "1.6"}
cheshire/cheshire {:mvn/version "5.9.0"}
clj-http/clj-http {:mvn/version "3.10.0"}
clj-time/clj-time {:mvn/version "0.15.2"}
io.xapix/paos {:mvn/version "0.2.4"}
org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/data.generators {:mvn/version "0.1.2"}
org.clojure/tools.logging {:mvn/version "0.5.0"}}
:mvn/repos {"enonic" {:url "https://repo.enonic.com/public/"}
"central" {:url "https://repo1.maven.org/maven2/"}
"clojars" {:url "https://clojars.org/repo"}}
:paths ["resources" "src/main/clojure"]}
error:
clj -A:depstar -m hf.depstar.uberjar target/"clj-zzk"-"0.0.1".jar
Downloading: net/sf/saxon/saxon/9.1.0.8/saxon-9.1.0.8.jar from enonic
Downloading: org/apache/xmlbeans/xmlbeans/2.6.0/xmlbeans-2.6.0.jar from central
Downloading: inflections/inflections/0.13.0/inflections-0.13.0.jar from clojars
Error building classpath. Could not transfer artifact org.clojure:google-closure-library:jar:0.0-20130212-95c19e7f0f5f from/to central (https://repo1.maven.org/maven2/): Range Not Satisfiable (416)
Makefile:17: recipe for target 'uberjar' failed
make[1]: *** [uberjar] Error 1
make[1]: Leaving directory '/home/rafael/Projects/zzk/clj-zzk'
Makefile:10: recipe for target 'install' failed
make: *** [install] Error 2
I having this error when trying to launch my REPL or deploying to Heroku. 3 days ago I had no problems using paos.
Could not transfer artifact net.sf.saxon:saxon:pom:9 from/to jboss (https://repository.jboss.org/nexus/content/repositories/deprecated/): Connection reset
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
This is part of my project.clj
:repositories [["enonic" "https://repo.enonic.com/public/"]]
:dependencies
[[camel-snake-kebab "0.4.2"]
[clj-http "3.10.1"]
[environ "1.2.0"]
[integrant "0.8.0"]
[integrant/repl "0.3.1"]
[io.xapix/paos "0.2.4"]
[metosin/reitit "0.5.10"]
[org.clojure/clojure "1.10.1"]
[org.postgresql/postgresql "42.2.14"]
[ovotech/ring-jwt "1.3.0"]
[ring "1.8.2"]
[seancorfield/next.jdbc "1.1.613"]
[buddy "2.0.0"]
[clojure.java-time "0.3.2"]
[ring/ring-mock "0.4.0"]
[ring-cors "0.1.13"]]
No success searching for a solution and now I'm stuck. Will appreciate your help.
i'm getting this when using lein deps
on a new project with the only deps being clojure and paos.
this is from lein help faq
**Q:** I got `Tried to use insecure HTTP repository without TLS`, what is that about?
**A:** This means your project was configured to download dependencies
from a repository that does not use TLS encryption. This is very
insecure and exposes you to trivially-executed man-in-the-middle attacks.
For arrays of complex types, the existing documentation states "Just attach as many as you want into it and all of them will be injected correctly into the request payload."
It is not obvious how to do this. An example would be very helpful.
Leiningen and boot complains about dependencies coming from non-https repositories.
For now lets consider that requests will be made with clj-http library. So optional outcome from that issue should be multimethod with support for other libraries.
Hello,
I've been happily running version 0.2.4 of this library for awhile now. Recently, things stopped working altogether in the production Docker container. I'm seeing some strange behavior and I'm not sure how to track down the root cause.
I load a WSDL file as a classpath resource and pass it to paos.wsdl/parse
. This passes.
I grab my reified service instance from the wsdl service object without issue.
I call (paos.service/request-template service)
. Locally, the template looks normal and has blocks like this:
{% with ctx=Envelope %}{% with ctx=ctx.Header %}
. But in the Docker container, it looks something like this: <![CDATA[{% with ctx=Envelope %}]><![CDATA[{% with ctx=ctx.Header %}]>
.
Locally, when I try to substitute my parameters into the template using (service/wrap-body service body)
, the substitution happens properly. But when this call is performed inside of the Docker container, the parameter values are not substituted, and the <![CDATA[]]>
blocks remain, so it looks something like this: <![CDATA[]]><![CDATA[]]>
As best as I can tell, both environments are using JDK17, the same JARs (lein is being used to pull the JARs for both environments), and Clojure 1.11.1.
Any ideas on what's going on here or what I can do to troubleshoot this?
EDIT: I've narrowed this down a bit. Something is happening with the artifact produced by the lein uberjar
task that causes it to produce different output for the aforementioned task than what happens via thelein repl
. Neither Docker nor the JDK appear to be at fault here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.