Microsoft KB Archive/330221

= PRB: Common Proxy Server and Firewall Issues with MapPoint Web Services =

Article ID: 330221

Article Last Modified on 2/9/2004

-

APPLIES TO


 * Microsoft MapPoint Web Service 3.0

-



This article was previously published under Q330221



SYMPTOMS
MapPoint .NET is a HTTP-based Web service that is delivered over TCP/IP. The operation, connectivity, and performance of MapPoint .NET can be impacted by the proxy server and firewall environment. Client applications access the service through this environment. The following errors are related to the proxy server and firewall issues. This article describes potential solutions for these errors.

You may receive one of the following errors from a client application that is accessing the MapPoint .NET Web service.

Error 1
&quot;The underlying connection was closed: The remote name could not be resolved.&quot;

Error 2
&quot;The request failed with HTTP status 502: Proxy Error&quot;

Error 3
&quot;The request failed with the error message: -- Server Error in '/Find-20' Application.

Request format is unrecognized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Request format is unrecognized.&quot;

Error 4
&quot;The request failed with HTTP status 407: Proxy authentication required. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The request failed with HTTP status 407: Proxy authentication required.&quot;



Error 1
&quot;The underlying connection was closed: The remote name could not be resolved.&quot;

This error typically occurs if the network environment routes traffic through an HTTP proxy server, and the client application cannot read the proxy settings automatically from the registry. The problem is more likely to occur if the Web service client is an ASP.NET web application, because Web applications do not typically run on an interactive user account. Therefore, Web applications do not always have access to the browser proxy settings in the registry.

Error 2
&quot;The request failed with HTTP status 502: Proxy Error&quot;

This error may occur if MapPoint .NET is behind a proxy server or a firewall that enforces limits on SOAP packet size, or that has a timeout value that is less that the time it takes for a large request to return. For example, a call to MapPoint .NET to render a map with a large number of pushpins causes a large SOAP packet to be returned, and causes a request that takes longer to process than the timeout value allows. This may cause the request to fail, depending on the proxy and firewall configuration for the network.

Error 3
&quot;The request failed with the error message: -- Server Error in '/Find-20' Application.

Request format is unrecognized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Request format is unrecognized.&quot;

This error may occur if a proxy or firewall is set to remove unknown headers.

Error 4
&quot;The request failed with HTTP status 407: Proxy authentication required. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The request failed with HTTP status 407: Proxy authentication required.&quot;

This error occurs if the proxy server requires authentication from a domain user account. This error typically occurs if the MapPoint .NET client is an ASP.NET application. ASP.NET applications typically run on the security context of a local user account that does not have permissions on the network and proxy server.



Error 1
To resolve this error, use one of the two following options:

 Configure the proxy server in Machine.config or in Web.config.   For Machine.config, you must modify defaultProxy element as follows:     For Web.config, add the defaultProxy element as a child of the System.net element.   Configure the proxy server as in the following code.

Microsoft Visual Basic .NET Dim myProxy As New WebProxy(&quot;http://proxyserver:port&quot;, True) Dim myFindService As New FindServiceSoap myFindService.Proxy = myProxy Microsoft C# WebProxy myProxy = new WebProxy(&quot;http://proxyserver:port&quot;,true); FindServiceSoap myFindService = new FindServiceSoap; myFindService.Proxy = myProxy; Note You must set the proxy for each MapPoint .NET SOAP service that you call (Common, Find, Render, and Route). Also, you must use the IMPORTS statement for Visual Basic .NET or the Using directive for C# to reference the &quot;System.Net&quot; namespace to have access to the WebProxy class. </li></ol>

Error 2
To resolve this error, do the following:
 * Bypass the proxy server, and then configure the proxy server to accept large SOAP packets.
 * Increase the timeout value for requests.
 * Limit the data that you request.

Each solution may be different. The correct solution depends on the network environment that you use to call the Web service. Work with your network administrator to determine the specific settings that are required for the SOAP packets to be successfully sent to and received from the MapPoint .NET service.

Error 3
Work with your network administrator to correctly configure your firewall to accept the SOAP headers. In some cases, you can just select the Remove Unknown Headers box in the firewall configuration.

Error 4
Configure the proxy server as in the following code.

Visual Basic .NET Dim myProxy As New WebProxy(&quot;http://proxyserver:port&quot;, True) myProxy.Credentials = New NetworkCredential(&quot;username&quot;, &quot;password&quot;, &quot;domain&quot;) Dim myFindService As New FindServiceSoap myFindService.Proxy = myProxy C# WebProxy myProxy = new WebProxy(&quot;http://proxyserver:port&quot;,true); myProxy.Credentials = new NetworkCredential(&quot;username&quot;, &quot;password&quot;, &quot;domain&quot;); FindServiceSoap myFindService = new FindServiceSoap; myFindService.Proxy = myProxy; Note You must set the proxy for each MapPoint .NET SOAP service that you call (Common, Find, Render, and Route). You must use the IMPORTS statement for Visual Basic .NET or the Using directive for C# to reference the &quot;System.Net&quot; namespace, and to have access to the WebProxy class and the NetworkCredential class.

Keywords: kbprb KB330221

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.