suds

Suds over https with cert

时间秒杀一切 提交于 2019-12-17 17:30:15
问题 I have soap service under Apache with ssl, suds works greate without ssl. I have client certificate (my.crt and user.p12 files). How I need to configure suds client ot make it work with service over https? without certs i see urllib2.URLError: <urlopen error [Errno 1] _ssl.c:499: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure> 回答1: It sounds like you want to authenticate using a client certificate, not a server certificate as was stated in some of the comments. I

suds throwing error 'type not found' consuming SOAP service

柔情痞子 提交于 2019-12-13 15:22:03
问题 I am consuming a SOAP webservice with suds (0.4). The WSDL I am using throws an error >>> import uuid >>> from suds.client import Client >>> wsdl = 'https://toolkit.dnb.com/locked/resource/docs/TransactionAndMessageDefinition/ProductList.wsdl' >>> client = Client(wsdl) The service I am consuming expects one parameter productListRequest , which is a complex type where you put UserId , Password and a complex type of ProductListInput . I fill these with: >>> productListRequest = client.factory

Error with connecting to wsdl?

怎甘沉沦 提交于 2019-12-13 14:26:03
问题 I do : base64string = base64.encodestring('%s:%s' % (userid, passwd)).replace('\n', '') authenticationHeader = { "Authorization" : "Basic %s" % base64string, "Accept-Encoding" :"gzip,deflate", "Content-Length" :"1086", "Host" :"uslugaterytws1test.stat.gov.pl", "Connection" :"Keep-Alive", } client = Client(url=wsdl_url, headers=authenticationHeader) security = Security() token = UsernameToken(userid, passwd) token.setnonce('MyNonceString...') token.setcreated(datetime.now()) security.tokens

How can I use the Aramex API with WSDL and Python?

ぃ、小莉子 提交于 2019-12-13 05:53:55
问题 I found some PHP example code about the Aramex Shipping services and their shipping API on their website. I'm testing my API credentials, but I'm getting the error below. Here is the example code: import xml, fpconst, logging from SOAPpy import WSDL from suds.client import Client logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) url = "http://localhost/shipping-services-api-wsdl.wsdl" client = Client(url) client.sd[0].service.setlocation('http:/

python unable to access suds methods

可紊 提交于 2019-12-13 05:52:17
问题 I am trying to access the SOAP api using SUDS in python from suds.client import Client def initialize(): url = 'http://uuuuuuuuuuuuuuu.com/wewewe/WsNBI?wsdl' username = 'xxxxx' password = 'ppppppp' client = Client(url) print client result = client.service.Login(nbiLogin NBILogin(username,password),) print result i am unable to invoke the Login method, any idea how i can do this? these are the methods returned by the query... Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699

How to get and set ref or out parameters in Python WSDL SOAP client

泄露秘密 提交于 2019-12-13 02:58:52
问题 Using Python with a SOAP client like Suds or Zeep, if I have an API with params defined as ref or out, how do I define them and read them. e.g. a c# method defined so: // this is c# code... bool MyApi( string regularParam1, int regularParam2, ref string refParam3, // set by caller, changed by service, // used as part of the result out string outParam4) // marked as 'out', caller not to set any value, // changed by service and used as part of the result The soap would look so: <soap:Body>

Suds: Type not found on response

半腔热情 提交于 2019-12-12 11:41:55
问题 I'm having a hard time getting a python SOAP client based on suds to parse a response: the client is constructed correctly and parses the WSDL just fine. As far as I can see there are no imports in the WSDL, so this doesn't seem like a typical ImportDoctor issue. Relevant bits from the WSDL: <xsd:complexType name="getFontsRequest"> <xsd:sequence> <xsd:element name="UserID" type="xsd:int" maxOccurs="1" minOccurs="1"></xsd:element> <xsd:element name="TAWSAccessKey" type="xsd:string" maxOccurs=

suds.TypeNotFound: Type not found: 'MerchantCode'

核能气质少年 提交于 2019-12-12 07:20:10
问题 I am developing a web using django and it deals with wsdl. I have an example code in dealing with it but its written on PHP and I wanted to convert it to python for my django. here is the PHP file ... <?php ini_set("soap.wsdl_cache_enabled", "0"); $WSDL = "DirectConnect.test.WSDL"; $MerchantCode = "HELLO"; $MerchantReference = "" . time(); $TransactionType = 20; $Amount = 100; $CurrencyCode = "PHP"; $CardHolderName = "RAUL O REVECHE"; $CardNumber = "4005550000000001"; $ExpiryMonth = 5;

Having problems with Python SOAP using Suds

和自甴很熟 提交于 2019-12-12 04:19:36
问题 I'm having problems with Suds and I can't figure out what makes it behave like this. I'm trying to call a webservice and that service takes one complex type as an argument (ShippingGuideRequestType). I'll post my pdb session and try to explain what is happening. The 'request' variable you see is of type ShippingGuideRequestType and it is created using client.factory.create("ShippingGuideRequestType"). (Pdb) request (ShippingGuideRequestType){ UserInformation = (UserInformationType){ Usercode

How to use Types and Methods with SUDS

▼魔方 西西 提交于 2019-12-12 00:55:06
问题 My code connects to a Autotask service through SUDS. I get a list of Methods, one of which I have to call. I'm new to this, so I'm not sure on how to correctly do this. This is my code, including help by Bodsda: import os, sys import xml.etree.ElementTree as ET from suds.client import Client from suds.sax.element import Element class Init(): def __init__(self): #Search the app.config file for all data to be used script_dir = os.path.dirname(__file__) file_path = "app.config" abs_file_path =