Re: Help with suds: HTTP Error 401
> ... HTTP Error 401 means "Unauthorized": the service you tried to use requires authentication and either it has not found authentication information or it was wrong. -- https://mail.python.org/mailman/listinfo/python-list
Re: Help with suds: HTTP Error 401
Use a SUDS fork that works, I tried https://github.com/unomena/suds See here: http://stackoverflow.com/questions/18455945/python-suds-runtimeerror-maximum-recursion-depth-exceeded-while-calling-a-pyth/24908676#24908676 -- https://mail.python.org/mailman/listinfo/python-list
Re: help with SUDS
Ismar Sehic writes: > hello, i'm trying to make a wrapper for making xml requests to hotelbeds.com > site. > ... > File "/usr/lib/python2.6/urllib2.py", line 1172, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib/python2.6/urllib2.py", line 1147, in do_open > raise URLError(err) > urllib2.URLError: This indicates a problem of the service you are contacting: "suds" tries to open a connection to the service url defined in the WSDL, but it does not get a response within a reasonable time frame. The problem might be temporary (a temporary overload of the corresponding service) - or they may be some error in the WSDL - or some firewall may interfere with your request - or ... -- https://mail.python.org/mailman/listinfo/python-list
help with SUDS
hello, i'm trying to make a wrapper for making xml requests to hotelbeds.com site. this is what i got: import logging from suds.xsd.doctor import ImportDoctor, Import from suds.plugin import Plugin logging.basicConfig(level = logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) from suds.client import Client url = 'http://xxx.xxx.xxx.xx/appservices/ws/FrontendService?wsdl' imp = Import('http://schemas.xmlsoap.org/soap/encoding/') doctor = ImportDoctor(imp) client = Client(url, doctor = doctor) print client rw = client.service.getHotelValuedAvail() print rw) print client which gives me following result : Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913 Service ( FrontendServiceService ) tns="http://www.hotelbeds.com/wsdl/2005/06"; Prefixes (1) ns0 = "http://schemas.xmlsoap.org/soap/encoding/"; Ports (1): (FrontendService) Methods (34): cancelProtectionAdd(xs:anyType cancelProtectionAdd, ) cancelProtectionRemove(xs:anyType cancelProtectionRemove, ) getCancelProtectionAvail(xs:anyType getCancelProtectionAvail, ) getCarCountryList(xs:anyType getCarCountryList, ) getCarInfoSet(xs:anyType getCarInfoSet, ) getCarValuedAvail(xs:anyType getCarValuedAvail, ) getCountryList(xs:anyType getCountryList, ) getDestinationGroupList(xs:anyType getDestinationGroupList, ) getHotelBoardGroupList(xs:anyType getHotelBoardGroupList, ) getHotelBoardList(xs:anyType getHotelBoardList, ) getHotelCategoryGroupList(xs:anyType getHotelCategoryGroupList, ) getHotelCategoryList(xs:anyType getHotelCategoryList, ) getHotelCountryList(xs:anyType getHotelCountryList, ) getHotelDetail(xs:anyType getHotelDetail, ) getHotelList(xs:anyType getHotelList, ) getHotelRoomTypeGroupList(xs:anyType getHotelRoomTypeGroupList, ) getHotelValuedAvail(xs:anyType getHotelValuedAvail, ) getIncomingOfficeDetail(xs:anyType getIncomingOfficeDetail, ) getIncomingOfficeList(xs:anyType getIncomingOfficeList, ) getPurchaseDetail(xs:anyType getPurchaseDetail, ) getPurchaseList(xs:anyType getPurchaseList, ) getTicketAvail(xs:anyType getTicketAvail, ) getTicketClassificationList(xs:anyType getTicketClassificationList, ) getTicketCountryList(xs:anyType getTicketCountryList, ) getTicketDetail(xs:anyType getTicketDetail, ) getTicketValuation(xs:anyType getTicketValuation, ) getTransferCountryList(xs:anyType getTransferCountryList, ) getTransferValuedAvail(xs:anyType getTransferValuedAvail, ) getZoneGroupList(xs:anyType getZoneGroupList, ) purchaseCancel(xs:anyType purchaseCancel, ) purchaseConfirm(xs:anyType purchaseConfirm, ) purchaseFlush(xs:anyType purchaseFlush, ) serviceAdd(xs:anyType serviceAdd, ) serviceRemove(xs:anyType serviceRemove, ) Types (48): ns0:Array ns0:ENTITIES ns0:ENTITY ns0:ID ns0:IDREF ns0:IDREFS ns0:NCName ns0:NMTOKEN ns0:NMTOKENS ns0:NOTATION ns0:Name ns0:QName ns0:Struct ns0:anyURI ns0:arrayCoordinate ns0:base64 ns0:base64Binary ns0:boolean ns0:byte ns0:date ns0:dateTime ns0:decimal ns0:double ns0:duration ns0:float ns0:gDay ns0:gMonth ns0:gMonthDay ns0:gYear ns0:gYearMonth ns0:hexBinary ns0:int ns0:integer ns0:language ns0:long ns0:negativeInteger ns0:nonNegativeInteger ns0:nonPositiveInteger ns0:normalizedString ns0:positiveInteger ns0:short ns0:string ns0:time ns0:token ns0:unsignedByte ns0:unsignedInt ns0:unsignedLong ns0:unsignedShort DEBUG:suds.client:sending to (http://212.170.239.71:9091/appservices /ws/FrontendService) message: http://axis.frontend.hydra.hotelbeds.com"; xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org /2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";> DEBUG:suds.client:headers = {'SOAPAction': u'""', 'Content-Type': 'text/xml; charset=utf-8'} Traceback (most recent call last): File "soaptest.py", line 23, in rw = client.service.getHotelValuedAvail() File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 542, in __call__ return client.invoke(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 602, in invoke result = self.send(soapenv) File "/usr/local/lib/python2.6/dist-packages/suds-0.4-py2.6.egg/suds/client.py", line 637, in send
Re: Help with suds: HTTP Error 401
I was having the same issue until I updated suds to the newest version. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help with suds: HTTP Error 401
On Jun 19, 12:16 pm, Sean DiZazzo wrote: > On Jun 11, 5:27 am, Eric von Horst wrote: > > > I have small program that tries to open a wsdl. When I execute the > > program I am getting 'suds.transport.TransportError: HTTP Error 401: > > Unauthorized' > > Hey Eric, > > Im a suds noob as well. I found some code that led me to the below > example. It worked for me when connecting to one particular site. I > couldnt tell you why though... I guess its worth a shot. > > from suds.transport.https import HttpAuthenticated > import urllib2 > > t = HttpAuthenticated(username='me', password='password') > t.handler = urllib2.HTTPBasicAuthHandler(t.pm) > t.urlopener = urllib2.build_opener(t.handler) > c = client.Client(url='http://xxx.xxx.xxx.xxx/path/to? > WSDL',transport=t) > > ~Sean thank you. that helped a lot. -- http://mail.python.org/mailman/listinfo/python-list
Re: Help with suds: HTTP Error 401
On Jun 11, 5:27 am, Eric von Horst wrote: > I have small program that tries to open a wsdl. When I execute the > program I am getting 'suds.transport.TransportError: HTTP Error 401: > Unauthorized' Hey Eric, Im a suds noob as well. I found some code that led me to the below example. It worked for me when connecting to one particular site. I couldnt tell you why though... I guess its worth a shot. from suds.transport.https import HttpAuthenticated import urllib2 t = HttpAuthenticated(username='me', password='password') t.handler = urllib2.HTTPBasicAuthHandler(t.pm) t.urlopener = urllib2.build_opener(t.handler) c = client.Client(url='http://xxx.xxx.xxx.xxx/path/to? WSDL',transport=t) ~Sean -- http://mail.python.org/mailman/listinfo/python-list
Re: Help with suds: HTTP Error 401
On Jun 11, 8:27 am, Eric von Horst wrote: > Hi, > > I am trying to do a very simple thing with SUDS but I think I am > missing the obvious (first time I use suds) > > I have small program that tries to open a wsdl. When I execute the > program I am getting 'suds.transport.TransportError: HTTP Error 401: > Unauthorized' Seems obvious but I specify username and pwd in the > code. > when use IE to go the wsdl, I get a pop-up asking me for the username > and pwd, I enter them, and the wsdl is displayed. > > This is my code: > " > from suds import WebFault > from suds.client import Client > from suds.transport.http import HttpAuthenticated > > t = HttpAuthenticated(username='admin', password='admin') > > client = Client('http://.xxx.xx.x:8080/axis2/services/UcmdbService? > wsdl', transport=t) > " > I seems straightforward :( > > Any help much appreciated. > > Erik im having the same issue as well. -- http://mail.python.org/mailman/listinfo/python-list
Help with suds: HTTP Error 401
Hi, I am trying to do a very simple thing with SUDS but I think I am missing the obvious (first time I use suds) I have small program that tries to open a wsdl. When I execute the program I am getting 'suds.transport.TransportError: HTTP Error 401: Unauthorized' Seems obvious but I specify username and pwd in the code. when use IE to go the wsdl, I get a pop-up asking me for the username and pwd, I enter them, and the wsdl is displayed. This is my code: " from suds import WebFault from suds.client import Client from suds.transport.http import HttpAuthenticated t = HttpAuthenticated(username='admin', password='admin') client = Client('http://.xxx.xx.x:8080/axis2/services/UcmdbService? wsdl', transport=t) " I seems straightforward :( Any help much appreciated. Erik -- http://mail.python.org/mailman/listinfo/python-list