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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:11:38+00:00 2026-06-03T04:11:38+00:00

Still quite new to Python. I have a problem similar to this question .

  • 0

Still quite new to Python. I have a problem similar to this question. My script is attempting to connect with a web-service that uses wsse on messages and is provisioned using HTTPS. I have to use a non-authenticated proxy. I use suds to use the service as follows:

import logging
import suds
import urllib2
from suds.client import Client
from suds.transport.https import HttpAuthenticated

#---These are not real values but represent them.---------
SERVICE_URL = 'https://service.com/1/soap'
SERVICE_USR = 'serviceusr'
SERVICE_PWD = 'servicepwd'
WSDL_URL = 'file:///folder/a.wsdl'
PROXY_NAME = 'proxy'
PROXY_PORT = 80
#----------------------------------------------------------

logging.basicConfig(level = logging.DEBUG)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
logging.getLogger('suds.transport').setLevel(logging.DEBUG)

proxy_info = {'host': PROXY_NAME,'port': PROXY_PORT}
proxyHandler = urllib2.ProxyHandler({'https':'https://(host)s:%(port)d/' % proxy_info})
opener = urllib2.build_opener(proxyHandler)
urllib2.install_opener(opener)
security = suds.wsse.Security()
token = suds.wsse.UsernameToken(SERVICE_USR, SERVICE_PWD)
security.tokens.append(token)
messageTransport = HttpAuthenticated(username = SERVICE_USR, password = SERVICE_PWD)
messageTransport.urlopner = opener
client = Client(url = WSDL_URL, location = SERVICE_URL, transport = messageTransport)
client.set_options(wsse=security)
result = client.service.ParseValidAddress('1 ABC Street Somwhere')

Once the script runs I get the following error:

Error details: <class 'urllib2.URLError'> <urlopen error [Errno -2] Name or service not 
known>

So I ran curl to check all the networking bits are working as follows:

curl -x proxy:80 https://service1.com/1/soap

This returns a SOAP message which indicates the network configuration and proxy are set-up correctly. So why does suds not do the same? Where have I failed?

  • 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-03T04:11:39+00:00Added an answer on June 3, 2026 at 4:11 am

    Success! I did the following and it worked. Added proxySettings = {'https':'http://{0}:{1}'.format(PROXY_NAME, PROXY_PORT)} and then set the option in the client client.set_options(proxy = proxySettings). Thanks to all for help.

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

Sidebar

Related Questions

I'm still quite new with jQuery, I know that I could google and have
I'm still quite new to ASP.Net MVC, so maybe this is a stupid question.
I am still quite new to Codeigniter and have a noob problem I need
I'm coming from Sinatra to Rails and still quite new to Rails. My problem
I have done quite some cocoa-touch stuff, but am still new to cocoa. I
Having a slight problem on C#, still quite new to the language but hoping
I'm still quite new to OOP, and have been learning-as-I-go with CodeIgniter2+Doctrine2. I have
I'm still quite new at iPhone/Xcode development. I made one app so far that
I'm still quite new to this but I've been learning really quickly with the
This might not be the cleanest code yet, still quite new to Ruby... I

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.