Re: **** httplib.InvalidURL: nonnumeric port ****

Discussion in 'Python' started by Chris Rebert, Dec 20, 2010.

  1. Chris Rebert

    Chris Rebert Guest

    > On Tue, Dec 21, 2010 at 12:42 AM, Kev Dwyer <> wrote:
    >> On Tue, 21 Dec 2010 00:01:44 +0530, Anurag Chourasia wrote:
    >> >>> import httplib
    >> >>> help(httplib.HTTP)

    >> Help on class HTTP in module httplib:
    >>
    >> class HTTP
    >>  |  Compatibility class with httplib.py from 1.5.
    >>  |
    >>  |  Methods defined here:
    >>  |
    >>  |  __init__(self, host='', port=None, strict=None)
    >>
    >> The constructor doesn't take a complete URL as an argument.
    >>
    >> Also, shouldn't you be using httplib.HTTPConnection?  The docs
    >>  state that httplib.HTTP is for backward compatibility only.
    >>

    On Mon, Dec 20, 2010 at 11:30 AM, Anurag Chourasia
    <> wrote:
    > Hi Kevin,
    > Thanks for the response.
    > I tried with HTTPConnection but the same problem.
    >>>> h1 =
    >>>> httplib.HTTPConnection('http://joule:8041/DteEnLinea/ws/EnvioGuia.jws')

    > Traceback (most recent call last):
    >   File "<stdin>", line 1, in ?
    >   File "/u01/home/apli/wm/python241/lib/python2.4/httplib.py", line 582, in
    > __init__
    >     self._set_hostport(host, port)
    >   File "/u01/home/apli/wm/python241/lib/python2.4/httplib.py", line 594, in
    > _set_hostport
    >     raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
    > httplib.InvalidURL: nonnumeric port: '8041/DteEnLinea/ws/EnvioGuia.jws'
    > Do i need to use some other library to be able to send XML Data (and get a
    > response back) to this Kind of Web Service address
    > i.e. http://joule:8041/DteEnLinea/ws/EnvioGuia.jws ?
    > Regards,
    > Anurag


    (1) Please avoid top-posting
    (2) Did you read the other part of Kev's comment? "The constructor
    doesn't take a complete URL as an argument." You must pass only the
    domain to the constructor and then call .request() on the
    HTTPConnection object.
    (3) If you're using SOAP, try https://fedorahosted.org/suds/

    Cheers,
    Chris
    --
    http://blog.rebertia.com
    Chris Rebert, Dec 20, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John T. Goodman

    Overhead of 4-port over 2-port SRAM

    John T. Goodman, Jan 25, 2005, in forum: VHDL
    Replies:
    0
    Views:
    586
    John T. Goodman
    Jan 25, 2005
  2. Sean Wolfe
    Replies:
    1
    Views:
    2,236
    Joerg Jooss
    Apr 28, 2005
  3. b3ny
    Replies:
    11
    Views:
    907
    Babu Kalakrishnan
    Nov 20, 2004
  4. Gerald Klix
    Replies:
    0
    Views:
    1,257
    Gerald Klix
    Oct 26, 2005
  5. Phoe6
    Replies:
    11
    Views:
    1,004
    Phoe6
    Nov 13, 2006
Loading...

Share This Page