Skip to content
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

Draft: Set namespace on request #212

Closed
wants to merge 1 commit into from

Conversation

carlpett
Copy link

I'm working with a system which differentiates between <foo xmlns="something"> and <ns:foo xmlns:ns="something"> (which I believe are equivalent?). This patch sets up the namespace alias on the body such that it works for my usecase, by wrapping the request object.

Reviewer note: I'm not sure this is generally correct! It currently breaks the tests, but as far as I can tell it is mainly because the generated output is different. I'm unsure if it breaks other systems, eg when there shouldn't be a namespace at all, if that is something which could happen?

cc @c4milo

@carlpett
Copy link
Author

For reference, this is a sample wsdl from the system I integrate with.

And this request doesn't work:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <!-- Header with token etc here -->
  <soap:Body>
    <Query xmlns="http://api.dcp.ericsson.net/UsageDataDownload">
      <!-- ... -->
    </Query>
  </soap:Body>
</soap:Envelope>

While this does:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <!-- Header with token etc here -->
  <soap:Body>
    <tns:Query tns:usag="http://api.dcp.ericsson.net/UsageDataDownload">
      <!-- ... -->
    </usag:Query>
  </soap:Body>
</soap:Envelope>

@ieure
Copy link
Contributor

ieure commented Sep 28, 2021

FYI, there's some overlap in this code with #218, which I wrote. From your description, we might be running into the same problem — it might be worth combining approaches.

@carlpett
Copy link
Author

carlpett commented Mar 6, 2024

I'm no longer working on this, closing

@carlpett carlpett closed this Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants