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 8531863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:34:59+00:00 2026-06-11T09:34:59+00:00

I’m trying to use the salesforce-python-toolkit to make web services calls to the Salesforce

  • 0

I’m trying to use the salesforce-python-toolkit to make web services calls to the Salesforce API, however I’m having trouble getting the client to go through a proxy. Since the toolkit is based on top of suds, I tried going down to use just suds itself to see if I could get it to respect the proxy setting there, but it didn’t work either.

This is tested on suds 0.3.9 on both OS X 10.7 (python 2.7) and ubuntu 12.04.

an example request I’ve made that did not end up going through the proxy (just burp or charles proxy running locally):

import suds
ws = suds.client.Client('file://sandbox.xml',proxy={'http':'http://localhost:8888'})
ws.service.login('user','pass')

I’ve tried various things with the proxy – dropping http://, using an IP, using a FQDN. I’ve stepped through the code in pdb and see it setting the proxy option. I’ve also tried instantiating the client without the proxy and then setting it with:
ws.set_options(proxy={‘http’:’http://localhost:8888′})

Is proxy not used by suds any longer? I don’t see it listed directly here http://jortel.fedorapeople.org/suds/doc/suds.options.Options-class.html, but I do see it under transport. Do I need to set it differently through a transport? When I stepped through in pdb it did look like it was using a transport, but I’m not sure how.

Thank you!

  • 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-06-11T09:35:00+00:00Added an answer on June 11, 2026 at 9:35 am

    I went into #suds on freenode and Xelnor/rbarrois provided a great answer! Apparently the custom mapping in suds overrides urllib2’s behavior for using the system configuration environment variables. This solution now relies on having the http_proxy/https_proxy/no_proxy environment variables set accordingly.

    I hope this helps anyone else running into issues with proxies and suds (or other libraries that use suds). https://gist.github.com/3721801

    from suds.transport.http import HttpTransport as SudsHttpTransport 
    
    
    class WellBehavedHttpTransport(SudsHttpTransport): 
        """HttpTransport which properly obeys the ``*_proxy`` environment variables.""" 
    
        def u2handlers(self): 
            """Return a list of specific handlers to add. 
    
            The urllib2 logic regarding ``build_opener(*handlers)`` is: 
    
            - It has a list of default handlers to use 
    
            - If a subclass or an instance of one of those default handlers is given 
                in ``*handlers``, it overrides the default one. 
    
            Suds uses a custom {'protocol': 'proxy'} mapping in self.proxy, and adds 
            a ProxyHandler(self.proxy) to that list of handlers. 
            This overrides the default behaviour of urllib2, which would otherwise 
            use the system configuration (environment variables on Linux, System 
            Configuration on Mac OS, ...) to determine which proxies to use for 
            the current protocol, and when not to use a proxy (no_proxy). 
    
            Thus, passing an empty list will use the default ProxyHandler which 
            behaves correctly. 
            """ 
            return []
    
    client = suds.client.Client(my_wsdl, transport=WellBehavedHttpTransport())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.