Link to home
Start Free TrialLog in
Avatar of msgl
msgl

asked on

Web Service reference problem when switching from Win XP dev. environment to Windows 7

Hi,

I am building an application and I am using web services for getting data from a server. It was working fine when I was developing on my XP machine but had to switch to Windows 7. On the new machine I grabbed the latest version of the code using sourcesafe.

However, when I try to add a service reference in the solution or update an existing one I get the following error:

There was an error downloading 'http://localhost:52490/Service/CustomerService.asmx'.
The request failed with the error message:
--

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request.   Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not create type 'Digital_Server.CustomerService'.

            Source Error


<%@ WebService Language="vb" CodeBehind="CustomerService.asmx.vb" Class="Digital_Server.CustomerService" %>

Source File: /Service/CustomerService.asmxLine: 1


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

<!--
[HttpParseException]: Could not create type 'Digital_Server.CustomerService'.
   at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName)
   at System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly)
   at System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults results)
   at System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results)
   at System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results)
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath)
   at System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context)
   at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
   at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
--.
Metadata contains a reference that cannot be resolved: 'http://localhost:52490/Service/CustomerService.asmx'.

An error occurred while receiving the HTTP response to http://localhost:52490/Service/CustomerService.asmx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
If the service is defined in the current solution, try building the solution and adding the service reference again.

Does it has anything to do with the IIS or is it any configuration file I have to change in the solution?

Any help is appreciated.
Avatar of msgl
msgl

ASKER

Also, if I build the application and use a control that tries to use an existing reference I get the following error

An error occurred while receiving the HTTP response to http://localhost:52490/Service/OrderService.asmx. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down)

Must be something with IIS?
In XP it was easier, just install IIS and good to go, with Win 7 there are so many settings.
Avatar of Ashok
Make sure you are using
binding="wsHttpBinding"
Avatar of msgl

ASKER

Hi ashok111,

You mean in the app.config file? It worked with basichttpbinding on my xp machine and my colleagues who build the project on a Windows 7 machine have no problem.

Even if the current service reference have basichttpbinding shouldn't I be able to add a new one when I have the service.asmx in the solution?
Is this Web Based application?  Not that it matters.
Avatar of msgl

ASKER

No it's not
it's a WPF application using some web services for getting data from a server
Avatar of msgl

ASKER

inner exception to error above:

InnerException: System.Net.WebException
       Message="The underlying connection was closed: An unexpected error occurred on a receive."
       Source="System"
       StackTrace:
            at System.Net.HttpWebRequest.GetResponse()
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       InnerException: System.IO.IOException
            Message="Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
            Source="System"
            StackTrace:
                 at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 at System.Net.HttpWebRequest.MakeMemoryStream(Stream stream)
            InnerException: System.Net.Sockets.SocketException
                 ErrorCode=10054
                 Message="An existing connection was forcibly closed by the remote host"
                 NativeErrorCode=10054
                 Source="System"
                 StackTrace:
                      at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 InnerException:
ASKER CERTIFIED SOLUTION
Avatar of msgl
msgl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial