| 1 | |
| 2 | == FDO OGC Integrated Proxy Server Support == |
| 3 | |
| 4 | |
| 5 | === Overview === |
| 6 | |
| 7 | As a result of feedback from customers using the FDO API and the WMS/WFS Providers, a number of requests have arisen to allow access to Web services, such as WMS and WFS, through a proxy server. A proxy server acts as an intermediary between an internal network (Intranet) and the Internet, retrieving files from a remote web services. |
| 8 | |
| 9 | Proxy Server support can be enabled in the OSGeo Web Service providers by enhancing and expanding the connection parameter list that each provider supports. The following sections outline the additional connection properties that will be introduced in order to allow proxy server access. |
| 10 | |
| 11 | === Description === |
| 12 | |
| 13 | The following connection parameters will be added to the WMS and WFS connection string definitions. These properties will also appear in the Connection Property dictionary for each of these providers. |
| 14 | |
| 15 | ==== !ConnectionType ==== |
| 16 | |
| 17 | The !ConnectionType property defines the type of connection that will be used when connecting to the Web service. |
| 18 | |
| 19 | ||'''Property'''||'''Value'''|| |
| 20 | ||Name||!ProxyConnectionType|| |
| 21 | ||!LocalizedName||!ProxyConnectionType (English)|| |
| 22 | ||!DefaultValue||!UseSystemSettings|| |
| 23 | ||!IsRequired||No|| |
| 24 | ||!IsProtected||No|| |
| 25 | ||!IsEnumerable||Yes|| |
| 26 | ||Enumerations||!UseDirectConnection|| |
| 27 | ||||!UseSystemSettings|| |
| 28 | ||||!UseProxyServer|| |
| 29 | ||!IsFileName||No|| |
| 30 | ||!IsFilePath||No|| |
| 31 | ||!IsDatastoreName||No|| |
| 32 | |
| 33 | ''!UseSystemSettings'': Choose this option to use the LAN settings as defined by the operating system[[br]] |
| 34 | ''!UseDirectConnection'': Choose this option to override the system LAN settings and connect directly to the Internet. (Not through a proxy server)[[br]] |
| 35 | ''!UseProxyServer'': Choose this option to use the user-specified proxy server to connect to the Internet[[br]] |
| 36 | |
| 37 | On Windows you can review the current LAN settings by clicking Control Panel > Internet Options > Connections Tab > LAN Settings. This is the default connection setting. |
| 38 | |
| 39 | ==== !ProxyServerName ==== |
| 40 | |
| 41 | The !ProxyServerName property specifies the name of a user specified proxy server that will be used to make the connection to the external web service. |
| 42 | |
| 43 | ||'''Property'''||'''Value'''|| |
| 44 | ||Name||!ProxyServerName|| |
| 45 | ||!LocalizedName||!ProxyServerName (English)|| |
| 46 | ||!DefaultValue|||| |
| 47 | ||!IsRequired||No|| |
| 48 | ||!IsProtected||No|| |
| 49 | ||!IsEnumerable||No|| |
| 50 | ||!IsFileName||No|| |
| 51 | ||!IsFilePath||No|| |
| 52 | ||!IsDatastoreName||No|| |
| 53 | |
| 54 | ==== !ProxyServerPort ==== |
| 55 | |
| 56 | The !ProxyServerPort property specifies the port of the user-specified proxy server that will be used to connect to the Internet. If set, it must be used in conjunction with the !ProxyServerName parameter. |
| 57 | |
| 58 | ||'''Property'''||'''Value'''|| |
| 59 | ||Name||!ProxyServer|| |
| 60 | ||!LocalizedName||!ProxyServer (English)|| |
| 61 | ||!DefaultValue|||| |
| 62 | ||!IsRequired||No|| |
| 63 | ||!IsProtected||No|| |
| 64 | ||!IsEnumerable||No|| |
| 65 | ||!IsFileName||No|| |
| 66 | ||!IsFilePath||No|| |
| 67 | ||!IsDatastoreName||No|| |
| 68 | |
| 69 | ==== !ProxyServerUsername ==== |
| 70 | |
| 71 | The !ProxyServerUsername property specifies the username to be used when connecting to a user-specified proxy server. If set, it must be used in conjunction with the !ProxyServerName and !ProxyServerPassword parameters. |
| 72 | |
| 73 | ||'''Property'''||'''Value'''|| |
| 74 | ||Name||!ProxyServerUsername|| |
| 75 | ||!LocalizedName||!ProxyServerUsername (English)|| |
| 76 | ||!DefaultValue|||| |
| 77 | ||!IsRequired||No|| |
| 78 | ||!IsProtected||No|| |
| 79 | ||!IsEnumerable||No|| |
| 80 | ||!IsFileName||No|| |
| 81 | ||!IsFilePath||No|| |
| 82 | ||!IsDatastoreName||No|| |
| 83 | |
| 84 | ==== !ProxyServerPassword ==== |
| 85 | |
| 86 | The !ProxyServerPassword property specifies the password to be used when connecting to a user-specified proxy server. If set, it must be used in conjunction with the !ProxyServerName and !ProxyServerPassword parameters. |
| 87 | |
| 88 | ||'''Property'''||'''Value'''|| |
| 89 | ||Name||!ProxyServerPassword|| |
| 90 | ||!LocalizedName||!ProxyServerPassword (English)|| |
| 91 | ||!DefaultValue|||| |
| 92 | ||!IsRequired||No|| |
| 93 | ||!IsProtected||Yes|| |
| 94 | ||!IsEnumerable||No|| |
| 95 | ||!IsFileName||No|| |
| 96 | ||!IsFilePath||No|| |
| 97 | ||!IsDatastoreName||No|| |
| 98 | |
| 99 | ==== !ProxyBypassForLocal ==== |
| 100 | |
| 101 | The !ProxyBypassForLocal property specifies whether to use the proxy server for all local (intranet) addresses. Because a proxy server acts as a security barrier between an internal network (intranet) and the Internet, users could need extra permissions from your system administrator to gain access to Web pages through a proxy server. Users may be able to gain access to local addresses easier and faster without using a proxy server. |
| 102 | |
| 103 | ||'''Property'''||'''Value'''|| |
| 104 | ||Name||!ProxyBypassForLocal|| |
| 105 | ||!LocalizedName||!ProxyBypassForLocal(English)|| |
| 106 | ||!DefaultValue||No|| |
| 107 | ||!IsRequired||No|| |
| 108 | ||!IsProtected||No|| |
| 109 | ||!IsEnumerable||Yes|| |
| 110 | ||Enumerations||True|| |
| 111 | ||||False|| |
| 112 | ||!IsFileName||No|| |
| 113 | ||!IsFilePath||No|| |
| 114 | ||!IsDatastoreName||No|| |
| 115 | |
| 116 | ==== Example Usage ==== |
| 117 | |
| 118 | The following are examples of how the connection properties specified above. |
| 119 | |
| 120 | ===== Use System Proxy Server Settings (Default) ===== |
| 121 | |
| 122 | The following is an example using FdoIConnection::!SetConnectionString. |
| 123 | |
| 124 | {{{ |
| 125 | FdoPtr<FdoIConnection> connection = GetConnection (); |
| 126 | FdoStringP connString = |
| 127 | L"FeatureServer=http://www.myserver.com/wfs; |
| 128 | Username=guest; |
| 129 | Password=guest; |
| 130 | Version=1.1.1"); |
| 131 | connection->SetConnectionString(connString); |
| 132 | FdoConnectionState state = connection->Open (); |
| 133 | }}} |
| 134 | |
| 135 | The following is an example using the FdoIConnectionPropertyDictionary. |
| 136 | |
| 137 | {{{ |
| 138 | FdoPtr<FdoIConnection> conn = GetConnection (); |
| 139 | FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo(); |
| 140 | FdoPtr<FdoIConnectionPropertyDictionary> props = info->GetConnectionProperties(); |
| 141 | props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); |
| 142 | props->SetProperty(L"Username", L"guest"); |
| 143 | props->SetProperty(L"Password", L"guest"); |
| 144 | props->SetProperty(L"Version", L"1.1.0"); |
| 145 | FdoConnectionState state = connection->Open (); |
| 146 | }}} |
| 147 | |
| 148 | ===== Use System Proxy Server Settings with Bypass ===== |
| 149 | |
| 150 | The following is an example using FdoIConnection::!SetConnectionString. |
| 151 | |
| 152 | {{{ |
| 153 | FdoPtr<FdoIConnection> connection = GetConnection (); |
| 154 | FdoStringP connString = |
| 155 | L"FeatureServer=http://www.myserver.com/wfs; |
| 156 | Username=guest; |
| 157 | Password=guest; |
| 158 | Version=1.1.1; |
| 159 | ProxyBypassForLocal=true"); |
| 160 | connection->SetConnectionString(connString); |
| 161 | FdoConnectionState state = connection->Open (); |
| 162 | }}} |
| 163 | |
| 164 | The following is an example using the FdoIConnectionPropertyDictionary. |
| 165 | |
| 166 | {{{ |
| 167 | FdoPtr<FdoIConnection> conn = GetConnection (); |
| 168 | FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo(); |
| 169 | FdoPtr<FdoIConnectionPropertyDictionary> props = info->GetConnectionProperties(); |
| 170 | props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); |
| 171 | props->SetProperty(L"Username", L"guest"); |
| 172 | props->SetProperty(L"Password", L"guest"); |
| 173 | props->SetProperty(L"Version", L"1.1.0"); |
| 174 | props->SetProperty(L"ProxyBypassForLocal", L"true"); |
| 175 | FdoConnectionState state = connection->Open (); |
| 176 | }}} |
| 177 | |
| 178 | ===== Use Direct Connection Server Settings ===== |
| 179 | |
| 180 | The following is an example using FdoIConnection::!SetConnectionString. |
| 181 | |
| 182 | {{{ |
| 183 | FdoPtr<FdoIConnection> connection = GetConnection (); |
| 184 | FdoStringP connString = |
| 185 | L"FeatureServer=http://www.myserver.com/wfs; |
| 186 | Username=guest; |
| 187 | Password=guest; |
| 188 | Version=1.1.1; |
| 189 | ConnectionType=UseDirectConnection"); |
| 190 | connection->SetConnectionString(connString); |
| 191 | FdoConnectionState state = connection->Open (); |
| 192 | }}} |
| 193 | |
| 194 | The following is an example using the FdoIConnectionPropertyDictionary. |
| 195 | |
| 196 | {{{ |
| 197 | FdoPtr<FdoIConnection> conn = GetConnection (); |
| 198 | FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo(); |
| 199 | FdoPtr<FdoIConnectionPropertyDictionary> props = info->GetConnectionProperties(); |
| 200 | props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); |
| 201 | props->SetProperty(L"Username", L"guest"); |
| 202 | props->SetProperty(L"Password", L"guest"); |
| 203 | props->SetProperty(L"Version", L"1.1.0"); |
| 204 | props->SetProperty(L"ConnectionType", L"UseDirectConnection"); |
| 205 | FdoConnectionState state = connection->Open (); |
| 206 | }}} |
| 207 | |
| 208 | ===== Use User-Specified Proxy Server ===== |
| 209 | |
| 210 | The following is an example using FdoIConnection::!SetConnectionString. |
| 211 | |
| 212 | {{{ |
| 213 | FdoPtr<FdoIConnection> connection = GetConnection (); |
| 214 | FdoStringP connString = |
| 215 | L"FeatureServer=http://www.myserver.com/wfs; |
| 216 | Username=guest; |
| 217 | Password=guest; |
| 218 | Version=1.1.1; |
| 219 | ConnectionType=UseProxyServer; |
| 220 | ProxyServerName=Server123"); |
| 221 | connection->SetConnectionString(connString); |
| 222 | FdoConnectionState state = connection->Open (); |
| 223 | }}} |
| 224 | |
| 225 | The following is an example using the FdoIConnectionPropertyDictionary. |
| 226 | |
| 227 | {{{ |
| 228 | FdoPtr<FdoIConnection> conn = GetConnection (); |
| 229 | FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo(); |
| 230 | FdoPtr<FdoIConnectionPropertyDictionary> props = info->GetConnectionProperties(); |
| 231 | props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); |
| 232 | props->SetProperty(L"Username", L"guest"); |
| 233 | props->SetProperty(L"Password", L"guest"); |
| 234 | props->SetProperty(L"Version", L"1.1.0"); |
| 235 | props->SetProperty(L"ConnectionType", L"UseProxyServer"); |
| 236 | props->SetProperty(L"ProxyServerName", L"Server123"); |
| 237 | FdoConnectionState state = connection->Open (); |
| 238 | }}} |
| 239 | |
| 240 | ===== Use User-Specified Proxy Server with Password ===== |
| 241 | |
| 242 | The following is an example using FdoIConnection::!SetConnectionString. |
| 243 | |
| 244 | {{{ |
| 245 | FdoPtr<FdoIConnection> connection = GetConnection (); |
| 246 | FdoStringP connString = |
| 247 | L"FeatureServer=http://www.myserver.com/wfs; |
| 248 | Username=guest; |
| 249 | Password=guest; |
| 250 | Version=1.1.1; |
| 251 | ConnectionType=UseProxyServer; |
| 252 | ProxyServerName=Server123; |
| 253 | ProxyServerPort=80; |
| 254 | ProxyServerUsername=user1; |
| 255 | ProxyServerPassword=pwd"); |
| 256 | connection->SetConnectionString(connString); |
| 257 | FdoConnectionState state = connection->Open (); |
| 258 | }}} |
| 259 | |
| 260 | The following is an example using the FdoIConnectionPropertyDictionary. |
| 261 | |
| 262 | {{{ |
| 263 | FdoPtr<FdoIConnection> conn = GetConnection (); |
| 264 | FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo(); |
| 265 | FdoPtr<FdoIConnectionPropertyDictionary> props = info->GetConnectionProperties(); |
| 266 | props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); |
| 267 | props->SetProperty(L"Username", L"guest"); |
| 268 | props->SetProperty(L"Password", L"guest"); |
| 269 | props->SetProperty(L"Version", L"1.1.0"); |
| 270 | props->SetProperty(L"ConnectionType", L"UseProxyServer"); |
| 271 | props->SetProperty(L"ProxyServerName", L"Server123"); |
| 272 | props->SetProperty(L"ProxyServerPort", L"80"); |
| 273 | props->SetProperty(L"ProxyServerUsername", L"user1"); |
| 274 | props->SetProperty(L"ProxyServerPassword", L"pwd"); |
| 275 | FdoConnectionState state = connection->Open (); |
| 276 | }}} |
| 277 | |
| 278 | |
| 279 | |