Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 936693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:21:21+00:00 2026-05-15T21:21:21+00:00

When I’m trying get method from remote webservice it gives me error. My code

  • 0

When I’m trying get method from remote webservice it gives me error.

My code is:

        portion=10
        start=0
        print self.stamp.datetime
        client=self.client
        while 1:
            print 'getting ids...........'
            fresh_ids=client.service.GetTopicsIDsUpdatedAfterDateTime(self.stamp.datetime,start,portion) #this line makes exception
            if len(fresh_ids) is not 0:
                for id in fresh_ids:
                    yield id
                start=+portion
            else:
                print 'No updated topics anymore'
                sys.exit()

There is trace-back:

 /usr/lib/python2.5/site-packages/suds-0.3.5-py2.5.egg/suds/client.py
in invoke(self, args, kwargs)
    469         binding = self.method.binding.input
    470         binding.options = self.options
--> 471         msg = binding.get_message(self.method, args, kwargs)
    472         timer.stop()
    473         metrics.log.debug(

/usr/lib/python2.5/site-packages/suds-0.3.5-py2.5.egg/suds/bindings/binding.py
in get_message(self, method, args, kwargs)
     96         content = self.headercontent(method)
     97         header = self.header(content)
---> 98         content = self.bodycontent(method, args, kwargs)
     99         body = self.body(content)
    100         env = self.envelope(header, body)

/usr/lib/python2.5/site-packages/suds-0.3.5-py2.5.egg/suds/bindings/rpc.py
in bodycontent(self, method, args, kwargs)
     61             p = self.mkparam(method, pd, value)
     62             if p is not None:
---> 63                 root.append(p)
     64             n += 1
     65         return root

/usr/lib/python2.5/site-packages/suds-0.3.5-py2.5.egg/suds/sax/element.py
in append(self, objects)
    329                 child.parent = self
    330                 continue
--> 331             raise Exception('append %s not-valid' %
child.__class__.__name__)
    332         return self
    333

<type 'exceptions.Exception'>: append list not-valid

There is the method in suds module which raises an Exception:

def insert(self, objects, index=0):
        """
        Insert an L{Element} content at the specified index.
        @param objects: A (single|collection) of attribute(s) or element(s)
            to be added as children.
        @type objects: (L{Element}|L{Attribute})
        @param index: The position in the list of children to insert.
        @type index: int
        @return: self
        @rtype: L{Element}
        """
        objects = (objects,)
        for child in objects:
            if isinstance(child, Element):
                self.children.insert(index, child)
                child.parent = self
            else:
                raise Exception('append %s not-valid' % child.__class__.__name__)
        return self

In the console everything is going well.
I’m stuck.

Ok, I tried to make an experiment:

def YieldID(self):
        portion=10
        start=0
        print self.stamp.datetime
        fresh_ids=self.client.service.GetTopicsIDsUpdatedAfterDateTime(self.stamp.datetime,start,portion) #This work
        while 1:
            print 'getting ids...........'
            fresh_ids=self.client.service.GetTopicsIDsUpdatedAfterDateTime(self.stamp.datetime,start,portion) # This raise exception
            if len(fresh_ids)!=0:
                for id in fresh_ids:
                    yield id
                start=+portion
            else:
                print 'No updated topics anymore'
                sys.exit()

I add calling of the same method before WHILE end it work. But when it go inside while gives me exception.

How it can work before loop, and don’t work inside loop? That is the main question. What changed?

I even tried changing while to for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:21:21+00:00Added an answer on May 15, 2026 at 9:21 pm

    Edit: On another look at the code, I noticed that this line:

                start=+portion
    

    needs to be changed to

                start += portion
    

    That might make the following analysis unnecessary… but I think there might still be an issue in your suds source, as explained below.


    The first question I’d ask is: Are you sure that nothing is changing inside your self.client object between calls to YieldID?

    The other concern I have — which may well be indicative of nothing at all — is that you may have posted the wrong source for the function where the Exception is raised. The traceback shows that the Exception is raised during a call to append, but the code you included is for insert. It looks as if insert‘s Exception message identifies it as “append” due to a copy and paste error.

    And there’s more. Assuming that I’ve identified the right source location, here’s the full source for append, which starts with line number 313:

    def append(self, objects):
        """
        Append the specified child based on whether it is an
        element or an attrbuite.
        @param objects: A (single|collection) of attribute(s) or element(s)
            to be added as children.
        @type objects: (L{Element}|L{Attribute})
        @return: self
        @rtype: L{Element}
        """
        if not isinstance(objects, (list, tuple)):
            objects = (objects,)
        for child in objects:
            if isinstance(child, Element):
                self.children.append(child)
                child.parent = self
                continue
            if isinstance(child, Attribute):
                self.attributes.append(child)
                child.parent = self
                continue
            raise Exception('append %s not-valid' % child.__class__.__name__)
        return self
    

    Here, the Exception is raised on line 334, not 331 as your traceback shows.

    Are you sure that you’re using the original version of suds 0.3.5, and not a modified version? Because the original version of append has an interesting difference with insert: insert always creates a tuple out of its input argument, which seems redundant at best:

    def insert(self, objects, index=0): // line 337
        # ... snip to line 348
        objects = (objects,)
    

    whereas the original append does this conditionally (see above):

        if not isinstance(objects, (list, tuple)):
            objects = (objects,)
    

    Now look at the message in the exception:

    : append
    list not-valid

    This means that the child that it tried to append was itself a list. But how could this be? If a list had been passed in as input, then we should be iterating through the children of that list… which should not themselves be lists.

    Hmm. Perhaps a doubly-nested list had been passed into append as the object parameter, which would seem to indicate some pretty bad corruption of data structures. (See my first question.)

    Or…

    What follows is sheer speculation, and can’t possibly be right … unless it is…

    Or, maybe, you’re using a modified version of Suds in which that conditional conversion to a list has been removed, along with the iteration through the list? That would explain the 3-line difference (331 vs. 334) between the code you posted and the source that I found online. Could you double-check the source file that you’re using, and let us know for sure?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.