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

importing suds.Object class in mx.literal results in TypeNotFound later #62

Open
papaben opened this issue Jun 4, 2020 · 0 comments
Open

Comments

@papaben
Copy link

papaben commented Jun 4, 2020

Hi, Thank you for maintaining this very useful library! I'm encountering the following situation and have discovered a workaround. However, I believe that either I am just too ignorant of WSDL or that there may be an unwanted condition in the code. I'm simultaneously curious how it could be the case that this is an issue since it's been present since November 2015.

The situation

  1. I am working with a SOAP service publishing this WSDL.
  2. I am creating a Subscriber object (WSDL line 2064) using the suds.client.Client.factory.create() instance method.
  3. The factory returns a suds.sudsobjects.Object instance
  4. I then pass this object through to a Service method call
  5. Later on, when trying to build the bodycontent, the binding marshaller (a mx.literal.Literal in this case) attempts to "start" the object.
    1. The start method checks if the content value is a suds.Object instance.
    2. However, it is not. It is the suds.sudsobjects.Object from step 3.
    3. The result of this is that the GraphResolver is not appropriately configured with the known type for the Subscriber.
  6. Future attempts to resolve elements declared in the Subscriber (but not the base APIObject type) will fail with TypeNotFound.

The patch

To get around this, I added the following code to my initialization code. I'm unfamiliar with the code and I have no idea what other issues this could cause. I searched through the suds codebase and see very few references to Object, and this one in literal.py appears to be the only one to suds.Object.

from suds.sudsobject import Object as ActualObject
import suds.mx.literal
suds.mx.literal.Object = ActualObject

What Next?

If this is not an issue, but my own ignorance, then that's great! I'm sorry for taking up your time! If not, I hope this issue report was helpful.

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

No branches or pull requests

1 participant