Showing posts with label resolved. Show all posts
Showing posts with label resolved. Show all posts

Wednesday, March 28, 2012

Web server not running ASP.NET version 1.1 *RESOLVED*

I just tried creating a new ASP.NET web application and I got the following error.

Visual Studio .NET has detected that the specified web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.

IIS 5.1 is installed on my local machine and so is VS.NET 2003.
I am running XP Pro.

When I go into control panel->Add or Remove programms I can see Microsoft .NET Framework 1.1 there in the list.

Do any of you have any ideas.Don't Panic!!!!

I managed to fix it.
I pressed the Help button and the answer was there.

Saturday, March 24, 2012

Web service reference

I should probably add [RESOLVED] to the title since I have this working, but I have some questions about the whole web service reference thing...

My company's sites all have a "find a dealer" page where users can enter a zip/postal code and radius which then calls a web service function that returns a dataset containing a list of dealers within the radius from the entered zip code.

We recently acquired another company who's web site is handled by a third party that still uses old-fashioned asp. They are adding a "find a dealer" page but they don't want the data returned in a .NET dataset - they want it in XML. No problem, right?

I created a new service function that returns an XmlDataDocument:

<WebMethod()> _
Public Function findDealerByZip(ByVal postalCode As String, ByVal radius As String, ByVal distanceUOM As String) As XmlDataDocument
'gathers list of service locations and returns them in an XmlDataDocument

...

End Function

I added the reference to it to a test project, but in that automatically-generated reference the return values are NOT XmlDataDocument:

Public Function findDealerByZip(ByVal postalCode As String, ByVal radius As String, ByVal distanceUOM As String) As System.Xml.XmlNode
Dim results() As Object = Me.Invoke("findDealerByZip", New Object() {postalCode, radius, distanceUOM})
Return CType(results(0),System.Xml.XmlNode)
End Function

The project reference returns an XmlNode, not an XmlDataDocument. I was pulling my hair out trying to understand why I was getting a "Specified cast was not valid" error until I saw the return value in the reference was changed. Once I changed the return type in my test project to expect an XmlNode instead of an XmlDataDocument I no longer get the error.

Does anybody know why the return type in the reference was changed? I don't understand it.I would have said from a cursory glance the namespace you used was looking for xml.node instead of document which is why when you built your solution once you added your webservice the program itself was hardcoded by design would look for xml.node as opposed to xml.document. Are you using Imports System.Xml in the project or something more specific under that heading ?
I do not remember why, but I remember that you cannot return an XMLDataDocument from a web service. You can return an XMLNode, or an XMLDocument, or even a string which your ASP code takes and converts into its XMLDocument, but not XMLDataDocument.