Open eraad opened 5 years ago
@eraad All tags that can occurs multiple times within another must be wrapped into an object with a key in plural. E.g.
{"Headers" [{"Header" {"Security" {"UsernameToken" {"Username" {:__value "a"}
"Password" {:__value "c"}}}}}]}
Please check your request mapping structure. If my assumption is correct this code should work:
(assoc-in mapping ["Envelope" "Headers"]
[{"Header" {"Security" {"UsernameToken" {"Username" "a" "Password" "c"}}}}])
It also would be helpful if you will post your mapping here.
Hi @DeLaGuardo
I tried it but did not work. Please, find my mapping below:
=> (def m (service/request-mapping srv))
=> {Envelope {Header {}, Body {sendBill {fileName {:__value {:__type string, :__optional? true}}, contentFile {:__value {:__type nil, :__optional? true}}, partyType {:__value {:__type string, :__optional?
true}}}}}}
=> (assoc-in m ["Envelope" "Headers"] [{"Header" {"Security" {"UsernameToken" {"Username" {:__value "a"} "Password" {:__value "c"}}}}}])
=> {Envelope {Header {}, Body {sendBill {fileName {:__value 1234-01-123F-1.XML}, contentFile {:__value #object[[B 0x5279f71 [B@5279f71]}}}, Headers [{Header {Security {UsernameToken {Username {:__value a}, Password {:__value c}}}}}]}}
=> <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://service.sunat.gob.pe"><soapenv:Header/><soapenv:Body><ser:sendBill><fileName>1234-01-123F-1.XML</fileName><contentFile>[B@5279f71</contentFile></ser:sendBill></soapenv:Body></soapenv:Envelope>
Please note that the mapping produced by request-mapping
includes a Header
tag (not in plural). Thanks! I appreciate your help.
Is it possible also to send your WSDL file as well?
For sure, please find it attached (zipped). I just added two more files that are included (ns and XSD). Archive.zip
So, I can confirm that this is a bug caused by wsdl with no information about headers. I will try to add ability to inject custom handlers to fix that. Probably will solve it during upcoming weekend.
Thanks! I suspected that. I will keep an eye on the project! Shall I close this issue?
Let's leave it open until resolved
I have a similar issue. Would there be a chance to fix it?... if not - could you point me where to look for? maybe I can help fixing it somehow
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:
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!