-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
with karate-gatling dependency version 1.0.1 empty attributes are added to the soap request #1587
Comments
I definitely don't consider this a priority, tagging as |
@forlixdev here's a way you can help. I think there is a way to force the XML parser used by |
Of course, I can do some research about it, even if being only a tester I don't know if I'm able to finalize it. |
@forlixdev no worries. do try, any bit of research helps - it may be as simple as copying karate xml to string conversion code and trying it in the offending pom / project etc. we can try ask around for volunteers later |
Hi, only to say that I tried but still without luck for now. I'll go on trying. |
@forlixdev / @ptrthomas I can take a stab at this issue. |
@dinesh19aug by all means 👍 |
Thanks @dinesh19aug. The last failed attempt I did was to try to use the internal implementation (in karate-core / XmlUtils class / toXmlDoc method):
But the error was always the same mentioned in the issue. |
moved to project board: https://github.com/intuit/karate/projects/3#card-61812894 |
please note that a possible fix has been attempted here: #1882 which may need some community help to complete |
Taging senarios with new tag : Doing this in ScenarioEngine.evalKarateExpression :
and this change in XmlUtils
could that be be an ok solution ? |
@PerJV I really appreciate you following up on this. I would add a config property called but before all that, I have these concerns:
|
My two cents from a pure user perspective is that if it's only me that I noticed this error, we might find a workaround for this edge case (writing it in the documentation). |
@forlixdev my bad, I completely missed that you had submitted a simple, clear way to replicate and could verify that the original solution proposed by @PerJV works I have just implemented the solution. so adding this one line will solve the problem: * configure xmlNamespaceAware = true for completeness, this is also a workaround and way to submit XML without parsing it within Karate, note the use of * text requestBody =
"""
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
</S:Envelope>
""" |
Thanks for the work and support @PerJV and @ptrthomas |
Thanks @ptrthomas for adopting this change this really helped me a lot |
1.2.0 released |
It seems that using the following karate-gatling dependency (version 1.0.1)
the request are not passed as it is but there's an empty attribute (xmlns) added the the soap request, making my tests failing. That is instead of:
<service>123456789</service>
the request sent is having an empty xmlns attribute:
<service xmlns="">123456789</service>
The problem is quite similar to the one reported in https://stackoverflow.com/questions/57042497/karate-xml-element-changed-to-have-empty-namespace/57042773.
In this case it must be something regarding the xml libraries handled by karate-gatling. With the version 0.96 of Karate (and the equivalent version for karate-gatling) it worked fine.
As attachment the code for replicating the problem, with a README. You have to run it without the dependency and check that it passes. Then decomment the dependency in the pom to see that it fails.
myproject.zip
The text was updated successfully, but these errors were encountered: