Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

ASP.NET Adding Web Reference

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
walkbk
Asked:
walkbk
  • 6
  • 3
  • 3
  • +1
1 Solution
 
pakkuCommented:
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
 
walkbkAuthor Commented:
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
 
pakkuCommented:
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
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
walkbkAuthor Commented:
Yeah it intalled. I am running IIS 5.1 on Windows XP Pro SP1
0
 
pakkuCommented:
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
 
walkbkAuthor Commented:
I did not have IIS installed when I installed .NET. I gues that could be the problem.
0
 
KBergerCommented:
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
 
DabasCommented:
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
 
walkbkAuthor Commented:
I will try again but it did not work for me.
0
 
DabasCommented:
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
 
walkbkAuthor Commented:
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
 
KBergerCommented:
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
 
walkbkAuthor Commented:
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
 
DabasCommented:
Cool! Thanks Kristof also from me you will get points
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 6
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now