2

Currently I am calling an external webservice from command line in Unix :

curl --cert externalcertificate.cer --data @SampleRequest.xml -v https://world-service-dev.intra.a.com:4414/worldservice/CLIC/CaseManagementService/V1

I need to integrate this call in my python code . Then I will put retry logic and response validation around it , what is the optimal way of making this call ? Since its a one way SSL , I also need to make sure my web service call refers to the external server certificate kept on my server as well .

I could not use requests module of Python as it is not installed on the server, I tried using urllib2 but facing multiple issue related to ssl as it is a https call . Now I am trying to call a sub process module : subprocess.call(['curl', '-k', '-H' , 'content-type: application/soap+xml' ,'-d', etree.tostring(tree), '-v' ,'"https://world-service-dev.intra.aexp.com:4414/worldservice/CLIC/CaseManagementService/V1"'])

But getting an error message :

* Protocol "https not supported or disabled in libcurl curl: (1) Protocol "https not supported or disabled in libcurl

2 Answers 2

1

I would use Requests to call that web service.

Sign up to request clarification or add additional context in comments.

3 Comments

I think I can use r = requests.post(url, files=files) but how do I handle the certificate part... how do I make sure I also pass the server certificate while making this call.
Sadly I do not have requests library installed on my python environment and I do not have permissions to install it as well since its QA environment . Is there any other module I can use ?
Have at look at the answers here, specifically this one stackoverflow.com/a/2667545/3236133
0

I had a an extra double quote in front of my URL that was causing this problem to happen , Here is the correct syntax subprocess.call(['curl', '-k', '-i', '-H' , 'content-type: application/soap+xml' ,'-d', etree.tostring(tree), '-v' ,'https://world-service-dev.intra.aexp.com:4414/worldservice/CLIC/CaseManagementService/V1'])

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.