Home | Documentation |
The WinInet plugin
updated Thu Jun 4 2020 by Robert van Engelen
|
By Jack Kustanowitz, Brodie Thiesfield, and Robert van Engelen.
The WinInet plugin for gSOAP enables client applications (not servers) to communicate through Microsoft's WinInet API on Windows. This offers all of the advantages of WinInet-managed internet access through the Internet Options
control panel of Windows, such as HTTP (proxy) authentication, TLS/SSL, and HTTP compression. Therefore, "if IE works, gSOAP works." since these options are shared by IE.
The WinInet project home is at http://code.google.com/p/gsoapwininet.
SOAP_IO
modes of gSOAP (see limitations).TEST.log
, SENT.log
, and RECV.log
).SOAP_IO_CHUNK
mode is used.SOAP_IO_STORE
flag. Otherwise, the message may be buffered twice on every send.soap::fopen
, soap::fposthdr
soap::fsend
, soap::frecv
, soap::fclose
.Add the gsoapWinInet2.h
and gsoapWinInet2.cpp
files to your project. If you have a C project, change the extension to .c
. Disable "precompiled headers" for the .cpp
file.
In your source code for the client, register the WinInet plugin with soap_register_plugin(soap, wininet_plugin)
after creation and initialization of the soap
context.
For example, when using a proxy object in C++ generated with soapcpp2 -j:
and in plain C/C++, that is, without a proxy object:
Note that the receive and send timeouts limit the time to receive and send data, respectively. This behavior differs from the gSOAP engine's timeouts that limit the socket receive and send operation idle times. The gSOAP engine uses transfer_timeout
to limit the receive and send times.
To specify HTTP proxy settings, set the soap.proxy_host
and soap.proxy_port
to the HTTP proxy host and port, respectively, and optionally set soap.proxy_userid
and soap.proxy_passwd
to authenticate to the proxy.
Please make sure to compile all sources in C++ compilation mode. If you migrate to a project file such as .vcproj
, please set CompileAs="2"
in your .vcproj
file.
To control the WinInet's HttpOpenRequest options, register the WinInet plugin with soap_register_plugin_arg()
and supply an argument that is passed on to HttpOpenRequest. For example:
See the MSDN documentation on HttpOpenRequest for details of the HttpOpenRequest flags. The wininet.h
header must be included to use these flags.
INTERNET_FLAG_KEEP_CONNECTION
use keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NT LAN Manager (NTLM), and other types of authentication. This flag is set automatically when the soap context is initalized with SOAP_IO_KEEPALIVE
.INTERNET_FLAG_IGNORE_CERT_CN_INVALID
disables Microsoft Win32 Internet function checking of SSL/PCT- based certificates that are returned from the server against the host name given in the request.INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
disables Win32 Internet function checking of SSL/PCT-based certificates for proper validity dates.If there are errors in sending the HTTP request which would cause a dialog box to be displayed in IE (for instance, invalid certificates on an HTTPS connection), then a dialog will also be displayed by this library. At the moment is is not possible to disable the UI. If you wish to remove the UI then you will need to hack the source to remove the dialog box and resolve the errors programmatically, or supply the appropriate flags to soap_register_plugin_arg()
to disable the unwanted warnings.
MIT open source license.
This open source license is replaced by Genivia's license for commercial use when a commercial-use license is purchased by customer.
The licence text below is the boilerplate "MIT Licence" used from: http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2009, Jack Kustanowitz, Brodie Thiesfield, Robert van Engelen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.