I have a list of 150k criminal attorneys in the USA
by tectonic Stern
Save on advertising list costs until this Friday:
ANY 2 lists below for just $199
ANY 7 lists below for just $499
[ HEALTHCARE ]
> Complete US Physicians Database
> Chiropractic Doctors in the USA
> American Holistic Medicine Providers/Clinics
> General Dentists in the USA
> American Veterinarians & Veterinary Clinics
> US Hospitals
> Nursing Homes int the US
> Pharmaceutical Company Employees
> Physical/Occupational Therapy Clinics and Therapists in the US
> Oncology Physicians in the US
> US Surgery Centers
> Massage Therapists/Therapy Clinics in America
> Acupuncturists/clinics in the US
> Medical Equipment Suppliers(USA)
> Mental Health Counselors (USA)
> Optometrists/Clinics (USA)
> Psychologists (USA)
[ BUSINESS LISTS ]
> Hotels in the USA
> Realtors in the USA
> USA Business Database
> Manufacturer Database (USA)
> Financial Planner Database (USA)
> Finance & Professionals Database (USA)
[ CONSUMER LISTS ]
> USA Consumer Database
> Credit Inquiries Database (USA)
> American Homeowners
[ PROFESSIONALS LISTS ]
> USA Lawyers Database
> Criminal Attorneys in the US
Email me for counts, breakdowns and sample spreadsheets: thinksuccess(a)gmx.com
By emailing purgefile(a)gmx.com you will have your email taken off
13 years, 6 months
Re: [Fedora-suds-list] Error connecting to WSDL that requires authentication
by Janet Valbuena
Hi Matt et all
I've actually solved the problem last week.
Unfortunately I have to say the documentation didn't help. I tried all the
options in https://fedorahosted.org/suds/wiki/Documentation#Basic, but none
of them worked.
Why? I don't have any idea. I'm using suds 0.4 and Python 2.4.4.
After several attempts guessing how to solve the problem this was the
solution:
import base64
Username = “user”
Password = “abc123”
base64AuthString = "Basic " + base64.b64encode (Username + ":" + Password)
import urllib2
objU2opener = urllib2.build_opener ()
objU2opener.addheaders = [('Authorization', base64AuthString)]
objCustomTransport = suds.transport.http.HttpTransport ()
objCustomTransport.urlopener = objU2opener
WSDL = “http://localhost:8080/external/services/DomService?wsdl”
WSDLProxy = suds.client.Client (WSDL, transport = objCustomTransport)
I had suggestions of reading the WSDL using other means and putting it into
a file, which I tried, but not having the authentication issue solved in
suds wouldn’t allow me to call any of the WSDL methods successfully anyway.
The code above was just what I needed!
Cheers
Janet
On 19/10/10 20:37, "Matt C" <mcauthorn(a)gmail.com> wrote:
> Janet: I would do some logging on this to see what is going on in
> detail. You'll find information on how to do this in the suds
> documentation from the site. Also, I've run into bizarre transport
> issues with certain versions of urllib2 in the past - rare, but it's
> definitely happened and an upgrade fixed things. What version of suds
> / python are you running, by chance?
>
> Also, for basic auth you should be able to simply pass the client
> object username/password arguments and Suds will do the right thing
> transport-wise. This may be worth another shot (see the notes on buggy
> servers and the basic auth RFC).
>
> -Matt
>
> 2010/10/8 Janet Valbuena <janet.valbuena(a)tpp.com.au>:
>> Dear Daniel
>>
>> Thanks for assistance, but it still doesn’t make sense that I have to pass
>> the WSDL as parameter to connect to a URL via suds.client.Client where I
>> will get precisely that same WSDL.
>>
>> I’m confused.
>>
>> Thanks anyway. I think I’ll have to get back to SOAPpy unless I hear another
>> suggestion to fix my problem.
>>
>> Regards
>>
>> Janet
>>
>>
>> On 8/10/10 11:04, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
>>
>> Hi Janet,
>>
>> I can't really tell you what the realm should be because I haven't found
>> myself in such situation
>>
>> You pass the hacked transport (that should be reading the WSDL from the
>> "fileFromU2" file object) because the standard transport included in suds
>> assumes a plain HTTP download for WSDL files (unless someone in the list
>> proves me wrong and can provide a working example, which would be great)
>>
>> That's why Joshua suggested that you downloaded the file to disk. I only
>> added the means to avoid disk storage by passing the WSDL file object
>> directly to a suds compliant transport.
>>
>> But your problem is that you are apparently unable to download the WSDL file
>> (therefore the empty "read"). This is where your problem lies and I guess we
>> can't remotely help you there.
>>
>> Best regards
>>
>> Daniel
>>
>> On Fri, Oct 8, 2010 at 10:37, Janet Valbuena <janet.valbuena(a)tpp.com.au>
>> wrote:
>>
>> Hi Daniel
>>
>> This still doesn’t make sense.
>>
>> I understand you’re suggesting this:
>>
>>
>> WSDL = "http://localhost:18080/external/services/DomService?wsdl"
>> User = “user1”
>> Password = “pass123”
>>
>> # Is this OK?
>> URI = "http://localhost:18080/” <http://localhost:18080/²>
>>
>> # What should the realm be? Is this OK?
>> Realm = “external/services/DomService”
>>
>> import urllib2
>> auth_handler = urllib2.HTTPBasicAuthHandler()
>> auth_handler.add_password(realm=Real, ?uri='your_url_without_the_file_name',
>> user=User, passwd=Password)
>>
>> opener = urllib2.build_opener(auth_handler)
>> urllib2.install_opener(opener)
>>
>> fileFromU2 = urllib2.open(WSDL)
>>
>> #Note that up to this point, the code doesn’t show any errors but
>> fileFromU2.read () is an empty string.
>>
>> # Then I’m supposed to use the transport hack class:
>>
>> myClient = suds.client.Client(WSDL, transport=HackTransport(fileFromU2),
>> etc)
>>
>> # The question is, why should I pass fileFromU2 as a transport parameter,
>> when what I’m trying to get through calling the Client is precisely that
>> WSDL?
>>
>>
>> What I’m really hoping to do (in case I haven’t been clear) is something
>> like this:
>>
>> # Assuming the authorisation issue is solved somehow by producing a ‘t’
>> parameter to pass on here:
>> myClient = suds.client.Client(WSDL, transport=t)
>>
>> # Call some of the methods available in the WSDL, for example:
>> Result = myClient.createAccount({“name”:”janet”, “phone”: “8989898989”,
>> “address”:”12 Victoria St”, “city”:”Manly”, “email”: “janet(a)blahh.xn--com}-ib7a)
>>
>> Is perhaps suds.client.Client NOT the class I need?
>>
>> Thanks again for your time and answers in advance.
>>
>> Cheers
>>
>> Janet
>>
>>
>> On 7/10/10 21:42, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
>>
>> Hi Janet,
>>
>> The code provided by Joshua lets you download the WSDL to a "file" object.
>> That's why the last statement of his example is:
>>
>> print urllib2.open(WSDL).read()
>>
>> whis is basically first opening a file (open), then reading the content to a
>> string (read) and printing it to standard output. If you simply do:
>>
>> fileFromU2 = urllib2.open(WSDL)
>>
>> you get direct acess to the file object and can pass it to the hacked
>> transport I provided before.
>>
>> Best regards
>>
>> Daniel
>>
>> On Thu, Oct 7, 2010 at 13:03, Janet Valbuena <janet.valbuena(a)tpp.com.au>
>> wrote:
>>
>> Joshua, Daniel
>>
>> Thanks very much for your quick response.
>>
>> I tried Joshua’s suggestion but it didn’t work.
>>
>> I don’t understand what you suggest Daniel. What should fileFromU2 be?
>>
>> I may be wrong by using the Client method in the first place. ?? The purpose
>> of my script is to use an API which is set up as a SOAP service.
>>
>> Why would I need to download the WSDL file and then pass it to the transport
>> hack when I can’t even get the WSDL and the purpose of client = Client
>> (WSDL) is to connect to the WSDL itself?
>>
>> Cheers
>>
>> Janet
>>
>>
>> On 7/10/10 09:33, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
>>
>> Hi,
>>
>> I think the problem is in the connect itself.
>>
>> The standard transport included in suds assumes that only the SOAP calls may
>> need authentication or other things. Downloading the WSDL is attempted with
>> a plain HTTP GET (Not even POST is allowed)
>>
>> I guess that the transport covers at least 95% of standard situations, but
>> it didn't for example cover mine, where I wanted to embed the WSDSL as a
>> string in my code. Of course only with my own transport I could give suds a
>> "file" object with the content of the string.
>>
>> It is my feeling that a better transport could be written (we have seen some
>> examples shared in the mailing list) although some use cases may require
>> re-thinking how a Client is initialized.
>>
>> In the case pertaining to Janet, I guess she may download the WSDL file as
>> you suggest, pass it to the transport hack below. She may then use this
>> transport during client initialization. Obviously this is only good for 1
>> WSDL file. (The transport below can also load WSDL content directly from a
>> string)
>>
>> ?? ?class TransportHack(Transport):
>> ?? ? ? ?def __init__(self, wsdlFile=None, **kwargs):
>> ?? ? ? ? ? ?Transport.__init__(self, **kwargs)
>> ?? ? ? ? ? ?self.wsdlcontent = wsdlFile
>>
>> ?? ? ? ?def open(self, request):
>> ?? ? ? ? ? ?if self.wsdlFile is not None:
>> ?? ? ? ? ? ? ? ?return self.wsdlFile
>>
>> ?? ? ? ? ? ?log.debug('opening: (%s)', request.url)
>> ?? ? ? ? ? ?fp = None
>> ?? ? ? ? ? ?location = request.url.lstrip()
>> ?? ? ? ? ? ?if location.startswith('<?'):
>> ?? ? ? ? ? ? ? ?log.debug('returning url (%s) as StringIO file')
>> ?? ? ? ? ? ? ? ?fp = StringIO(location)
>> ?? ? ? ? ? ?else:
>> ?? ? ? ? ? ? ? ?parsed = urlparse(request.url)
>> ?? ? ? ? ? ? ? ?if parsed.scheme == 'file':
>> ?? ? ? ? ? ? ? ? ? ?log.debug('opening file (%s) with open', parsed.path)
>> ?? ? ? ? ? ? ? ? ? ?try:
>> ?? ? ? ? ? ? ? ? ? ? ? ?fp = open(parsed.path)
>> ?? ? ? ? ? ? ? ? ? ?except Exception, e:
>> ?? ? ? ? ? ? ? ? ? ? ? ?raise TransportError(str(e), 503, StringIO(''))
>> ?? ? ? ? ? ? ? ?else:
>> ?? ? ? ? ? ? ? ? ? ?log.debug('opening scheme (%s) over the network',
>> parsed.scheme)
>> ?? ? ? ? ? ? ? ? ? ?try:
>> ?? ? ? ? ? ? ? ? ? ? ? ?url = request.url
>> ?? ? ? ? ? ? ? ? ? ? ? ?log.debug('opening (%s)', url)
>> ?? ? ? ? ? ? ? ? ? ? ? ?u2request = u2.Request(url)
>> ?? ? ? ? ? ? ? ? ? ? ? ?self.proxy = self.options.proxy
>> ?? ? ? ? ? ? ? ? ? ? ? ?return self.u2open(u2request)
>> ?? ? ? ? ? ? ? ? ? ?except u2.HTTPError, e:
>> ?? ? ? ? ? ? ? ? ? ? ? ?raise TransportError(str(e), e.code, e.fp)
>> ?? ? ? ? ? ?return fp
>>
>> Then do something like
>>
>> myClient = suds.client.Client(wsdl, transport=HackTransport(fileFromU2),
>> etc)
>>
>>
>> Best regards
>>
>> Daniel
>>
>> On Wed, Oct 6, 2010 at 21:22, Joshua J. Kugler <joshua(a)eeinternet.com>
>> wrote:
>>
>> On Wednesday 06 October 2010, Janet Valbuena elucidated thus:
>>> Hi
>>>
>>> I'm new to suds (have just downloaded it after getting frustrated
>>> with SOAPpy).
>>>
>>> I'm trying to connect to a WSDL which requires basic HTTP
>>> authentication. I have been able to connect to it correctly using PHP
>>> but I need to use Python.
>>>
>>>
>>> This is my code:
>>>
>>> #!/usr/bin/python
>>>
>>> Username = "user"
>>> Password = "pass123"
>>> from suds.transport.http import HttpAuthenticated
>>> t = HttpAuthenticated(username=Username, password=Password)
>>>
>>> # WSDL is only available in internal network
>>> WSDL = "http://localhost:18080/external/services/DomService?wsdl"
>>> from suds.client import Client
>>> client = Client(WSDL, transport=t)
>>>
>>>
>>>
>>>
>>> And this is the error it returns:
>>>
>>> Traceback (most recent call last):
>>> ? File "./wsdltest.py", line 25, in <module>
>>> ? ? client = Client(wsdl, transport=t)
>>> ? File "build/bdist.linux-i686/egg/suds/client.py", line 112, in
>>> __init__ File "build/bdist.linux-i686/egg/suds/reader.py", line 152,
>>> in open File "build/bdist.linux-i686/egg/suds/wsdl.py", line 136, in
>>> __init__ File "build/bdist.linux-i686/egg/suds/reader.py", line 79,
>>> in open File "build/bdist.linux-i686/egg/suds/reader.py", line 101,
>>> in download File "build/bdist.linux-i686/egg/suds/sax/parser.py",
>>> line 136, in parse File "/usr/lib/python2.5/xml/sax/expatreader.py",
>>> line 107, in parse xmlreader.IncrementalParser.parse(self, source)
>>> ? File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 125, in parse
>>> ? ? self.close()
>>> ? File "/usr/lib/python2.5/xml/sax/expatreader.py", line 217, in
>>> close self.feed("", isFinal = 1)
>>> ? File "/usr/lib/python2.5/xml/sax/expatreader.py", line 211, in feed
>>> ? ? self._err_handler.fatalError(exc)
>>> ? File "/usr/lib/python2.5/xml/sax/handler.py", line 38, in
>>> fatalError raise exception
>>> xml.sax._exceptions.SAXParseException: <unknown>:1:0: no element
>>> found
>>
>> I would try to download the file with a quick urllib2 script and see
>> what you get. ?The error is not in the connect (that would raise its
>> own exception) but in trying to parse what *is* being downloaded.
>>
>> Something like:
>>
>> import urllib2
>> auth_handler = urllib2.HTTPBasicAuthHandler()
>> auth_handler.add_password(realm='name_of_your_realm',
>> ?? ? ? ? ? ? ? ? ? ? ? ? ?uri='your_url_without_the_file_name',
>> ?? ? ? ? ? ? ? ? ? ? ? ? ?user=User,
>> ?? ? ? ? ? ? ? ? ? ? ? ? ?passwd=Password)
>> opener = urllib2.build_opener(auth_handler)
>> urllib2.install_opener(opener)
>>
>> print urllib2.open(WSDL).read()
>>
>> j
>>
>> --
>> Joshua Kugler
>> Part-Time System Admin/Programmer
>> http://www.eeinternet.com - Fairbanks, AK
>> PGP Key: http://pgp.mit.edu/ ?ID 0x73B13B6A
>> _______________________________________________
>> suds mailing list
>> suds(a)lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/suds
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> suds mailing list
>> suds(a)lists.fedoraproject.org
>> https://admin.fedoraproject.org/mailman/listinfo/suds
>>
13 years, 6 months
For Sale:Pielstick 12PC2.5 7800 PS 580 RPM With Gear Box - Pielstick 6PC2.5 Complete Engines
by Engine Stocklist
20-10-2010
Dear Sir Good Days !!!!!
Our Company Buying all kind of Vessels For Demolition with Cash Payment. If you have any vessel for scrap please let us the particulars and we will offer the best market price.
We are looking for Wartsila 6L46B Crankshaft in Good Condition !!!!!
Fallowing the items are ready for export.
Also USED Wartsila 46C Cyl Head Bare 2 PCS / Piston Complete 2 PCS / Con Rod Upperpart 4 PCS/ Gudgeon Pin 6 PCS For Sale
Wartsila 46B Used Bare Cyl Head 2 PCS
2 x SKL 6VDS 48/42 Al-2
2 x SKL 6 NVD 48 A2U
SULZER 8ZL 40/48 MAIN ENGINE 2978 KW 530 RPM
SULZER 6TD36 1000 PS 278 RPM MAIN ENGINE
DEUTZ SBV6M540 600 RPM 1920 KW - 2610 HP
DEUTZ BV 12M 628 GENSET 2225 KVA 60 HZ/720 RPM 440V
-------------------------------------------------------
DEUTZ SBV 6M 628 1276 KW 900 RPM 1993 BUILD
------------------------------------------------------------
Deutz BV8M540 MAIN ENGINE 4490 HP 3305 KW 600 RPM 1982 Built
DEUTZ RBV 8M 545 MAIN ENGINE
DEUTZ SBV 6M 358 MAIN ENGINE 2200 HP 375 RPM
MAN B&W 6L28/32 GOOD CONDITION GENSET BUILT 1987 1260 KW 720 RPM 1500 KVA 60 HZ
B&W 6S28LH-4 1050 HP 720 RPM Gensets Built 1983
SEMT PIELSTICK 6PC2.5L-400 2869 KW 3901 HP 520 RPM
SEMT PIELSTICK 12PC2-5V MAIN ENGINE 2 PCS WITH GEAR BOX 7800 PS 520 RPM
HITACHI B&W 7L35MC 4760 BHP -3500 KW
YANMAR 6Z-ST MAIN ENGINE 1600 KW 580 RPM
DEUTZ A8M 528 390 PS 240 KW
CATERPILLAR 3508 B 2002 MODEL MARINE GENSET 60 hz
CATERPILLAR 3512B GENSET 60 HZ 1910 bhp 1300 kw year of manufacure: 2003
CATERPILLAR 3512 MAIN ENGINE 2000 MODEL WITH GEAR BOX
MAX. ADV. POWER 968 kW 1298 HP MAX. RATED SPEED 1800 RPM MAX. LOW IDLE SPEED 1450 RPM
------------------------------------------------------------
SULZER 6AL 25/30 MARINE GENSET Excellent Condition 60 HZ 800 KVA 3 SET AVAILABLE
SULZER NEW 6 ASL 25/30 CRANK SHAFT:1 PC
SULZER NEW 6 ASL 25/30 CYL HEAD COMPLETE:10 PCS
SULZER NEW 6 AL 20/24 CRANK SHAFT :2 PCS
SULZER NEW 8AL 20/24 CRANK SHAFT :1 PC
SULZER NEW 8AL 25 CRANK SHAFT :2 PCS
SULZER NEW AL 20/24 CVYL HEAD /BARE:20 PCS
SULZER NEW AL 20/24 CYL LINER :85 PCS
SULZER 16ZV 40/48 STD SECONDHAND CRANKSHAFT : 1 pc
CAT D342 R6 NEW CRANKSHAFT
CAT D353 R6 NEW CRANKSHAFT
CAT D358 A/B V12 NEW CRANKSHAFT
CUMMINS K19, KTA 1150, QSK19 - R6 NEW CRANKSHAFT
CUMMINS VTA 1710 V12 NEW CRANKSHAFT
CUMMINS NH 220 R 6 NEW CRANKSHAFT
CUMMINS 4B/BT R 4 NEW CRANKSHAFT
CUMMINS 6B/BT/BTA R 6 NEW CRANKSHAFT
SULZER RND 76 USED SPARE PARTS
CYL HEADS - PISTONS - CONNECTING RODS - LINERS ETC.....
All the crankshafts are ready for export from our stock in Turkey.
LISTER BLACKSTONE ERSL6MA MARINE GENSETS 3 PCS
-------------------------------------------
MAK 8MU 551 AK COMPLETE MAIN ENGINE 3000 PS 300 RPM
WARTSILA 4R22HF 590 KW 1000 RPM GEN SET
--------------------------------------------------------------
STORK WERKSPOOR 9TM 410A COMPLETE MAIN ENGINE 2 PCS
We have available for sale
MWM TBD 501 -8G MAIN ENGINES
MAN KAWASAKI K6Z 52/90N 6000 HP
B&W ALPHA 10V 23-U 720 RPM 880 HP
B&W HITACHI 9K90GF 125 rpm 30.000 hp Spare Parts
MAN BAZAN V8V 40/54 430 RPM 8900 HP Complete engine and Extra Crankshaft + Bedplate and block
B&W 6L45 GFCA 4350 KW 175 RPM COMPLETE MAIN ENGINE
B&W8L55GFC MAJOR PARTS
3 Set 2001 Model Alfa Laval SU-300
2 set 1998 Model Alfa Laval LOPX 705
MTU 12V 183 COMPLETE ENGINE
YANMAR 6GL-ST 60 HZ 875 KVA GENSETS GOOD CONDITION 4 PCS
DAIHATSU 6PSHTc 26D GENSET 840 PS 720 RPM 2 PCS
DETROIT DIESEL 16V92T INDUSTRIAL GENSET 950 KVA 1500 RPM 50 HZ YEAR OF BUILD 1996
MAK LIST
MAK 552 AK SPARES
8 PCS USED PISTON
8 PCS USED COMPLETE CYL COVER
8 PCS USED CONNECTING ROD
8 PCS USED LINER
MAK 9M453AK USED PARTS
CRANK SHAFT+BLOCK+BEDPLEYT:1 PC
CAM SHAFT:1 PC
CYL HEAD COMPLETE:6 PCS
PUSH ROD :18 PCS
PISTON (4 RING GROOVES TYPE ):12 PCS
CON ROD :9 PCS
FUEL PUMP COMPLETE:9 PCS
LUB OIL PUMP:1 PC
TURBO CHARGER/AIR COOLER:1 PC
GAVARNOR COMPLETE:1 PC
MAK 601C New Cyl Head 1 PCS
MAK 551 AK 4 PCS Secondhand Cyl Heads
MAK 551 AK CON ROD 2 PCS One is NEW other is Secondhand
Deutz 628 Piston - Con Rod - Liner - Cyl Head - etc..
MAK 8M601AK List of Spares
Cylinder head bare 7 PCS
Piston complete 7 PCS
Piston pin 7 PCS
Connecting rod 7 PCS
Cylinder liner 3 PCS
Injection pump 8 PCS
Injection pump roller 8 PCS
Inlet roller 8 PCS
Exh. Roller 8 PCS
Injector 8 PCS
Starting valve 8 PCS
Valve cage bare-used 16 PCS
Valve cage bare-recond 10 PCS
Inlet valve-used 16 PCS
Exh valve-used 21 PCS
Rocker arm-complete 8 PCS
T/c vtr 600-s Complete 1 PCS
Camshaft-complete 1 PCS
Puch rod 16 PCS
Cyl liner lubricator-complete 1 PCS
Governor complete 1 PCS
Lube oil pump-complete 1 PCS
Piston crown-new original 2 PCS
Injection nozzle new 20 PCS
Main bearing pair-new 1 PAIR
Locating bearing new 1 PAIR
For More Information Please contact with us
We can supply many many items also if you have another inquiry please don t hesitate to contact with us
MTU 12V 2000 MAJOR PARTS
BEST REGARDS
BURAK ALDEMIR
www.burakmarine.com
E-mail: info(a)burakmarine.com ( Please Replay to This E-mail address )
skype: burak.aldemir
13 years, 6 months
Re: [Fedora-suds-list] Error connecting to WSDL that requires authentication
by Janet Valbuena
Dear Daniel
Thanks for assistance, but it still doesn’t make sense that I have to pass
the WSDL as parameter to connect to a URL via suds.client.Client where I
will get precisely that same WSDL.
I’m confused.
Thanks anyway. I think I’ll have to get back to SOAPpy unless I hear another
suggestion to fix my problem.
Regards
Janet
On 8/10/10 11:04, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
> Hi Janet,
>
> I can't really tell you what the realm should be because I haven't found
> myself in such situation
>
> You pass the hacked transport (that should be reading the WSDL from the
> "fileFromU2" file object) because the standard transport included in suds
> assumes a plain HTTP download for WSDL files (unless someone in the list
> proves me wrong and can provide a working example, which would be great)
>
> That's why Joshua suggested that you downloaded the file to disk. I only added
> the means to avoid disk storage by passing the WSDL file object directly to a
> suds compliant transport.
>
> But your problem is that you are apparently unable to download the WSDL file
> (therefore the empty "read"). This is where your problem lies and I guess we
> can't remotely help you there.
>
> Best regards
>
> Daniel
>
> On Fri, Oct 8, 2010 at 10:37, Janet Valbuena <janet.valbuena(a)tpp.com.au>
> wrote:
>> Hi Daniel
>>
>> This still doesn’t make sense.
>>
>> I understand you’re suggesting this:
>>
>>
>> WSDL = "http://localhost:18080/external/services/DomService?wsdl"
>> User = “user1”
>> Password = “pass123”
>>
>> # Is this OK?
>> URI = "http://localhost:18080/” <http://localhost:18080/²>
>>
>> # What should the realm be? Is this OK?
>> Realm = “external/services/DomService”
>>
>> import urllib2
>> auth_handler = urllib2.HTTPBasicAuthHandler()
>> auth_handler.add_password(realm=Real, ?uri='your_url_without_the_file_name',
>> user=User, passwd=Password)
>>>>>> opener = urllib2.build_opener(auth_handler)
>>>>>> urllib2.install_opener(opener)
>>>>>>
>> fileFromU2 = urllib2.open(WSDL)
>>
>> #Note that up to this point, the code doesn’t show any errors but
>> fileFromU2.read () is an empty string.
>>
>> # Then I’m supposed to use the transport hack class:
>>
>> myClient = suds.client.Client(WSDL, transport=HackTransport(fileFromU2), etc)
>>
>> # The question is, why should I pass fileFromU2 as a transport parameter,
>> when what I’m trying to get through calling the Client is precisely that
>> WSDL?
>>
>>
>> What I’m really hoping to do (in case I haven’t been clear) is something like
>> this:
>>
>> # Assuming the authorisation issue is solved somehow by producing a ‘t’
>> parameter to pass on here:
>> myClient = suds.client.Client(WSDL, transport=t)
>>
>> # Call some of the methods available in the WSDL, for example:
>> Result = myClient.createAccount({“name”:”janet”, “phone”: “8989898989”,
>> “address”:”12 Victoria St”, “city”:”Manly”, “email”: “janet(a)blahh.xn--com}-ib7a)
>>
>> Is perhaps suds.client.Client NOT the class I need?
>>
>> Thanks again for your time and answers in advance.
>>
>> Cheers
>>
>> Janet
>>
>>
>> On 7/10/10 21:42, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
>>
>>> Hi Janet,
>>>
>>> The code provided by Joshua lets you download the WSDL to a "file" object.
>>> That's why the last statement of his example is:
>>>
>>>> print urllib2.open(WSDL).read()
>>>
>>> whis is basically first opening a file (open), then reading the content to a
>>> string (read) and printing it to standard output. If you simply do:
>>>
>>>> fileFromU2 = urllib2.open(WSDL)
>>>
>>> you get direct acess to the file object and can pass it to the hacked
>>> transport I provided before.
>>>
>>> Best regards
>>>
>>> Daniel
>>>
>>> On Thu, Oct 7, 2010 at 13:03, Janet Valbuena <janet.valbuena(a)tpp.com.au>
>>> wrote:
>>>> Joshua, Daniel
>>>>
>>>> Thanks very much for your quick response.
>>>>
>>>> I tried Joshua’s suggestion but it didn’t work.
>>>>
>>>> I don’t understand what you suggest Daniel. What should fileFromU2 be?
>>>>
>>>> I may be wrong by using the Client method in the first place. ?? The
>>>> purpose of my script is to use an API which is set up as a SOAP service.
>>>>
>>>> Why would I need to download the WSDL file and then pass it to the
>>>> transport hack when I can’t even get the WSDL and the purpose of client =
>>>> Client (WSDL) is to connect to the WSDL itself?
>>>>
>>>> Cheers
>>>>
>>>> Janet
>>>>
>>>>
>>>> On 7/10/10 09:33, "Daniel Rodriguez" <danjrod(a)gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I think the problem is in the connect itself.
>>>>>
>>>>> The standard transport included in suds assumes that only the SOAP calls
>>>>> may need authentication or other things. Downloading the WSDL is attempted
>>>>> with a plain HTTP GET (Not even POST is allowed)
>>>>>
>>>>> I guess that the transport covers at least 95% of standard situations, but
>>>>> it didn't for example cover mine, where I wanted to embed the WSDSL as a
>>>>> string in my code. Of course only with my own transport I could give suds
>>>>> a "file" object with the content of the string.
>>>>>
>>>>> It is my feeling that a better transport could be written (we have seen
>>>>> some examples shared in the mailing list) although some use cases may
>>>>> require re-thinking how a Client is initialized.
>>>>>
>>>>> In the case pertaining to Janet, I guess she may download the WSDL file as
>>>>> you suggest, pass it to the transport hack below. She may then use this
>>>>> transport during client initialization. Obviously this is only good for 1
>>>>> WSDL file. (The transport below can also load WSDL content directly from a
>>>>> string)
>>>>>
>>>>> ?? ?class TransportHack(Transport):
>>>>> ?? ? ? ?def __init__(self, wsdlFile=None, **kwargs):
>>>>> ?? ? ? ? ? ?Transport.__init__(self, **kwargs)
>>>>> ?? ? ? ? ? ?self.wsdlcontent = wsdlFile
>>>>>
>>>>> ?? ? ? ?def open(self, request):
>>>>> ?? ? ? ? ? ?if self.wsdlFile is not None:
>>>>> ?? ? ? ? ? ? ? ?return self.wsdlFile
>>>>>
>>>>> ?? ? ? ? ? ?log.debug('opening: (%s)', request.url)
>>>>> ?? ? ? ? ? ?fp = None
>>>>> ?? ? ? ? ? ?location = request.url.lstrip()
>>>>> ?? ? ? ? ? ?if location.startswith('<?'):
>>>>> ?? ? ? ? ? ? ? ?log.debug('returning url (%s) as StringIO file')
>>>>> ?? ? ? ? ? ? ? ?fp = StringIO(location)
>>>>> ?? ? ? ? ? ?else:
>>>>> ?? ? ? ? ? ? ? ?parsed = urlparse(request.url)
>>>>> ?? ? ? ? ? ? ? ?if parsed.scheme == 'file':
>>>>> ?? ? ? ? ? ? ? ? ? ?log.debug('opening file (%s) with open', parsed.path)
>>>>> ?? ? ? ? ? ? ? ? ? ?try:
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?fp = open(parsed.path)
>>>>> ?? ? ? ? ? ? ? ? ? ?except Exception, e:
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?raise TransportError(str(e), 503, StringIO(''))
>>>>> ?? ? ? ? ? ? ? ?else:
>>>>> ?? ? ? ? ? ? ? ? ? ?log.debug('opening scheme (%s) over the network',
>>>>> parsed.scheme)
>>>>> ?? ? ? ? ? ? ? ? ? ?try:
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?url = request.url
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?log.debug('opening (%s)', url)
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?u2request = u2.Request(url)
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?self.proxy = self.options.proxy
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?return self.u2open(u2request)
>>>>> ?? ? ? ? ? ? ? ? ? ?except u2.HTTPError, e:
>>>>> ?? ? ? ? ? ? ? ? ? ? ? ?raise TransportError(str(e), e.code, e.fp)
>>>>> ?? ? ? ? ? ?return fp
>>>>>
>>>>> Then do something like
>>>>>
>>>>>> myClient = suds.client.Client(wsdl, transport=HackTransport(fileFromU2),
>>>>>> etc)
>>>>>
>>>>>
>>>>> Best regards
>>>>>
>>>>> Daniel
>>>>>
>>>>> On Wed, Oct 6, 2010 at 21:22, Joshua J. Kugler <joshua(a)eeinternet.com>
>>>>> wrote:
>>>>>> On Wednesday 06 October 2010, Janet Valbuena elucidated thus:
>>>>>>> > Hi
>>>>>>> >
>>>>>>> > I'm new to suds (have just downloaded it after getting frustrated
>>>>>>> > with SOAPpy).
>>>>>>> >
>>>>>>> > I'm trying to connect to a WSDL which requires basic HTTP
>>>>>>> > authentication. I have been able to connect to it correctly using PHP
>>>>>>> > but I need to use Python.
>>>>>>> >
>>>>>>> >
>>>>>>> > This is my code:
>>>>>>> >
>>>>>>> > #!/usr/bin/python
>>>>>>> >
>>>>>>> > Username = "user"
>>>>>>> > Password = "pass123"
>>>>>>> > from suds.transport.http import HttpAuthenticated
>>>>>>> > t = HttpAuthenticated(username=Username, password=Password)
>>>>>>> >
>>>>>>> > # WSDL is only available in internal network
>>>>>>> > WSDL = "http://localhost:18080/external/services/DomService?wsdl"
>>>>>>> > from suds.client import Client
>>>>>>> > client = Client(WSDL, transport=t)
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> > And this is the error it returns:
>>>>>>> >
>>>>>>> > Traceback (most recent call last):
>>>>>>> > ? File "./wsdltest.py", line 25, in <module>
>>>>>>> > ? ? client = Client(wsdl, transport=t)
>>>>>>> > ? File "build/bdist.linux-i686/egg/suds/client.py", line 112, in
>>>>>>> > __init__ File "build/bdist.linux-i686/egg/suds/reader.py", line 152,
>>>>>>> > in open File "build/bdist.linux-i686/egg/suds/wsdl.py", line 136, in
>>>>>>> > __init__ File "build/bdist.linux-i686/egg/suds/reader.py", line 79,
>>>>>>> > in open File "build/bdist.linux-i686/egg/suds/reader.py", line 101,
>>>>>>> > in download File "build/bdist.linux-i686/egg/suds/sax/parser.py",
>>>>>>> > line 136, in parse File "/usr/lib/python2.5/xml/sax/expatreader.py",
>>>>>>> > line 107, in parse xmlreader.IncrementalParser.parse(self, source)
>>>>>>> > ? File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 125, in parse
>>>>>>> > ? ? self.close()
>>>>>>> > ? File "/usr/lib/python2.5/xml/sax/expatreader.py", line 217, in
>>>>>>> > close self.feed("", isFinal = 1)
>>>>>>> > ? File "/usr/lib/python2.5/xml/sax/expatreader.py", line 211, in feed
>>>>>>> > ? ? self._err_handler.fatalError(exc)
>>>>>>> > ? File "/usr/lib/python2.5/xml/sax/handler.py", line 38, in
>>>>>>> > fatalError raise exception
>>>>>>> > xml.sax._exceptions.SAXParseException: <unknown>:1:0: no element
>>>>>>> > found
>>>>>>
>>>>>> I would try to download the file with a quick urllib2 script and see
>>>>>> what you get. ?The error is not in the connect (that would raise its
>>>>>> own exception) but in trying to parse what *is* being downloaded.
>>>>>>
>>>>>> Something like:
>>>>>>
>>>>>> import urllib2
>>>>>> auth_handler = urllib2.HTTPBasicAuthHandler()
>>>>>> auth_handler.add_password(realm='name_of_your_realm',
>>>>>> ?? ? ? ? ? ? ? ? ? ? ? ? ?uri='your_url_without_the_file_name',
>>>>>> ?? ? ? ? ? ? ? ? ? ? ? ? ?user=User,
>>>>>> ?? ? ? ? ? ? ? ? ? ? ? ? ?passwd=Password)
>>>>>> opener = urllib2.build_opener(auth_handler)
>>>>>> urllib2.install_opener(opener)
>>>>>>
>>>>>> print urllib2.open(WSDL).read()
>>>>>>
>>>>>> j
>>>>>>
>>>>>> --
>>>>>> Joshua Kugler
>>>>>> Part-Time System Admin/Programmer
>>>>>> http://www.eeinternet.com - Fairbanks, AK
>>>>>> PGP Key: http://pgp.mit.edu/ ?ID 0x73B13B6A
>>>>>> _______________________________________________
>>>>>> suds mailing list
>>>>>> suds(a)lists.fedoraproject.org
>>>>>> https://admin.fedoraproject.org/mailman/listinfo/suds
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
13 years, 6 months
UnicodeDecodeError on calling methods.
by Hynek Schlawack
Hi,
I'm currently having a really bad time with suds 0.4 and the following
web service: https://soap.mediafinanz.de/encashmentLiteral201.wsdl
When calling newClaim() with a typens:Debtor containing an umlaut (in
my case 'ü'), I get a "UnicodeDecodeError: 'ascii' codec can't decode
byte 0xc3 in position 822: ordinal not in range(128)".
Pylons's debugger tells me, that httplib tries to concat the unicode
head: u'POST /encashmentLiteral201 [...]' with the payload which seems
to be an UTF-8 encoded string: '<?xml version="1.0"
encoding="UTF-8"?><SOAP-ENV:Envelope[...]\xc3\xbc[...]'.
If I'm not mistaken, \xc3\xbc is the perfectly correct Unicode point for "ü".
The complete traceback looks like this:
File '<string>', line 2 in start_encashments
File '/vrmd/Dunning/Dunning-0.10dev/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/decorators/rest.py',
line 33 in check_methods
return func(*args, **kwargs)
File '/vrmd/Dunning/Dunning-0.10dev/dunning/controllers/dun.py', line
332 in start_encashments
cc_with_inv=cust)
File '/vrmd/Dunning/Dunning-0.10dev/dunning/controllers/encashment.py',
line 145 in new_claim
nc = soap.service.newClaim(soap.auth, claim, debtor)
File 'build/bdist.linux-x86_64/egg/suds/client.py', line 542 in __call__
File 'build/bdist.linux-x86_64/egg/suds/client.py', line 602 in invoke
File 'build/bdist.linux-x86_64/egg/suds/client.py', line 637 in send
File 'build/bdist.linux-x86_64/egg/suds/transport/https.py', line 64 in send
File 'build/bdist.linux-x86_64/egg/suds/transport/http.py', line 77 in send
File 'build/bdist.linux-x86_64/egg/suds/transport/http.py', line 118 in u2open
File '/vrmd/python2/lib/python2.7/urllib2.py', line 391 in open
response = self._open(req, data)
File '/vrmd/python2/lib/python2.7/urllib2.py', line 409 in _open
'_open', req)
File '/vrmd/python2/lib/python2.7/urllib2.py', line 369 in _call_chain
result = func(*args)
File '/vrmd/python2/lib/python2.7/urllib2.py', line 1181 in https_open
return self.do_open(httplib.HTTPSConnection, req)
File '/vrmd/python2/lib/python2.7/urllib2.py', line 1142 in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File '/vrmd/python2/lib/python2.7/httplib.py', line 946 in request
self._send_request(method, url, body, headers)
File '/vrmd/python2/lib/python2.7/httplib.py', line 987 in _send_request
self.endheaders(body)
File '/vrmd/python2/lib/python2.7/httplib.py', line 940 in endheaders
self._send_output(message_body)
File '/vrmd/python2/lib/python2.7/httplib.py', line 801 in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
822: ordinal not in range(128)
I'm using Python 2.7 and suds 0.4.
So what am I doing wrong? I'm pretty sure to supply all the strings as
Unicode (they come from SQLAlchemy database), I checked it with "print
type()". Receiving umlauts doesn't seem to be a problem.
I'd be most grateful for any hint for I've spent several hours with
this right now. I'd be happy to provide any additional information if
necessary.
TIA,
Hynek
13 years, 6 months