?
Solved

ASP.NET Adding Web Reference

Posted on 2003-02-27
14
Medium Priority
?
465 Views
Last Modified: 2013-11-25
I am doing a simple ASP.NET walthrough from .NET search (Walkthrough: Creating a Distributed Application). When I try to add a web reference from the Web Client to the Web Service it returns this error.

The document at the url http://localhost/AuthorsWebService69/AuthorsWebService69.vsdisco was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'WSDL Document' is 'There is an error in XML document (2, 2).'.
  - <dynamicDiscovery xmlns='urn:schemas-dynamicdiscovery:disco.2000-03-17'> was not expected.
- Report from 'DISCO Document' is 'Discovery document at the URL http://localhost/AuthorsWebService69/AuthorsWebService69.vsdisco could not be found.'.
  - The document format is not recognized.
- Report from 'XML Schema' is 'Expected Schema root. Make sure that the root element is <schema> and the namespace is 'http://www.w3.org/2001/XMLSchema' for an XSD schema or 'urn:schemas-microsoft-com:xml-data' for an XDR schema. An error occurred at (2, 2).'.

This is what is contained in the .vsdisco file that it tells me to reference.

  <?xml version="1.0" encoding="utf-8" ?>
- <dynamicDiscovery xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17">
  <exclude path="_vti_cnf" />
  <exclude path="_vti_pvt" />
  <exclude path="_vti_log" />
  <exclude path="_vti_script" />
  <exclude path="_vti_txt" />
  <exclude path="Web References" />
  </dynamicDiscovery>

Any help would be appreciated.
0
Comment
Question by:walkbk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
  • +1
14 Comments
 

Expert Comment

by:pakku
ID: 8034897
It looks like your ASP.NET is not configured properly.  Try this out.

1. Make sure your IIS is up and running.
2. Open a command prompt and change to the directory where your .NET Framework is installed. Usually it will be

C:\WINNT\Microsoft.NET\Framework\v1.0.3705

3. Run aspnet_regiis utility with -i option.

4. once the asp.net is registered properly try again what you are doing now. This should fix the problem.

Prakash
0
 

Author Comment

by:walkbk
ID: 8035682
Prakash

I did what you said and it seems to have got a little better but I am now getting this error.

The document was not recognized as a known document type (WSDL, XML Schema, or Discovery document) for the following reason:
  - The content type 'application/octet-stream' is not valid for an XML document.

here is the xml

<?xml version="1.0" encoding="utf-8" ?>
- <dynamicDiscovery xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17">
  <exclude path="_vti_cnf" />
  <exclude path="_vti_pvt" />
  <exclude path="_vti_log" />
  <exclude path="_vti_script" />
  <exclude path="_vti_txt" />
  <exclude path="Web References" />
  </dynamicDiscovery>
0
 

Expert Comment

by:pakku
ID: 8035789
Did aspnet_regiis execution go successfully?
I think for some reason your ASP.NET is not getting installed. Which version of IIS are you using and on what platform?

Prakash
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:walkbk
ID: 8035861
Yeah it intalled. I am running IIS 5.1 on Windows XP Pro SP1
0
 

Expert Comment

by:pakku
ID: 8036128
For some reason, Windows XP has problems. I have seen this happening. But when i ran, aspnet_regiis the problem got solved.  Strange in your case.

I would suggest reinstalling VS.NET, making sure IIS is up and running while doing so. And then give a try.

Windows 2000 would be my operating system if you ask me.

Good luck.
0
 

Author Comment

by:walkbk
ID: 8036172
I did not have IIS installed when I installed .NET. I gues that could be the problem.
0
 
LVL 3

Expert Comment

by:KBerger
ID: 8040955
Hi!

Is it right, you try to reference the discovery file?
What you should reference is the wsdl-file, not the vsdisco file.
There should be an asmx-file in the directory:

http://localhost/AuthorsWebService69/AuthorsWebService69.asmx

Append a '?wsdl' to the path to get the web-services contract:

http://localhost/AuthorsWebService69/AuthorsWebService69.asmx?wsdl

Hope that helps!

Kristof

0
 
LVL 27

Expert Comment

by:Dabas
ID: 8062008
Thanks to everybody that has answered walkbk question, as I had exactly the same problem and was about to post this question myself.

I have in common with walkbk that I am running XP-Pro and IIS 5.1 and I installed IIS AFTER VS.Net (Maybe this is significant?)

pakku's answer helped, same as walkbk, but it did not solve the problem.

Running Service.asmx (without the ?wsdl) as proposed by KBerger solved the problem for me!

Thanks again to all of you!

Dabas
0
 

Author Comment

by:walkbk
ID: 8062049
I will try again but it did not work for me.
0
 
LVL 27

Expert Comment

by:Dabas
ID: 8062130
walkbk:

I do not know if this might help, but just in case.

Assuming your webservice is named AuthorsWebService, have you tried to load

http://localhost/AuthorWebService/

In my case it gave me a list of all of the files in that folder, from which I then chose the one with the .asmx extension

Dabas
0
 

Author Comment

by:walkbk
ID: 8063757
This is what I get when I try to look in the directory to add the web reference. I set the security in IIS for integrated windows authentication and it still gives me this. I think I must be missing something somewhere.

Web Services
 
(none)
No Web References were found on this page.
Click for help on finding a Web Reference.
 
 
Errors
 
There was an error downloading 'http://localhost/AuthorsWebService/'.

The request failed with HTTP status 403: Access Forbidden.
 
0
 
LVL 3

Accepted Solution

by:
KBerger earned 200 total points
ID: 8070027
Hi walkbk!

A webreference must point to a valid WSDL-File.
The error message you get is caused by your IIS-Config which does not seen to allow directory listing for the directory AuthorsWebService.

Have a look into the directory, and look for a file with the extension 'asmx'. This is your actual service.
To create a reference to this service, you need to query the WSDL (The XML-description of the service-interface).

You should type the following into the web-reference dialog:

http://localhost/AuthorsWebService/AuthorsWebService69.asmx?wsdl

MIND THE '?WSDL' AT THE END.
This tells the service to send it's own description to the client!

This should work. If it doesn't, the name of the directory isn't correct, or the asmx-File has another name.
In the worst case, your service has never been build, which you should check either.

Kind regards!

Kristof
0
 

Author Comment

by:walkbk
ID: 8071125
It turns out that the IIS was not set to allow for directory browsing, therefore I could not see anything. Once I turned it on it worked exactly as the tutorial said it would.
0
 
LVL 27

Expert Comment

by:Dabas
ID: 8071224
Cool! Thanks Kristof also from me you will get points
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question