-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
wsdl generation output dataclass missing namespace #612
Comments
Notes: I am not very sure about this but my rpc samples, which are not many all pass. Closes #612
Are you sure about this one @brunnels? I trust soap ui and this is the sample response, it generates <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://microfocus.com/nas/2020/08">
<soapenv:Header/>
<soapenv:Body>
<ns:loginResponse>
<Result>
<ns:Status>gero et</ns:Status>
</Result>
</ns:loginResponse>
</soapenv:Body>
</soapenv:Envelope> Which is spot on what xsdata generates from issue.models import LoginResponse
from issue.models import Result
from issue.models import NetworkManagementApiLoginOutput
from xsdata.formats.dataclass.serializers import XmlSerializer
output = NetworkManagementApiLoginOutput()
output.body = NetworkManagementApiLoginOutput.Body()
output.body.login_response = LoginResponse()
output.body.login_response.result = Result()
output.body.login_response.result.status = "pame"
serializer = XmlSerializer()
serializer.config.pretty_print = True
print(serializer.render(output))
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ns1:loginResponse xmlns:ns1="http://microfocus.com/nas/2020/08">
<Result>
<ns1:Status>pame</ns1:Status>
</Result>
</ns1:loginResponse>
</soap-env:Body>
</soap-env:Envelope>
|
Maybe I did not state the issue correctly? On the main branch I generated the client in the mfna directory with If I run these tests on the main branch, they fail. If I run the same tests from the generate-fixes branch they pass. Here are the changes I made to get them to pass. With the namespace as an empty string in the |
I hear you @brunnels and I understand what you are saying but soap ui is also generating the same models as xsdata Either both xsdata and soapUI are doing it wrong or I am missing something, that's why I wanted a source with official request/responses |
I wish MFNA had more docs but this is the actual response I'm receiving from our MFNA server. <?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<nas:loginResponse xmlns:nas="http://microfocus.com/nas/2020/08">
<nas:Result>
<nas:Status>200 Logged in</nas:Status>
<nas:Text>s229dc048-746e-471e-aaf8-66f7317d89d7</nas:Text>
</nas:Result>
</nas:loginResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> It looks like the thing that matters is that I created 3 additional tests to verify the soapUI output parses, that the xsdata output parses, and that removing the namespace from |
AFAIK, MFNA is using java AXIS or AXIS2 for their SOAP implementation so it's probable that other AXIS implementations will exhibit the same behavior. |
I just double checked and the xsdata and soapUI generated responses fail the tests if the namespace is added to the dataclass. I guess if MFNA incorrectly adds the namespace then I can subclass |
Is that wsdl an official copy? <wsdl:message name="activate_deviceResponse">
<part name="Result" type="nas:Result"/> # the issue is here, it should be element and not type
</wsdl:message> it should have been <wsdl:message name="activate_deviceResponse">
<part name="Result" element="nas:Result"/>
</wsdl:message> element means qualified, type means unqualified as far as I know, but in your case there an element and a complex type named |
that's straight from the server after install so hasn't been modified. I will probably just use sed to fix the wsdl rather than modify the client.send method |
I guess we can close this and point the blame at MFNA or axis. |
I want to try something @brunnels, I think I can add a validation during the processing to catch these cases and correct them |
Hey @brunnels, I added the late validation for these cases that should take care of the issue, I found a source that said that even though message element exists the type can also point to an element or complex type. Thanks for reporting and helping me troubleshoot this one! |
Glad to help and thank you for this great library. It's the best thing out
there for modern SOAP code generation. Everything else is ancient, broken,
or both.
…On Sun, Nov 21, 2021 at 4:03 AM Chris Tsou ***@***.***> wrote:
Hey @brunnels <https://github.com/brunnels>, I added the late validation
for these cases that should take care of the issue, I found a source that
said that even though message element exists the type can also point to an
element or complex type.
Thanks for reporting and helping me troubleshoot this one!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#612 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEIXS4GNHJ3MMUHUT5UGRTUNC7VVANCNFSM5HX3VJ3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@tefra/xsdata
***@***.***> Thanks
again for the awesome library and support. I will test everything monday
and let you know.
…On Thu, Nov 25, 2021 at 2:50 PM Chris Tsou ***@***.***> wrote:
Closed #613 <#613>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#613 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEIXS2JHKX5GFJ7VRZ6GYTUN2OQJANCNFSM5HYF3WDA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Here's the wsdl parts for loginResponse
Results in
but should have
"namespace": "http://microfocus.com/nas/2020/08"
in order for parser to be able to parse response envelope.The text was updated successfully, but these errors were encountered: