Connect to web-service

Go To StackoverFlow.com

0

I have some PHP code, similar to that shown below, which makes a connection and gets a response (from a web-service).

How would I do something similar in Python?

$cObj = curl_init();.
curl_setopt($cObj, CURLOPT_URL,$this->urlws.'/trlink/link1/trlink');
curl_setopt($cObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cObj, CURLOPT_TIMEOUT, 20);
curl_setopt($cObj, CURLOPT_HTTPHEADER, array());

curl_setopt($cObj, CURLOPT_POST, 1);
curl_setopt($cObj, CURLOPT_POSTFIELDS,"XMLString=".$xml);

$this->xml_response = curl_exec($cObj);.
2012-04-05 22:24
by MoySal
Please ask the question in English. Not in Spanish. Thanks - Praveen Gollakota 2012-04-05 22:29
Unfortunately this is translated to French, but not Spanish. Maybe you can deduce enough though: http://docs.python.org/howto/urllib2.htm - bernie 2012-04-05 22:55


0

You can try SUDS https://fedorahosted.org/suds/

2012-04-05 22:55
by Anthony Kong
Ads