HTTP Proxy Authentication with gSoap:
HTTP proxy authentication (basic) is enabled at the client-side by setting the soap.proxy_userid and soap.proxy_passwd strings to a username and password, respectively.
For example, a proxy server may request user authentication. Otherwise, access is denied by the proxy (HTTP 407 error).
Example client code fragment to set proxy server, username, and password:
struct soap soap;
soap_init(&soap);
soap.proxy_host = "xx.xx.xx.xx"; // IP or domain
soap.proxy_port = 8080;
soap.proxy_userid = "guest";
soap.proxy_passwd = "guest";
...
A client SOAP request will have the following HTTP header:
POST /XXX HTTP/1.0
Host: YYY User-Agent: gSOAP/2.2 Content-Type: text/xml;
charset=utf-8 Content-Length: nnn Proxy-Authorization: Basic Z3Vlc3Q6Z3Vlc3Q= ...
When X-Forwarded-For headers are returned by the proxy, the header can be accessed in the soap.proxy_from string.
Links:
gSOAP 2.7.10 User Guide - http://www.cs.fsu.edu/~engelen/soapdoc2.html