Wednesday, April 24, 2013

Post data with curl when you are behind proxy

I found that SoapUI 4.5.1 have so problems to access some web service endpoint when you are behind proxy. It seems that your authentications is not processed correctly, my proxy server always return HTTP error 407. So I started to play with 'curl' command. Let me show ho to do that:
curl -v --proxy proxy.something.com:8080 --proxy-user myname:password \
 --request POST \
 --header "Content-Type: text/xml;charset=UTF-8" \
 --header "SOAPAction: http://somesite.com:80/adistc/axis2/services/interaface/getAvailableNames" \
 --data @request.txt \
 http://somesite.com:80/adistc/axis2/services/interaface/
Most of parameters are self explaining. Note that @ in parameter --data means that posted data should be find in file 'request.txt'. Headers are not necessary. Obviously in request.xml is your soap XML request. Switch -v shows you request and response data.

No comments:

Post a Comment