• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 561
  • Last Modified:

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.
0
msgl
Asked:
msgl
  • 5
  • 2
1 Solution
 
msglAuthor Commented:
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.
0
 
AshokCommented:
Make sure you are using
binding="wsHttpBinding"
0
 
msglAuthor Commented:
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?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
AshokCommented:
Is this Web Based application?  Not that it matters.
0
 
msglAuthor Commented:
No it's not
it's a WPF application using some web services for getting data from a server
0
 
msglAuthor Commented:
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:
0
 
msglAuthor Commented:
I right-clicked on the service, set is as start page and then set the server layer as project startup, built it and now it works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now