Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Suds library for any SOAP request using FuelSDK creates an humongous object #46

Open
ZMI-YohanandGopal opened this issue Jul 27, 2015 · 3 comments

Comments

@ZMI-YohanandGopal
Copy link

We are trying to run the calls found under https://code.exacttarget.com/apis-sdks/fuel-sdks/index.html. I am using the python examples from the website and using the below version of the libraries to send request to exact target

  • PyJWT=0.1.9 (jwt)
  • distribute=0.7.3
  • requests=2.2.1
  • suds=0.4
  • wsgiref=0.1.2
  • FuelSDK=0.9.3
  • As per our investigation we are seeing the below behavior:

Create of SOAP message by the FuelSDK takes a constant 10- 15 seconds.

File: suds/client.py Function: create() which is called in FuelSDK/rest.py::auth_stub.soap_client.service.create(None, self.parse_props_into_ws_object(auth_stub, obj_type, props)), in turn calls the build().

File: suds/builder.py: build() creates a “data” object which is more than 19000 lines. This is what is causing the delay, but we don’t control both FuelSDK and suds library. Are we doing something wrong?

• We have set our AUTH_URL legacy parameter as 1, is it causing the issue? Legacy set to 0 is not working for us as it is throwing a “KeyError: 'legacyToken'”. Our config setting:

os.environ["FUELSDK_AUTH_URL"] = "https://auth.exacttargetapis.com/v1/requestToken?legacy=1"

I have tried this in multiple vm's and all of them are behaving the same way.

Any help will be appreciated.

@BrianEdwardHoover
Copy link

This is inline with the experience I'm having as well. It appears the calls and response walks the full object as defined in the wsdl from your parent object to it's child object (repeating with the child as the new parent, ad infinitum) regardless of the need for those child elements.

I haven't done any level of investigation as our scale of implementation hasn't required increased performance. I would love to hear others thoughts on this isssue.

@ZMI-YohanandGopal ZMI-YohanandGopal changed the title Suds library for any SOAP request using FuelSDK creates an humungous object Suds library for any SOAP request using FuelSDK creates an humongous object Jul 27, 2015
@mastanbol
Copy link

I am also experiencing the same issue. Is there any solution or workaround for this.

@josephdrose
Copy link

Inelegant and probably a terrible solution, but here's how I "fixed" it in our code:

from suds.builder import Builder

old_skip_child = Builder.skip_child


def new_skip_child(self, child, ancestry):
    # the salesforce wsdl has an infinite recursion; cap it off at 4 to make it faster
    # on a macbook pro, 15 seconds to 600ms spent on building the object
    if len(ancestry) > 4:
        return True

    return old_skip_child(self, child, ancestry)

Builder.skip_child = new_skip_child

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants