suds-py3
suds-py3 copied to clipboard
importing `suds.Object` class in mx.literal results in `TypeNotFound` later
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
- I am working with a SOAP service publishing this WSDL.
- I am creating a
Subscriber
object (WSDL line 2064) using thesuds.client.Client.factory.create()
instance method. - The factory returns a
suds.sudsobjects.Object
instance - I then pass this object through to a Service method call
- Later on, when trying to build the bodycontent, the binding marshaller (a
mx.literal.Literal
in this case) attempts to "start" the object.- The start method checks if the content value is a
suds.Object
instance. - However, it is not. It is the
suds.sudsobjects.Object
from step 3. - The result of this is that the
GraphResolver
is not appropriately configured with the known type for the Subscriber.
- The start method checks if the content value is a
- Future attempts to resolve elements declared in the Subscriber (but not the base
APIObject
type) will fail withTypeNotFound
.
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.